gilramos commited on
Commit
fc1fddc
1 Parent(s): 448041d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -17
app.py CHANGED
@@ -8,19 +8,6 @@ app_description = """
8
  This app detects hate speech on Portuguese text using multiple models. You can either introduce your own sentences by filling in "Text" or click on one of the examples provided below.
9
  """
10
 
11
- app_examples = [
12
- ["As pessoas tem que perceber que ser 'panasca' não é deixar de ser homem, é deixar de ser humano hahaha"],
13
- ["Hoje tive uma conversa muito agradável com um colega meu"],
14
- ]
15
-
16
- output_textbox_component_description = """
17
- This box will display the hate speech detection results based on the average score of multiple models.
18
- """
19
-
20
- output_json_component_description = { "breakdown": """
21
- This box presents a detailed breakdown of the evaluation for each model.
22
- """}
23
-
24
  model_list = [
25
  "knowhate/HateBERTimbau",
26
  "knowhate/HateBERTimbau-youtube",
@@ -39,8 +26,8 @@ def predict(chosen_model):
39
  return predicted_label
40
 
41
  inputs = [
42
- gr.Textbox(label="Text", value=app_examples[0][0]),
43
- gr.Dropdown(label="Model", choices=model_list, value=model_list[0])
44
  ]
45
 
46
  outputs = [
@@ -49,5 +36,4 @@ outputs = [
49
 
50
 
51
  gr.Interface(fn=predict, inputs=inputs, outputs=outputs, title=app_title,
52
- description=app_description,
53
- examples=app_examples).launch()
 
8
  This app detects hate speech on Portuguese text using multiple models. You can either introduce your own sentences by filling in "Text" or click on one of the examples provided below.
9
  """
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  model_list = [
12
  "knowhate/HateBERTimbau",
13
  "knowhate/HateBERTimbau-youtube",
 
26
  return predicted_label
27
 
28
  inputs = [
29
+ gr.Textbox(label="Text"),
30
+ gr.Dropdown(label="Model", choices=model_list, value=model_list[1])
31
  ]
32
 
33
  outputs = [
 
36
 
37
 
38
  gr.Interface(fn=predict, inputs=inputs, outputs=outputs, title=app_title,
39
+ description=app_description).launch()