siddhantuniyal commited on
Commit
d1e1248
·
verified ·
1 Parent(s): c72e0ba

fix: remove newline character in audio result

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -70,11 +70,11 @@ def predict_hate_speech(audio_path):
70
  threshold = 0.6
71
  isHate = (engResult[0] != "NEITHER" and engResult[1] > threshold) or (
72
  hingResult[0] != "NAG" and hingResult[1] > threshold) or (
73
- audResult['Classification'] == 'Hate Speech\n' and audResult['Confidence'] > threshold)
74
 
75
  engConf = engResult[1] if engResult[0] != "NEITHER" else (1 - engResult[1])
76
  hingConf = hingResult[1] if hingResult[0] != "NEITHER" else (1 - hingResult[1])
77
- audConf = audResult['Confidence'] if audResult['Classification'] == 'Hate Speech\n' else (1 - audResult['Confidence'])
78
 
79
  confidence = (engConf + hingConf + audConf) / 3
80
 
 
70
  threshold = 0.6
71
  isHate = (engResult[0] != "NEITHER" and engResult[1] > threshold) or (
72
  hingResult[0] != "NAG" and hingResult[1] > threshold) or (
73
+ audResult['Classification'] == 'Hate Speech' and audResult['Confidence'] > threshold)
74
 
75
  engConf = engResult[1] if engResult[0] != "NEITHER" else (1 - engResult[1])
76
  hingConf = hingResult[1] if hingResult[0] != "NEITHER" else (1 - hingResult[1])
77
+ audConf = audResult['Confidence'] if audResult['Classification'] == 'Hate Speech' else (1 - audResult['Confidence'])
78
 
79
  confidence = (engConf + hingConf + audConf) / 3
80