mario-rc/emotional-classifier-bert-base-multilingual-uncased
Emotional Classifier BERT-Base-Multilingual-Uncased
This model is a fine-tuned `google-bert/bert-base-multilingual-uncased` sequence classifier for multilingual emotion recognition in English and Spanish dialogue utterances.
Source code: `Mario-RC/multilingual-emotion-classifier`
Model Details
- Model repository: `mario-rc/emotional-classifier-bert-base-multilingual-uncased`
- Base model: `google-bert/bert-base-multilingual-uncased`
- Architecture:
BertForSequenceClassification - Task: text classification / emotion classification
- Languages: English, Spanish
- Max sequence length: 128 tokens
- Number of labels: 7
Emotion Labels
The model predicts one of seven normalized emotion labels:
anger, disgust, fear, happiness, neutral, sadness, surprise
Training Data
The training pipeline combines DailyDialog and EmpatheticDialogues-derived CSV resources into a multilingual English/Spanish dataset. EmpatheticDialogues labels were mapped into the seven normalized categories above, while ambiguous or underrepresented labels were removed. The training split was resampled to reduce the majority neutral class and upsample minority classes.
Training Setup
- Framework: Hugging Face Transformers
- Base checkpoint: `google-bert/bert-base-multilingual-uncased`
- Task: sequence classification
- Max sequence length: 128
- Epochs: 3
- Learning rate:
5e-6 - Batch size: 32
- Dropout: 0.2
- Seed: 42
Evaluation
The confusion matrix shows true vs. predicted emotion labels on the multilingual test split. Diagonal cells indicate correct classifications, while off-diagonal cells show the main confusions between emotion classes.
Model Comparison
Usage
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
model_id = "mario-rc/emotional-classifier-bert-base-multilingual-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
print(classifier("I feel great today."))
print(classifier("Estoy preocupado por manana."))Limitations
The model is designed for short dialogue utterances and seven broad emotion categories. Predictions may be less reliable for long documents, sarcasm, mixed emotions, domain-specific language, or languages beyond English and Spanish.
Citation
This work is detailed in Section 4.4.3, User Emotion Recognition, of:
Personal Assistant with Emotional and Multilingual Capabilities for Social Robots M. Rodriguez-Cantelar, PhD Dissertation, Universidad Politecnica de Madrid, 2025.
