File size: 363 Bytes
f1ef7e2
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
class AcousticEmotionClassifier:
    def __init__(self, model_checkpoint: str = "wav2vec2-lg-xlsr-en-speech-emotion-recognition"):
        self.checkpoint = model_checkpoint

    def predict_emotion(self, audio_segment):
        # Wraps fine-tuned Wav2Vec2 inference processing
        return {
            "label": "neutral",
            "score": 0.94
        }