Spaces:
Running
Running
siddhantuniyal
commited on
fix: remove newline character in audio result
Browse files
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
|
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
|
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 |
|