Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,8 +92,6 @@ def classify_email(text):
|
|
| 92 |
vote = response['prediction']
|
| 93 |
votes[vote] += 1
|
| 94 |
probabilities[model_name] = response['probabilities']
|
| 95 |
-
|
| 96 |
-
print(probabilities)
|
| 97 |
|
| 98 |
response = ""
|
| 99 |
i = 1
|
|
@@ -104,11 +102,12 @@ def classify_email(text):
|
|
| 104 |
else:
|
| 105 |
response += f"{label}: {vote_count} {vote_or_votes}\n"
|
| 106 |
i += 1
|
|
|
|
| 107 |
|
| 108 |
for model_name in model_names:
|
| 109 |
response += f"{model_name}: "
|
| 110 |
for j, prob in enumerate(probabilities[model_name][0]):
|
| 111 |
-
response += f"{labels[j]}: {prob:.2f}%"
|
| 112 |
response += "\n"
|
| 113 |
|
| 114 |
return response
|
|
|
|
| 92 |
vote = response['prediction']
|
| 93 |
votes[vote] += 1
|
| 94 |
probabilities[model_name] = response['probabilities']
|
|
|
|
|
|
|
| 95 |
|
| 96 |
response = ""
|
| 97 |
i = 1
|
|
|
|
| 102 |
else:
|
| 103 |
response += f"{label}: {vote_count} {vote_or_votes}\n"
|
| 104 |
i += 1
|
| 105 |
+
response += "\n"
|
| 106 |
|
| 107 |
for model_name in model_names:
|
| 108 |
response += f"{model_name}: "
|
| 109 |
for j, prob in enumerate(probabilities[model_name][0]):
|
| 110 |
+
response += f"{labels[j]}: {prob:.2f}% "
|
| 111 |
response += "\n"
|
| 112 |
|
| 113 |
return response
|