davidmasip commited on
Commit
943c46f
1 Parent(s): 12b2762

add color map

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