Spaces:
Runtime error
Runtime error
Download ml-services/src/classifier.py from aniketqxp/call-qa-processing: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/spaces/aniketqxp/call-qa-processing/resolve/main/ml-services/src/classifier.py
- Command line
-
hf download hf://spaces/aniketqxp/call-qa-processing/ml-services/src/classifier.py
-
curl -L -o classifier.py https://huggingface.co/spaces/aniketqxp/call-qa-processing/resolve/main/ml-services/src/classifier.py
363 Bytes
| 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 | |
| } | |