Downloads · 30 days
117
5% of all-time downloads
Lsthf/multilingual-emotion-classification
multilingual-emotion-classification is a text classification model from Lsthf. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
[!TIP] If you wish to use this model for commercial purposes, please obtain a license by contacting: info@tabularis.ai
Downloads · 30 days
117
5% of all-time downloads
All-time downloads
2.2K
Public
Parameters
278M
1.1 GB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
[!TIP] If you wish to use this model for commercial purposes, please obtain a license by contacting: info@tabularis.ai
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:
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).
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.
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 |
Decision threshold: τ = 0.5 applied independently per label.
Ideal for:
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):
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."))
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.
@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},
}
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>