davidmasip commited on
Commit
57faf69
1 Parent(s): 4565f82

highlighted text

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -21,7 +21,8 @@ def racism_analysis(text):
21
  if results["label"] == "LABEL_0"
22
  else results["score"]
23
  )
24
- return label, round(100 * score)
 
25
 
26
 
27
  gradio_ui = gr.Interface(
@@ -34,6 +35,7 @@ gradio_ui = gr.Interface(
34
  outputs=[
35
  gr.outputs.Textbox(label="Label"),
36
  gr.outputs.Textbox(label="Racism score (0 - 100)"),
 
37
  ],
38
  examples=[
39
  ["Unos menas roban a una mujer"],
 
21
  if results["label"] == "LABEL_0"
22
  else results["score"]
23
  )
24
+ return label, round(100 * score), [('H', None), ('o', '-'), ('e', '+'), ('l', None), ('a', None)]
25
+
26
 
27
 
28
  gradio_ui = gr.Interface(
 
35
  outputs=[
36
  gr.outputs.Textbox(label="Label"),
37
  gr.outputs.Textbox(label="Racism score (0 - 100)"),
38
+ gr.outputs.HighlightedText(color_map={"+": "green", "-": "pink"}),
39
  ],
40
  examples=[
41
  ["Unos menas roban a una mujer"],