shubhamjaiswar commited on
Commit
3c51bb4
·
verified ·
1 Parent(s): 9823b15

Change Confidence Format

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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": f"{confidence:.2%}"
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": f"{confidence:.2%}"
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