Spaces:
Sleeping
Sleeping
Change Confidence Format
Browse files
app.py
CHANGED
@@ -144,14 +144,14 @@ def predict_hate_speech(audio_path):
|
|
144 |
if confidence > 0.65 and predicted_class == 1:
|
145 |
result = {
|
146 |
"Classification": "Hate Speech\n",
|
147 |
-
"Confidence":
|
148 |
}
|
149 |
else:
|
150 |
if confidence < 0.5 and predicted_class == 1:
|
151 |
confidence = 1 - confidence
|
152 |
result = {
|
153 |
"Classification": "Non-Hate Speech\n",
|
154 |
-
"Confidence":
|
155 |
}
|
156 |
|
157 |
return result
|
|
|
144 |
if confidence > 0.65 and predicted_class == 1:
|
145 |
result = {
|
146 |
"Classification": "Hate Speech\n",
|
147 |
+
"Confidence": confidence
|
148 |
}
|
149 |
else:
|
150 |
if confidence < 0.5 and predicted_class == 1:
|
151 |
confidence = 1 - confidence
|
152 |
result = {
|
153 |
"Classification": "Non-Hate Speech\n",
|
154 |
+
"Confidence": confidence
|
155 |
}
|
156 |
|
157 |
return result
|