CoolFace
Modelpublic

kamaludeen/multilingual_go_emotions-ONNX

sourceHugging Faceupdated 7mo agoView on Hugging Face
0likes38downloads
Model Card

multilingualgoemotions (ONNX)

This is an ONNX version of AnasAlokla/multilingual_go_emotions. It was automatically converted and uploaded using this Hugging Face Space.

Usage with Transformers.js

See the pipeline documentation for text-classification: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.TextClassificationPipeline


๐ŸŒ Multilingual GoEmotions Classifier ๐Ÿ’ฌ

![Dataset](https://huggingface.co/datasets/AnasAlokla/multilingualgoemotions) ![Languages](https://huggingface.co/AnasAlokla/multilingualgoemotions#key-features) ![Task](https://huggingface.co/AnasAlokla/multilingualgoemotions#overview) ![Base Model](https://huggingface.co/google-bert/bert-base-multilingual-cased)

Table of Contents

Overview

This repository contains a powerful multilingual, multi-label emotion classification model. It is fine-tuned from the robust bert-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.

  • โ€”Model Name: AnasAlokla/multilingualgoemotions
  • โ€”Architecture: BERT (bert-base-multilingual-cased)
  • โ€”Task: Multi-Label Text Classification
  • โ€”Languages: Arabic, English, French, Spanish, Dutch, Turkish

Key Features

  • โ€”๐ŸŒ Truly Multilingual: Natively supports 6 major languages, making it ideal for global applications.
  • โ€”๐Ÿท๏ธ Multi-Label Classification: Capable of detecting multiple emotions in a single piece of text, capturing complex emotional expressions.
  • โ€”๐Ÿ’ช High Performance: Built on bert-base-multilingual-cased, delivering strong results across all supported languages and emotions. See the detailed evaluation metrics.
  • โ€”๐Ÿ”— Open & Accessible: Comes with a live demo, the full dataset, and the complete training code for full transparency and reproducibility.
  • โ€”V1.1 Improved Version: An updated model is available that specifically improves performance on low-frequency emotion samples.

Supported Emotions

The model is trained to classify text into 27 distinct emotion categories as well as a neutral class:

EmotionEmojiEmotionEmoji
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๐Ÿ˜

Links

Installation

Install the required libraries using pip:

bash
pip install transformers torch

Quickstart: Emotion Detection

You can easily use this model for multi-label emotion classification with the transformers pipeline. Set top_k=None to see all predicted emotions above the model's default threshold.

python
from transformers import pipeline

# Load the multilingual, multi-label emotion classification pipeline
emotion_classifier = pipeline(
    "text-classification",
    model="AnasAlokla/multilingual_go_emotions",
    top_k=None # To return all scores for each label
)

# --- Example 1: English ---
text_en = "I'm so happy for you, but I'm also a little bit sad to see you go."
results_en = emotion_classifier(text_en)
print(f"Text (EN): {text_en}")
print(f"Predictions: {results_en}\n")

# --- Example 2: Spanish ---
text_es = "ยกQuรฉ sorpresa! No me lo esperaba para nada."
results_es = emotion_classifier(text_es)
print(f"Text (ES): {text_es}")
print(f"Predictions: {results_es}\n")

# --- Example 3: Arabic ---
text_ar = "ุฃุดุนุฑ ุจุฎูŠุจุฉ ุฃู…ู„ ูˆุบุถุจ ุจุณุจุจ ู…ุง ุญุฏุซ"
results_ar = emotion_classifier(text_ar)
print(f"Text (AR): {text_ar}")
print(f"Predictions: {results_ar}")

Expected Output (structure):

Text (EN): I'm so happy for you, but I'm also a little bit sad to see you go. Predictions: [[{'label': 'joy', 'score': 0.9...}, {'label': 'sadness', 'score': 0.8...}, {'label': 'caring', 'score': 0.5...}, ...]]

Text (ES): ยกQuรฉ sorpresa! No me lo esperaba para nada. Predictions: [[{'label': 'surprise', 'score': 0.9...}, {'label': 'excitement', 'score': 0.4...}, ...]]

Text (AR): ุฃุดุนุฑ ุจุฎูŠุจุฉ ุฃู…ู„ ูˆุบุถุจ ุจุณุจุจ ู…ุง ุญุฏุซ Predictions: [[{'label': 'disappointment', 'score': 0.9...}, {'label': 'anger', 'score': 0.9...}, ...]]

Evaluation

The model's performance was rigorously evaluated on the test set.

Test Set Performance

The following table shows the performance metrics of the fine-tuned model on the test set, broken down by emotion category.

indexaccuracyprecisionrecallf1mccsupportthreshold
admiration0.9420.6520.6840.6670.63627900.4
amusement0.9730.7350.8170.7740.7618660.35
anger0.960.4110.3640.3860.36611280.35
annoyance0.8960.2460.4810.3250.29317040.15
approval0.910.3290.3830.3540.30720940.2
caring0.9580.2850.460.3520.3418160.15
confusion0.9650.4440.4010.4210.40410200.25
curiosity0.9350.4330.740.5460.53517340.25
desire0.9840.4040.5340.460.4574140.25
disappointment0.9420.2240.3450.2720.24910140.15
disapproval0.9350.3060.4130.3520.32213980.25
disgust0.9750.3430.4180.3770.3666000.15
embarrassment0.990.280.2420.260.2552400.1
excitement0.9730.3440.4250.380.3696240.15
fear0.9870.5990.5220.5580.5534980.35
gratitude0.9890.9240.9020.9130.90720040.4
grief0.9990000360.05
joy0.9650.4540.5320.490.47410320.25
love0.9730.7310.8290.7770.76518120.35
nervousness0.9960.3850.250.3030.3081200.1
optimism0.9730.5880.5250.5550.54210620.25
pride0.9970000840.05
realization0.9620.2020.1890.1950.1767920.15
relief0.99600001380.05
remorse0.9880.5970.8080.6870.6895160.15
sadness0.970.5480.4340.4840.47310620.4
surprise0.9740.4870.5690.5240.5138280.3
neutral0.7260.5510.8180.6580.468105240.2

Use Cases

This model is ideal for applications requiring nuanced emotional understanding across different languages:

Global Customer Feedback Analysis: Analyze customer reviews, support tickets, and survey responses from around the world to gauge sentiment.

Multilingual Social Media Monitoring: Track brand perception and public mood across different regions and languages.

Advanced Chatbot Development: Build more empathetic and responsive chatbots that can understand user emotions in their native language.

Content Moderation: Automatically flag toxic, aggressive, or sensitive content on international platforms.

Market Research: Gain insights into how different cultures express emotions in text.

Trained On

Base Model: **google-bert/bert-base-multilingual-cased** - A powerful pretrained model supporting 104 languages.

Dataset: **multilingual_go_emotions** - A carefully translated and curated dataset for multilingual emotion analysis, based on the original Google GoEmotions dataset.

Fine-Tuning Guide

To adapt this model for your own dataset or to replicate the training process, you can follow the methodology outlined in the official code repository. The repository provides a complete, end-to-end example, including data preprocessing, training scripts, and evaluation logic.

For full details, please refer to the GitHub repository: **emotion_chatbot**

The following plots visualize the model's performance during the fine-tuning process across epochs.

Loss Curves (Training vs. Validation)

alt text

Accuracy Curves (Training vs. Validation)

alt text

F1 Score Curves (Training vs. Validation)

alt text

Tags

#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

Support & Contact

For questions, bug reports, or collaboration inquiries, please open an issue on the Hugging Face Hub repository or contact the author directly.

Author: Anas Hamid Alokla

๐Ÿ“ฌ Email: anasaloklahaaa@gmail.com