Views
No views yet
[!TIP] 🚀 These models are now available through the Tabularis API. Fast multilingual sentiment + emotion classification in 23 languages with structured outputs and simple pricing.✅ Free 10K credits/month 📚 Docs + API key: https://tabularis.ai/sentiment-analysis/
Model Name: tabularisai/multilingual-emotion-classificationBase Model: FacebookAI/xlm-roberta-baseTask: 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, surpriseLabel Mode: Multi-label — each text can be assigned zero, one, or multiple emotions (independent sigmoid heads, τ = 0.5).Usage:
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.lr=2e-5, effective batch size 64.| 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 |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_name = "tabularisai/multilingual-emotion-classification"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7model.eval()
8
9LABELS = ["anger", "contempt", "disgust", "fear", "frustration",
10 "gratitude", "joy", "love", "neutral", "sadness", "surprise"]
11
12@torch.no_grad()
13def predict_emotions(texts, threshold: float = 0.5):
14 inputs = tokenizer(texts, return_tensors="pt", truncation=True,
15 padding=True, max_length=192)
16 probs = torch.sigmoid(model(**inputs).logits).cpu().numpy()
17 results = []
18 for row in probs:
19 picked = [(LABELS[i], float(row[i])) for i in range(len(LABELS)) if row[i] >= threshold]
20 picked.sort(key=lambda x: -x[1])
21 results.append(picked or [("neutral", float(row[LABELS.index("neutral")]))])
22 return results
23
24
25texts = [
26 # English
27 "Thank you so much for helping me, I really appreciate it!",
28 "I can't believe they cancelled the flight again, this is ridiculous.",
29 # Spanish
30 "¡Qué alegría verte después de tanto tiempo!",
31 "Estoy muy decepcionado con el servicio.",
32 # Chinese
33 "收到你的礼物我真的很感动,谢谢你!",
34 "这部电影太吓人了,我都不敢一个人看。",
35 # Arabic
36 "أنا ممتن جدًا لكل ما فعلته من أجلي.",
37 "لا أستطيع تحمّل هذا الوضع أكثر من ذلك.",
38 # Hindi
39 "आपका यह तोहफ़ा देखकर मेरी आँखों में आँसू आ गए।",
40 "यह सेवा बिल्कुल घटिया थी, मैं बहुत निराश हूँ।",
41 # Japanese
42 "久しぶりに会えて本当に嬉しいです!",
43 "また電車が遅れた...本当にうんざりする。",
44 # French
45 "Je suis tellement reconnaissant pour tout ce que tu as fait.",
46 "C'est inadmissible, j'en ai assez de cette situation.",
47 # Swahili
48 "Asante sana kwa msaada wako, nakupenda sana!",
49 "Nimechoka kabisa na huduma hii mbaya.",
50]
51
52for t, r in zip(texts, predict_emotions(texts)):
53 tags = ", ".join(f"{lbl}({p:.2f})" for lbl, p in r)
54 print(f"Text: {t}\nEmotions: {tags}\n")1from transformers import pipeline
2
3pipe = pipeline(
4 "text-classification",
5 model="tabularisai/multilingual-emotion-classification",
6 function_to_apply="sigmoid",
7 top_k=None,
8)
9
10print(pipe("I love this product! It's amazing and works perfectly."))1@misc{borisov2026multilingual,
2 title={Multilingual Multi-Label Emotion Classification at Scale with Synthetic Data},
3 author={Vadim Borisov},
4 year={2026},
5 eprint={2604.12633},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2604.12633},
9}