AnasAlokla commited on
Commit
1a283ca
ยท
verified ยท
1 Parent(s): 398614c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +160 -10
README.md CHANGED
@@ -42,26 +42,128 @@ new_version: AnasAlokla/multilingual_go_emotions
42
  pipeline_tag: text-classification
43
  ---
44
 
 
45
 
46
- #### Overview
 
 
 
47
 
48
- Model trained from [bert-base-multilingual-cased](https://huggingface.co/google-bert/bert-base-multilingual-cased) on the [multilingual_go_emotions](https://huggingface.co/datasets/AnasAlokla/multilingual_go_emotions) dataset for multi-label classification.
 
 
 
 
 
 
 
 
 
 
 
 
49
 
 
50
 
51
- # Multilingual GoEmotions Chatbot Task Report
52
 
53
- **Author:** Anas Hamid Alokla
 
 
 
54
 
55
- This repository/space contains details about a multilingual emotion classification model and chatbot based on the GoEmotions dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  ## Links
58
 
59
- * **Live Demo:** [https://huggingface.co/spaces/AnasAlokla/test_emotion_chatbot](https://huggingface.co/spaces/AnasAlokla/test_emotion_chatbot)
60
- * **Dataset (Supports 6 Languages):** [https://huggingface.co/datasets/AnasAlokla/multilingual_go_emotions](https://huggingface.co/datasets/AnasAlokla/multilingual_go_emotions)
61
- * **Model Used:** [https://huggingface.co/AnasAlokla/multilingual_go_emotions](https://huggingface.co/AnasAlokla/multilingual_go_emotions)
62
- * **GitHub Code:** [https://github.com/anasAloklah/emotion_chatbot](https://github.com/anasAloklah/emotion_chatbot)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
- ## Test Set Performance
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  The following table shows the performance metrics of the fine-tuned model on the test set, broken down by emotion category.
67
 
@@ -133,3 +235,51 @@ The table below shows the performance of the test model with a threshold of 0.5:
133
  | sadness | 0.968 | 0.512 | 0.408 | 0.454 | 0.441 | 1062 | 0.5 |
134
  | surprise | 0.974 | 0.492 | 0.430 | 0.459 | 0.447 | 828 | 0.5 |
135
  | neutral | 0.742 | 0.648 | 0.440 | 0.524 | 0.368 | 10524 | 0.5 |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  pipeline_tag: text-classification
43
  ---
44
 
45
+ # ๐ŸŒ Multilingual GoEmotions Classifier ๐Ÿ’ฌ
46
 
47
+ [![Dataset](https://img.shields.io/badge/Dataset-multilingual_go_emotions-blue)](https://huggingface.co/datasets/AnasAlokla/multilingual_go_emotions)
48
+ [![Languages](https://img.shields.io/badge/Languages-6-brightgreen)](https://huggingface.co/AnasAlokla/multilingual_go_emotions#key-features)
49
+ [![Task](https://img.shields.io/badge/Task-Multi--Label%20Classification%20%7C%20Emotion%20Detection%20%7C%20Text%20Classification%20%7C%20Sentiment%20Analysis-orange)](https://huggingface.co/AnasAlokla/multilingual_go_emotions#overview)
50
+ [![Base Model](https://img.shields.io/badge/Base%20Model-mBERT-purple)](https://huggingface.co/AnasAlokla/multilingual_go_emotions)
51
 
52
+ ## Table of Contents
53
+ - ๐Ÿ“– [Overview](#overview)
54
+ - โœจ [Key Features](#key-features)
55
+ - ๐Ÿ’ซ [Supported Emotions](#supported-emotions)
56
+ - ๐Ÿ”— [Links](#links)
57
+ - โš™๏ธ [Installation](#installation)
58
+ - ๐Ÿš€ [Quickstart: Emotion Detection](#quickstart-emotion-detection)
59
+ - ๐Ÿ“Š [Evaluation](#evaluation)
60
+ - ๐Ÿ’ก [Use Cases](#use-cases)
61
+ - ๐Ÿ“š [Trained On](#trained-on)
62
+ - ๐Ÿ”ง [Fine-Tuning Guide](#fine-tuning-guide)
63
+ - ๐Ÿท๏ธ [Tags](#tags)
64
+ - ๐Ÿ’ฌ [Support & Contact](#support--contact)
65
 
66
+ ## Overview
67
 
68
+ 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.
69
 
70
+ - **Model Name**: AnasAlokla/multilingual_go_emotions_V1.1
71
+ - **Architecture**: BERT (bert-base-multilingual-cased)
72
+ - **Tasks**: Multi-Label Text Classification | Emotion Detection | Sentiment Analysis
73
+ - **Languages**: Arabic, English, French, Spanish, Dutch, Turkish
74
 
75
+ ## Key Features
76
+
77
+ - ๐ŸŒ **Truly Multilingual**: Natively supports 6 major languages, making it ideal for global applications.
78
+ - ๐Ÿท๏ธ **Multi-Label Classification**: Capable of detecting multiple emotions in a single piece of text, capturing complex emotional expressions.
79
+ - ๐Ÿ’ช **High Performance**: Built on `bert-base-multilingual-cased`, delivering strong results across all supported languages and emotions. See the detailed [evaluation metrics](#evaluation).
80
+ - ๐Ÿ”— **Open & Accessible**: Comes with a live demo, the full dataset, and the complete training code for full transparency and reproducibility.
81
+ - V1.1 **Improved Version**: An updated model is available that specifically improves performance on low-frequency emotion samples.
82
+
83
+ ## Supported Emotions
84
+
85
+ The model is trained to classify text into 27 distinct emotion categories as well as a neutral class:
86
+
87
+ | Emotion | Emoji | Emotion | Emoji |
88
+ |----------------|-------|----------------|-------|
89
+ | Admiration | ๐Ÿคฉ | Love | โค๏ธ |
90
+ | Amusement | ๐Ÿ˜„ | Nervousness | ๐Ÿ˜ฐ |
91
+ | Anger | ๐Ÿ˜  | Optimism | โœจ |
92
+ | Annoyance | ๐Ÿ™„ | Pride | ๐Ÿ‘‘ |
93
+ | Approval | ๐Ÿ‘ | Realization | ๐Ÿ’ก |
94
+ | Caring | ๐Ÿค— | Relief | ๐Ÿ˜Œ |
95
+ | Confusion | ๐Ÿ˜• | Remorse | ๐Ÿ˜” |
96
+ | Curiosity | ๐Ÿค” | Sadness | ๐Ÿ˜ข |
97
+ | Desire | ๐Ÿ”ฅ | Surprise | ๐Ÿ˜ฒ |
98
+ | Disappointment | ๐Ÿ˜ž | Disapproval | ๐Ÿ‘Ž |
99
+ | Disgust | ๐Ÿคข | Gratitude | ๐Ÿ™ |
100
+ | Embarrassment | ๐Ÿ˜ณ | Grief | ๐Ÿ˜ญ |
101
+ | Excitement | ๐ŸŽ‰ | Joy | ๐Ÿ˜Š |
102
+ | Fear | ๐Ÿ˜ฑ | Neutral | ๐Ÿ˜ |
103
 
104
  ## Links
105
 
106
+ * **Live Demo:** [**Hugging Face Space**](https://huggingface.co/spaces/AnasAlokla/test_emotion_chatbot)
107
+ * **Dataset (Supports 6 Languages):** [**multilingual_go_emotions**](https://huggingface.co/datasets/AnasAlokla/multilingual_go_emotions)
108
+ * **Based Model Used:** [**AnasAlokla/multilingual_go_emotions**](https://huggingface.co/AnasAlokla/multilingual_go_emotions)
109
+ * **GitHub Code:** [**emotion_chatbot**](https://github.com/anasAloklah/emotion_chatbot)
110
+
111
+ ## Installation
112
+
113
+ Install the required libraries using pip:
114
+
115
+ ```bash
116
+ pip install transformers torch
117
+ ```
118
+ ## Quickstart: Emotion Detection
119
+
120
+ 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.
121
+
122
+ ```python
123
+ from transformers import pipeline
124
+
125
+ # Load the multilingual, multi-label emotion classification pipeline
126
+ emotion_classifier = pipeline(
127
+ "text-classification",
128
+ model="AnasAlokla/multilingual_go_emotions",
129
+ top_k=None # To return all scores for each label
130
+ )
131
 
132
+ # --- Example 1: English ---
133
+ text_en = "I'm so happy for you, but I'm also a little bit sad to see you go."
134
+ results_en = emotion_classifier(text_en)
135
+ print(f"Text (EN): {text_en}")
136
+ print(f"Predictions: {results_en}\n")
137
+
138
+ # --- Example 2: Spanish ---
139
+ text_es = "ยกQuรฉ sorpresa! No me lo esperaba para nada."
140
+ results_es = emotion_classifier(text_es)
141
+ print(f"Text (ES): {text_es}")
142
+ print(f"Predictions: {results_es}\n")
143
+
144
+ # --- Example 3: Arabic ---
145
+ text_ar = "ุฃุดุนุฑ ุจุฎูŠุจุฉ ุฃู…ู„ ูˆุบุถุจ ุจุณุจุจ ู…ุง ุญุฏุซ"
146
+ results_ar = emotion_classifier(text_ar)
147
+ print(f"Text (AR): {text_ar}")
148
+ print(f"Predictions: {results_ar}")
149
+ ```
150
+
151
+ Expected Output (structure):
152
+
153
+ Text (EN): I'm so happy for you, but I'm also a little bit sad to see you go.
154
+ Predictions: [[{'label': 'joy', 'score': 0.9...}, {'label': 'sadness', 'score': 0.8...}, {'label': 'caring', 'score': 0.5...}, ...]]
155
+
156
+ Text (ES): ยกQuรฉ sorpresa! No me lo esperaba para nada.
157
+ Predictions: [[{'label': 'surprise', 'score': 0.9...}, {'label': 'excitement', 'score': 0.4...}, ...]]
158
+
159
+ Text (AR): ุฃุดุนุฑ ุจุฎูŠุจุฉ ุฃู…ู„ ูˆุบุถุจ ุจุณุจุจ ู…ุง ุญุฏุซ
160
+ Predictions: [[{'label': 'disappointment', 'score': 0.9...}, {'label': 'anger', 'score': 0.9...}, ...]]
161
+
162
+ ## Evaluation
163
+
164
+ The model's performance was rigorously evaluated on the test set.
165
+
166
+ Test Set Performance
167
 
168
  The following table shows the performance metrics of the fine-tuned model on the test set, broken down by emotion category.
169
 
 
235
  | sadness | 0.968 | 0.512 | 0.408 | 0.454 | 0.441 | 1062 | 0.5 |
236
  | surprise | 0.974 | 0.492 | 0.430 | 0.459 | 0.447 | 828 | 0.5 |
237
  | neutral | 0.742 | 0.648 | 0.440 | 0.524 | 0.368 | 10524 | 0.5 |
238
+
239
+ ## Use Cases
240
+
241
+ This model is ideal for applications requiring nuanced emotional understanding across different languages:
242
+
243
+ Global Customer Feedback Analysis: Analyze customer reviews, support tickets, and survey responses from around the world to gauge sentiment.
244
+
245
+ Multilingual Social Media Monitoring: Track brand perception and public mood across different regions and languages.
246
+
247
+ Advanced Chatbot Development: Build more empathetic and responsive chatbots that can understand user emotions in their native language.
248
+
249
+ Content Moderation: Automatically flag toxic, aggressive, or sensitive content on international platforms.
250
+
251
+ Market Research: Gain insights into how different cultures express emotions in text.
252
+
253
+ ## Trained On
254
+
255
+ Base Model: [**AnasAlokla/multilingual_go_emotions**](https://huggingface.co/AnasAlokla/multilingual_go_emotions) - A powerful pretrained model supporting 104 languages.
256
+
257
+ Dataset: [**multilingual_go_emotions**](https://huggingface.co/datasets/AnasAlokla/multilingual_go_emotions) - A carefully translated and curated dataset for multilingual emotion analysis, based on the original Google GoEmotions dataset.
258
+
259
+ ## Fine-Tuning Guide
260
+
261
+ 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.
262
+
263
+ For full details, please refer to the GitHub repository:
264
+ [**emotion_chatbot**](https://github.com/anasAloklah/emotion_chatbot)
265
+
266
+
267
+
268
+ ## Tags
269
+
270
+ `#multilingual-nlp` `#emotion-classification` `#text-classification` `#multi-label` `#bert`
271
+ `#transformer` `#natural-language-processing` `#sentiment-analysis` `#deep-learning`
272
+ `#arabic-nlp` `#french-nlp` `#spanish-nlp` `#goemotions`
273
+ `#BERT-Emotion` `#edge-nlp` `#emotion-detection` `#offline-nlp`
274
+ `#sentiment-analysis` `#emojis` `#emotions` `#embedded-nlp`
275
+ `#ai-for-iot` `#efficient-bert` `#nlp2025` `#context-aware` `#edge-ml`
276
+ `#smart-home-ai` `#emotion-aware` `#voice-ai` `#eco-ai` `#chatbot` `#social-media`
277
+ `#mental-health` `#short-text` `#smart-replies` `#tone-analysis`
278
+
279
+ ## Support & Contact
280
+
281
+ For questions, bug reports, or collaboration inquiries, please open an issue on the Hugging Face Hub repository or contact the author directly.
282
+
283
+ Author: Anas Hamid Alokla
284
+
285
+ ๐Ÿ“ฌ Email: anasaloklahaaa@gmail.com