Spaces:
Sleeping
Sleeping
Kingston Yip
commited on
Commit
·
37cf69d
1
Parent(s):
7f81307
update app
Browse files
app.py
CHANGED
|
@@ -27,20 +27,11 @@ from transformers import pipeline
|
|
| 27 |
pipe = pipeline(task="sentiment-analysis")
|
| 28 |
st.title("Toxic Tweets Analyzer")
|
| 29 |
|
| 30 |
-
text = st.text_area("
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
"PICKLE YE",
|
| 36 |
-
"I'm nice at ping pong"
|
| 37 |
-
"My eyes are now wide open and now realize I've been used to spread messages I don't believe in. I am distancing myself from politics and completely focusing on being creative !!!",
|
| 38 |
-
"There are so many lonely emojis",
|
| 39 |
-
]
|
| 40 |
-
|
| 41 |
-
st.json([pipe(d) for d in data])
|
| 42 |
-
|
| 43 |
-
else:
|
| 44 |
out = pipe(text)
|
| 45 |
st.json(out)
|
| 46 |
|
|
|
|
| 27 |
pipe = pipeline(task="sentiment-analysis")
|
| 28 |
st.title("Toxic Tweets Analyzer")
|
| 29 |
|
| 30 |
+
text = st.text_area("I'm nice at ping pong")
|
| 31 |
+
|
| 32 |
+
st.form_submit_button(label="Submit")
|
| 33 |
+
|
| 34 |
+
if text:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
out = pipe(text)
|
| 36 |
st.json(out)
|
| 37 |
|