Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,13 +16,13 @@ def predict(text):
|
|
16 |
label = result['label']
|
17 |
score = result['score']
|
18 |
if label in ["Politeness"]:
|
19 |
-
response += f"<span style='background-color
|
20 |
if label in ["Sentiment"]:
|
21 |
-
response += f"<span style='background-color
|
22 |
if label in ["Formality"]:
|
23 |
-
response += f"<span style='background-color
|
24 |
if label in ["Toxicity"]:
|
25 |
-
response += f"<span style='background-color
|
26 |
else:
|
27 |
response += f"{label}: {score:.3f}<br>"
|
28 |
|
|
|
16 |
label = result['label']
|
17 |
score = result['score']
|
18 |
if label in ["Politeness"]:
|
19 |
+
response += f"<span style='background-color:#b8e994; color:black;'>{label}</span>: {score:.3f}<br>" # Light Green
|
20 |
if label in ["Sentiment"]:
|
21 |
+
response += f"<span style='background-color:#fff3cd; color:black;'>{label}</span>: {score:.3f}<br>" # Light Yellow
|
22 |
if label in ["Formality"]:
|
23 |
+
response += f"<span style='background-color:#bee5eb; color:black;'>{label}</span>: {score:.3f}<br>" # Light Blue
|
24 |
if label in ["Toxicity"]:
|
25 |
+
response += f"<span style='background-color:#f8d7da; color:black;'>{label}</span>: {score:.3f}<br>" # Light Red
|
26 |
else:
|
27 |
response += f"{label}: {score:.3f}<br>"
|
28 |
|