davidmasip commited on
Commit
551394e
·
1 Parent(s): e9f9452

racist scores

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,9 +32,9 @@ def racism_analysis(text):
32
  racism_analysis_pipe(sentence, return_all_scores=True)[
33
  0][1]["score"]
34
  if words[word] > 10:
35
- color = "red"
36
  elif words[word] > 2:
37
- color = "pink"
38
  else:
39
  color = None
40
 
@@ -56,7 +56,7 @@ gradio_ui = gr.Interface(
56
  gr.outputs.Textbox(label="Label"),
57
  gr.outputs.Textbox(label="Racism score (0 - 100)"),
58
  gr.outputs.HighlightedText(
59
- label="Racist heatmap", color_map={"red": "red", "pink": "pink"}),
60
  ],
61
  examples=[
62
  ["Unos menas roban a una mujer"],
 
32
  racism_analysis_pipe(sentence, return_all_scores=True)[
33
  0][1]["score"]
34
  if words[word] > 10:
35
+ color = "Racist"
36
  elif words[word] > 2:
37
+ color = "Unknown"
38
  else:
39
  color = None
40
 
 
56
  gr.outputs.Textbox(label="Label"),
57
  gr.outputs.Textbox(label="Racism score (0 - 100)"),
58
  gr.outputs.HighlightedText(
59
+ label="Racist heatmap", color_map={"Racist": "red", "Unknown": "pink"}),
60
  ],
61
  examples=[
62
  ["Unos menas roban a una mujer"],