Spaces:
Runtime error
Runtime error
Javier Beltrán
commited on
Commit
·
a8cc435
1
Parent(s):
7f18513
Update interface
Browse files
app.py
CHANGED
@@ -6,9 +6,11 @@ def predict(text):
|
|
6 |
prediction = pipe(text, return_all_scores=True)[0]
|
7 |
return {"Toxic": prediction[0]["score"], "Very Toxic": prediction[1]["score"]}
|
8 |
|
9 |
-
interface = gr.Interface(predict, gr.inputs.Textbox(
|
|
|
10 |
capture_session=True, interpretation=None,
|
11 |
-
|
|
|
12 |
|
13 |
interface.launch()
|
14 |
|
|
|
6 |
prediction = pipe(text, return_all_scores=True)[0]
|
7 |
return {"Toxic": prediction[0]["score"], "Very Toxic": prediction[1]["score"]}
|
8 |
|
9 |
+
interface = gr.Interface(predict, gr.inputs.Textbox(placeholder="Paste a tweet here", label="Tweet text"),
|
10 |
+
gr.outputs.Label(num_top_classes=2, label="This tweet is..."),
|
11 |
capture_session=True, interpretation=None,
|
12 |
+
title="Is your favorite Spanish politician toxic on Twitter? Test it here!",
|
13 |
+
theme="huggingface")
|
14 |
|
15 |
interface.launch()
|
16 |
|