mskov commited on
Commit
f5e59d1
1 Parent(s): 8dbe0c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
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