File size: 8,306 Bytes
05e0385 eab1481 05e0385 eab1481 05e0385 24895f0 05e0385 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | ---
base_model: FacebookAI/xlm-roberta-base
language:
- en
- zh
- es
- hi
- ar
- bn
- pt
- ru
- ja
- de
- id
- ta
- vi
- ko
- fr
- tr
- it
- pl
- uk
- ur
- nl
- pa
- sw
library_name: transformers
license: cc-by-nc-4.0
pipeline_tag: text-classification
tags:
- text-classification
- emotion-classification
- emotion
- multi-label-classification
- synthetic data
- social-media-analysis
- customer-feedback
- product-reviews
- brand-monitoring
- multilingual
- 🇪🇺
- region:eu
- synthetic
---
> [!TIP]
> If you wish to use this model for commercial purposes, please obtain a license by contacting: info@tabularis.ai
# 🎭 Multilingual Emotion Classification Model (23 Languages, 11 Emotions)
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/Discord%20button.png" width="200"/>](https://discord.gg/sznxwdqBXj)
## Model Details
- `Model Name:` tabularisai/multilingual-emotion-classification
- `Base Model:` FacebookAI/xlm-roberta-base
- `Task:` Multi-label Text Classification (Emotion Recognition)
- `Languages:` 23 — English, Mandarin Chinese (中文), Spanish (Español), Hindi (हिन्दी), Arabic (العربية), Bengali (বাংলা), Portuguese (Português), Russian (Русский), Japanese (日本語), German (Deutsch), Indonesian (Bahasa Indonesia), Tamil (தமிழ்), Vietnamese (Tiếng Việt), Korean (한국어), French (Français), Turkish (Türkçe), Italian (Italiano), Polish (Polski), Ukrainian (Українська), Urdu (اردو), Dutch (Nederlands), Punjabi (ਪੰਜਾਬੀ), and Swahili.
- `Number of Classes:` 11 — *anger, contempt, disgust, fear, frustration, gratitude, joy, love, neutral, sadness, surprise*
- `Label Mode:` Multi-label — each text can be assigned **zero, one, or multiple** emotions (independent sigmoid heads, τ = 0.5).
- `Usage:`
- Social media emotion analysis
- Customer feedback analysis
- Product review emotion tagging
- Brand monitoring
- Conversational AI / chatbot affect tracking
- Market research
- Customer service optimization
>
## Model Description
This model is a fine-tuned version of `FacebookAI/xlm-roberta-base` for multilingual multi-label emotion classification. It was trained on synthetic multilingual data covering 23 languages and 11 emotion categories, enabling robust emotion detection across languages, registers, and cultural contexts.
Unlike single-label sentiment classifiers, this model predicts a **set** of emotions per input — reflecting the reality that utterances often carry mixed affect (e.g. *gratitude + love*, *frustration + sadness*).
### Training Data
Trained on synthetic multilingual data generated by advanced LLMs, providing broad coverage of emotion expressions across all 23 supported languages. All labels are multi-hot vectors over the 11 emotion classes.
### Training Procedure
- Fine-tuned for 3 epochs with **BCEWithLogitsLoss** (independent-binary-per-label).
- Cosine LR schedule with 6% warmup, `lr=2e-5`, effective batch size 64.
- Mixed precision (bf16) on a single A100; max sequence length 192.
- Per-epoch checkpointing; epoch 3 was selected by validation F1-micro.
## Evaluation (held-out multilingual test set, 11,500 rows)
| Metric | Value |
|---------------------|-------|
| F1 (micro) | 0.840 |
| F1 (macro) | 0.839 |
| Jaccard (samples) | 0.794 |
| Subset accuracy | 0.640 |
| Hamming accuracy | 0.953 |
| AUROC (micro) | 0.980 |
| Average Precision (micro) | 0.923 |
| LRAP | 0.936 |
Decision threshold: τ = 0.5 applied independently per label.
## Intended Use
Ideal for:
- Multilingual social media emotion monitoring
- International customer feedback affect analysis
- Global product review emotion tagging
- Worldwide brand sentiment & emotion tracking
- Affect-aware conversational systems
## How to Use
```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "tabularisai/multilingual-emotion-classification"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
model.eval()
LABELS = ["anger", "contempt", "disgust", "fear", "frustration",
"gratitude", "joy", "love", "neutral", "sadness", "surprise"]
@torch.no_grad()
def predict_emotions(texts, threshold: float = 0.5):
inputs = tokenizer(texts, return_tensors="pt", truncation=True,
padding=True, max_length=192)
probs = torch.sigmoid(model(**inputs).logits).cpu().numpy()
results = []
for row in probs:
picked = [(LABELS[i], float(row[i])) for i in range(len(LABELS)) if row[i] >= threshold]
picked.sort(key=lambda x: -x[1])
results.append(picked or [("neutral", float(row[LABELS.index("neutral")]))])
return results
texts = [
# English
"Thank you so much for helping me, I really appreciate it!",
"I can't believe they cancelled the flight again, this is ridiculous.",
# Spanish
"¡Qué alegría verte después de tanto tiempo!",
"Estoy muy decepcionado con el servicio.",
# Chinese
"收到你的礼物我真的很感动,谢谢你!",
"这部电影太吓人了,我都不敢一个人看。",
# Arabic
"أنا ممتن جدًا لكل ما فعلته من أجلي.",
"لا أستطيع تحمّل هذا الوضع أكثر من ذلك.",
# Hindi
"आपका यह तोहफ़ा देखकर मेरी आँखों में आँसू आ गए।",
"यह सेवा बिल्कुल घटिया थी, मैं बहुत निराश हूँ।",
# Japanese
"久しぶりに会えて本当に嬉しいです!",
"また電車が遅れた...本当にうんざりする。",
# French
"Je suis tellement reconnaissant pour tout ce que tu as fait.",
"C'est inadmissible, j'en ai assez de cette situation.",
# Swahili
"Asante sana kwa msaada wako, nakupenda sana!",
"Nimechoka kabisa na huduma hii mbaya.",
]
for t, r in zip(texts, predict_emotions(texts)):
tags = ", ".join(f"{lbl}({p:.2f})" for lbl, p in r)
print(f"Text: {t}\nEmotions: {tags}\n")
```
Using pipelines (returns probability for each of the 11 classes):
```python
from transformers import pipeline
pipe = pipeline(
"text-classification",
model="tabularisai/multilingual-emotion-classification",
function_to_apply="sigmoid",
top_k=None,
)
print(pipe("I love this product! It's amazing and works perfectly."))
```
## Ethical Considerations
Synthetic training data reduces annotator bias and broadens language coverage, but real-world validation is strongly advised before deploying in high-stakes settings. Emotion labels are culturally situated — predictions should be treated as probabilistic signals, not ground truth about a person's internal state.
## Citation
```bib
@misc{borisov2026multilingual,
title={Multilingual Multi-Label Emotion Classification at Scale with Synthetic Data},
author={Vadim Borisov},
year={2026},
eprint={2604.12633},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2604.12633},
}
```
## Contact
For inquiries, data, private APIs, better models, contact info@tabularis.ai
tabularis.ai
<table align="center">
<tr>
<td align="center">
<a href="https://www.linkedin.com/company/tabularis-ai/">
<img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/linkedin.svg" alt="LinkedIn" width="30" height="30">
</a>
</td>
<td align="center">
<a href="https://x.com/tabularis_ai">
<img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/x.svg" alt="X" width="30" height="30">
</a>
</td>
<td align="center">
<a href="https://github.com/tabularis-ai">
<img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/github.svg" alt="GitHub" width="30" height="30">
</a>
</td>
<td align="center">
<a href="https://tabularis.ai">
<img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/internetarchive.svg" alt="Website" width="30" height="30">
</a>
</td>
</tr>
</table>
|