Spaces:
Runtime error
Runtime error
Commit
·
cdcf972
1
Parent(s):
551394e
change labels
Browse files
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 = "
|
36 |
elif words[word] > 2:
|
37 |
-
color = "
|
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={"
|
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 = "Very racist"
|
36 |
elif words[word] > 2:
|
37 |
+
color = "Racist"
|
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={"Very racist": "red", "Racist": "pink"}),
|
60 |
],
|
61 |
examples=[
|
62 |
["Unos menas roban a una mujer"],
|