Views
No views yet
text-classification: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipelinebert-base-multilingual-cased model on the comprehensive multilingual_go_emotions dataset. The model is designed to analyze text and identify a wide spectrum of 27 different emotions, plus a neutral category. Its ability to detect multiple emotions simultaneously makes it highly effective for understanding nuanced text from diverse sources.bert-base-multilingual-cased, delivering strong results across all supported languages and emotions. See the detailed evaluation metrics.| Emotion | Emoji | Emotion | Emoji |
|---|---|---|---|
| Admiration | 🤩 | Love | ❤️ |
| Amusement | 😄 | Nervousness | 😰 |
| Anger | 😠 | Optimism | ✨ |
| Annoyance | 🙄 | Pride | 👑 |
| Approval | 👍 | Realization | 💡 |
| Caring | 🤗 | Relief | 😌 |
| Confusion | 😕 | Remorse | 😔 |
| Curiosity | 🤔 | Sadness | 😢 |
| Desire | 🔥 | Surprise | 😲 |
| Disappointment | 😞 | Disapproval | 👎 |
| Disgust | 🤢 | Gratitude | 🙏 |
| Embarrassment | 😳 | Grief | 😭 |
| Excitement | 🎉 | Joy | 😊 |
| Fear | 😱 | Neutral | 😐 |
pip install transformers torch1from transformers import pipeline
2
3# Load the multilingual, multi-label emotion classification pipeline
4emotion_classifier = pipeline(
5 "text-classification",
6 model="AnasAlokla/multilingual_go_emotions",
7 top_k=None # To return all scores for each label
8)
9
10# --- Example 1: English ---
11text_en = "I'm so happy for you, but I'm also a little bit sad to see you go."
12results_en = emotion_classifier(text_en)
13print(f"Text (EN): {text_en}")
14print(f"Predictions: {results_en}\n")
15
16# --- Example 2: Spanish ---
17text_es = "¡Qué sorpresa! No me lo esperaba para nada."
18results_es = emotion_classifier(text_es)
19print(f"Text (ES): {text_es}")
20print(f"Predictions: {results_es}\n")
21
22# --- Example 3: Arabic ---
23text_ar = "أشعر بخيبة أمل وغضب بسبب ما حدث"
24results_ar = emotion_classifier(text_ar)
25print(f"Text (AR): {text_ar}")
26print(f"Predictions: {results_ar}")| index | accuracy | precision | recall | f1 | mcc | support | threshold |
|---|---|---|---|---|---|---|---|
| admiration | 0.942 | 0.652 | 0.684 | 0.667 | 0.636 | 2790 | 0.4 |
| amusement | 0.973 | 0.735 | 0.817 | 0.774 | 0.76 | 1866 | 0.35 |
| anger | 0.96 | 0.411 | 0.364 | 0.386 | 0.366 | 1128 | 0.35 |
| annoyance | 0.896 | 0.246 | 0.481 | 0.325 | 0.293 | 1704 | 0.15 |
| approval | 0.91 | 0.329 | 0.383 | 0.354 | 0.307 | 2094 | 0.2 |
| caring | 0.958 | 0.285 | 0.46 | 0.352 | 0.341 | 816 | 0.15 |
| confusion | 0.965 | 0.444 | 0.401 | 0.421 | 0.404 | 1020 | 0.25 |
| curiosity | 0.935 | 0.433 | 0.74 | 0.546 | 0.535 | 1734 | 0.25 |
| desire | 0.984 | 0.404 | 0.534 | 0.46 | 0.457 | 414 | 0.25 |
| disappointment | 0.942 | 0.224 | 0.345 | 0.272 | 0.249 | 1014 | 0.15 |
| disapproval | 0.935 | 0.306 | 0.413 | 0.352 | 0.322 | 1398 | 0.25 |
| disgust | 0.975 | 0.343 | 0.418 | 0.377 | 0.366 | 600 | 0.15 |
| embarrassment | 0.99 | 0.28 | 0.242 | 0.26 | 0.255 | 240 | 0.1 |
| excitement | 0.973 | 0.344 | 0.425 | 0.38 | 0.369 | 624 | 0.15 |
| fear | 0.987 | 0.599 | 0.522 | 0.558 | 0.553 | 498 | 0.35 |
| gratitude | 0.989 | 0.924 | 0.902 | 0.913 | 0.907 | 2004 | 0.4 |
| grief | 0.999 | 0 | 0 | 0 | 0 | 36 | 0.05 |
| joy | 0.965 | 0.454 | 0.532 | 0.49 | 0.474 | 1032 | 0.25 |
| love | 0.973 | 0.731 | 0.829 | 0.777 | 0.765 | 1812 | 0.35 |
| nervousness | 0.996 | 0.385 | 0.25 | 0.303 | 0.308 | 120 | 0.1 |
| optimism | 0.973 | 0.588 | 0.525 | 0.555 | 0.542 | 1062 | 0.25 |
| pride | 0.997 | 0 | 0 | 0 | 0 | 84 | 0.05 |
| realization | 0.962 | 0.202 | 0.189 | 0.195 | 0.176 | 792 | 0.15 |
| relief | 0.996 | 0 | 0 | 0 | 0 | 138 | 0.05 |
| remorse | 0.988 | 0.597 | 0.808 | 0.687 | 0.689 | 516 | 0.15 |
| sadness | 0.97 | 0.548 | 0.434 | 0.484 | 0.473 | 1062 | 0.4 |
| surprise | 0.974 | 0.487 | 0.569 | 0.524 | 0.513 | 828 | 0.3 |
| neutral | 0.726 | 0.551 | 0.818 | 0.658 | 0.468 | 10524 | 0.2 |



#multilingual-nlp #emotion-classification #text-classification #multi-label #bert
#transformer #natural-language-processing #sentiment-analysis #deep-learning
#arabic-nlp #french-nlp #spanish-nlp #goemotions
#BERT-Emotion #edge-nlp #emotion-detection #offline-nlp#sentiment-analysis #emojis #emotions #embedded-nlp
#ai-for-iot #efficient-bert #nlp2025 #context-aware #edge-ml#smart-home-ai #emotion-aware #voice-ai #eco-ai #chatbot #social-media#mental-health #short-text #smart-replies #tone-analysis