msgfrom96 commited on
Commit
1cb0a3f
Β·
verified Β·
1 Parent(s): 93c36a7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +106 -3
README.md CHANGED
@@ -1,3 +1,106 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 🌍 XLM-R Multi-Emotion Classifier 🎭
2
+
3
+ πŸš€ Mission Statement
4
+
5
+ The XLM-R Multi-Emotion Classifier is built to understand human emotions across multiple languages, helping researchers, developers, and businesses analyze sentiment in text at scale.
6
+
7
+ From social media monitoring to mental health insights, this model is designed to decode emotions with accuracy and fairness.
8
+
9
+ 🎯 Vision
10
+
11
+ Our goal is to create an AI-powered emotion recognition model that:
12
+ β€’ 🌎 Understands emotions across cultures and languages
13
+ β€’ πŸ€– Bridges the gap between AI and human psychology
14
+ β€’ πŸ’‘ Empowers businesses, researchers, and developers to extract valuable insights from text
15
+
16
+ πŸ— Model Overview
17
+
18
+ Model Name: msgfrom96/xlm_emo_multi
19
+ Architecture: XLM-RoBERTa (Multi-Lingual Transformer)
20
+ Task: Multi-label Emotion Classification
21
+ Languages: English, Arabic
22
+ Dataset: SemEval-2018 Task 1: Affect in Tweets
23
+
24
+ The model predicts multiple emotions per text using multi-label classification. It can recognize emotions like:
25
+ β€’ 🎭 Anger, Anticipation, Disgust, Fear, Joy, Sadness, Surprise, Trust, Love, Optimism, Pessimism
26
+
27
+ πŸ“¦ How to Use
28
+
29
+ Load Model and Tokenizer
30
+
31
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
32
+
33
+ model_name = "msgfrom96/xlm_emo_multi"
34
+
35
+ # Load model and tokenizer
36
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
37
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
38
+
39
+ # Example text
40
+ text = "I can't believe how amazing this is! So happy and excited!"
41
+
42
+ # Tokenize input
43
+ inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
44
+
45
+ # Get model predictions
46
+ outputs = model(**inputs)
47
+ print(outputs.logits) # Raw emotion scores
48
+
49
+ Interpreting Results
50
+
51
+ The model outputs logits (raw scores) for each emotion. Apply a sigmoid activation to convert these into probabilities:
52
+
53
+ import torch
54
+
55
+ probs = torch.sigmoid(outputs.logits)
56
+ print(probs)
57
+
58
+ Each score represents the probability of an emotion being present in the text.
59
+
60
+ ⚑ Training & Fine-Tuning Details
61
+ β€’ Base Model: XLM-RoBERTa (xlm-roberta-base) πŸ“–
62
+ β€’ Dataset: SemEval-2018 (English & Arabic Tweets) πŸ—‚
63
+ β€’ Training Strategy: Multi-label classification πŸ”₯
64
+ β€’ Optimizer: AdamW βš™οΈ
65
+ β€’ Batch Size: 16 πŸ‹οΈβ€β™‚οΈ
66
+ β€’ Learning Rate: 2e-5 🎯
67
+ β€’ Hardware: Trained on AWS SageMaker with CUDA GPU support πŸš€
68
+ β€’ Evaluation Metric: Macro-F1 & Micro-F1 πŸ“Š
69
+ β€’ Best Model Selection: Auto-selected via load_best_model_at_end=True βœ…
70
+
71
+ πŸ“œ Citations & References
72
+
73
+ If you use this model, please cite the following sources:
74
+
75
+ πŸ“Œ SemEval-2018 Dataset
76
+ Mohammad, S., Bravo-Marquez, F., Salameh, M., & Kiritchenko, S. (2018). β€œSemEval-2018 Task 1: Affect in Tweets.” Proceedings of SemEval-2018.
77
+ πŸ“– Paper Link
78
+
79
+ πŸ“Œ XLM-RoBERTa
80
+ Conneau, A., Khandelwal, K., Goyal, N., Chaudhary, V., Wenzek, G., GuzmΓ‘n, F., Grave, E., Ott, M., Zettlemoyer, L., & Stoyanov, V. (2020). β€œUnsupervised Cross-lingual Representation Learning at Scale.” Proceedings of ACL 2020.
81
+ πŸ“– Paper Link
82
+
83
+ πŸ“Œ Transformers Library
84
+ Hugging Face (2020). β€œπŸ€— Transformers: State-of-the-art Natural Language Processing for Pytorch and TensorFlow 2.0.”
85
+ πŸ“– Library Docs
86
+
87
+ 🀝 Contributing
88
+
89
+ Want to improve the model? Feel free to:
90
+ β€’ Train it on more languages 🌍
91
+ β€’ Optimize for low-resource devices πŸ”₯
92
+ β€’ Integrate it into real-world applications πŸ’‘
93
+ β€’ Submit pull requests or discussions πŸš€
94
+
95
+ πŸ† Acknowledgments
96
+
97
+ Special thanks to the Hugging Face team, SemEval organizers, and the NLP research community for providing the tools and datasets that made this model possible. πŸ™Œ
98
+
99
+ πŸ”— Connect & Feedback
100
+
101
+ πŸ’¬ Questions? Issues? Create a discussion on the Hugging Face Model Hub
102
+ πŸ“§ Email: [email protected]
103
+
104
+ ---
105
+ license: mit
106
+ ---