Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -116,7 +116,9 @@ def classify_toxicity(audio_file, classify_anxiety, emo_class, explitive_selecti
|
|
| 116 |
# label_score_pairs = [(label, score) for label, score in zip(classification_output['labels'], classification_output['scores'])]
|
| 117 |
label_score_dict = {label: score for label, score in zip(classification_output['labels'], classification_output['scores'])}
|
| 118 |
k = max(label_score_dict, key=label_score_dict.get)
|
|
|
|
| 119 |
maxval = label_score_dict[k]
|
|
|
|
| 120 |
if maxval > toxicity_score:
|
| 121 |
if maxval > threshold:
|
| 122 |
print("Toxic")
|
|
|
|
| 116 |
# label_score_pairs = [(label, score) for label, score in zip(classification_output['labels'], classification_output['scores'])]
|
| 117 |
label_score_dict = {label: score for label, score in zip(classification_output['labels'], classification_output['scores'])}
|
| 118 |
k = max(label_score_dict, key=label_score_dict.get)
|
| 119 |
+
print("k keys: ", k)
|
| 120 |
maxval = label_score_dict[k]
|
| 121 |
+
print("max value: ", maxval)
|
| 122 |
if maxval > toxicity_score:
|
| 123 |
if maxval > threshold:
|
| 124 |
print("Toxic")
|