Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,6 +30,11 @@ def classify_toxicity(audio_file, text_input, classify_anxiety):
|
|
| 30 |
|
| 31 |
# Extract the transcribed text
|
| 32 |
transcribed_text = transcription_results["transcription"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
else:
|
| 34 |
transcribed_text = text_input
|
| 35 |
|
|
|
|
| 30 |
|
| 31 |
# Extract the transcribed text
|
| 32 |
transcribed_text = transcription_results["transcription"]
|
| 33 |
+
|
| 34 |
+
#### Emotion classification ####
|
| 35 |
+
emotion_classifier = foreign_class(source="speechbrain/emotion-recognition-wav2vec2-IEMOCAP", pymodule_file="custom_interface.py", classname="CustomEncoderWav2vec2Classifier")
|
| 36 |
+
out_prob, score, index, text_lab = emotion_classifier.classify_file(audio_file.name)
|
| 37 |
+
|
| 38 |
else:
|
| 39 |
transcribed_text = text_input
|
| 40 |
|