HeadlinesBriefing favicon HeadlinesBriefing.com

Fine-Tune SLMs for Emotion Recognition

Towards Data Science •
×

Researchers have developed a method to fine-tune Mistral Small 3.1 for emotion recognition in social media communication. Unlike standard sentiment analysis that categorizes text as simply positive or negative, this approach identifies 15 distinct emotions like anger, amusement, and disappointment. The team addressed class imbalance in the GoEmotions dataset through undersampling and ISMOTE algorithm.

The team implemented a three-pronged strategy: reducing the neutral category, generating synthetic samples using ISMOTE, and applying focal loss weighting. They used Unsloth framework with LoRA to reduce hardware requirements while maintaining multilingual capabilities. The model was trained on a 60:20:20 split of augmented training, validation, and test sets.

The resulting MistralSmall-3.1.GoEmotions model, now available on Hugging Face, achieves F1 scores above 0.7 for most target emotions. This approach provides a practical solution for businesses needing nuanced emotional analysis of customer communications, social media mentions, and brand-related discussions with open weights and flexible licensing.