Javier Beltrán commited on
Commit
a8cc435
1 Parent(s): 7f18513

Update interface

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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(), gr.outputs.Label(num_top_classes=2),
 
10
  capture_session=True, interpretation=None,
11
- title="Is your favorite Spanish politician toxic on Twitter? Test it here!")
 
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