Tanneru commited on
Commit
9f345fc
Β·
verified Β·
1 Parent(s): 0b2601c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +176 -199
README.md CHANGED
@@ -1,199 +1,176 @@
1
- ---
2
- library_name: transformers
3
- tags: []
4
- ---
5
-
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a πŸ€— transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - emotion-detection
5
+ - text-classification
6
+ - transformers
7
+ - deberta
8
+ - huggingface
9
+ datasets:
10
+ - dair-ai/emotion
11
+ - faisalsanto007/isear-dataset
12
+ - debarshichanda/goemotions
13
+ metrics:
14
+ - accuracy
15
+ - precision
16
+ - recall
17
+ - f1
18
+ model-index:
19
+ - name: Emotion-Classification-DeBERTa-v3-Large
20
+ results:
21
+ - task:
22
+ type: text-classification
23
+ name: Emotion Classification
24
+ dataset:
25
+ name: Merged Emotion Datasets (GoEmotions + ISEAR + Emotion)
26
+ type: text
27
+ metrics:
28
+ - name: Accuracy
29
+ type: accuracy
30
+ value: 0.96 # update to your real metric
31
+ - name: F1
32
+ type: f1
33
+ value: 0.94
34
+ ---
35
+
36
+ ---
37
+
38
+ # DeBERTa-v3-Large for Emotion Detection (Merged & Augmented Dataset)
39
+
40
+ This model fine-tunes [`microsoft/deberta-v3-large`](https://huggingface.co/microsoft/deberta-v3-large) on a **merged and augmented** version of the following datasets:
41
+
42
+ - πŸ€— [GoEmotions](https://huggingface.co/datasets/debarshichanda/goemotions)
43
+ - πŸ“˜ [ISEAR Dataset](https://www.kaggle.com/datasets/faisalsanto007/isear-dataset/data)
44
+ - πŸ“™ [Emotion Dataset (DAIR-AI)](https://huggingface.co/datasets/dair-ai/emotion)
45
+
46
+ The model is trained for **7-class emotion classification** in English and achieves **state-of-the-art performance** using advanced augmentation and weighted loss.
47
+
48
+ ---
49
+
50
+ ## 🧠 Emotion Classes
51
+
52
+ - 😠 **anger**
53
+ - 🀒 **disgust**
54
+ - 😨 **fear**
55
+ - πŸ˜€ **happy**
56
+ - 😐 **neutral**
57
+ - 😒 **sad**
58
+ - 😲 **surprise**
59
+
60
+ ---
61
+
62
+ ## πŸ“ˆ Training Metrics
63
+
64
+ | Epoch | Training Loss | Validation Loss | Accuracy | F1 Macro | F1 Weighted | Precision Macro | Precision Weighted | Recall Macro | Recall Weighted |
65
+ | ----- | ------------- | --------------- | -------- | -------- | ----------- | --------------- | ------------------ | ------------ | --------------- |
66
+ | 1 | 0.3867 | 0.3506 | 0.7559 | 0.6857 | 0.7629 | 0.6520 | 0.7859 | 0.7722 | 0.7559 |
67
+ | 2 | 0.2340 | 0.2120 | 0.8147 | 0.7879 | 0.8174 | 0.7557 | 0.8292 | 0.8365 | 0.8147 |
68
+ | 3 | 0.1786 | 0.1616 | 0.8428 | 0.8114 | 0.8445 | 0.7715 | 0.8533 | 0.8758 | 0.8428 |
69
+ | 4 | 0.1261 | 0.1371 | 0.8671 | 0.8584 | 0.8669 | 0.8479 | 0.8729 | 0.8754 | 0.8671 |
70
+ | 5 | 0.0770 | 0.1242 | 0.8940 | 0.8751 | 0.8936 | 0.8537 | 0.8965 | 0.9020 | 0.8940 |
71
+ | 6 | 0.0608 | 0.1190 | 0.9208 | 0.9179 | 0.9221 | 0.9171 | 0.9225 | 0.9195 | 0.9208 |
72
+ | 7 | 0.0462 | 0.1209 | 0.9255 | 0.9192 | 0.9253 | 0.9218 | 0.9269 | 0.9184 | 0.9255 |
73
+ | 8 | 0.0373 | 0.1251 | 0.9305 | 0.9198 | 0.9305 | 0.9145 | 0.9317 | 0.9262 | 0.9305 |
74
+ | 9 | 0.0270 | 0.1262 | 0.9453 | 0.9375 | 0.9453 | 0.9354 | 0.9462 | 0.9400 | 0.9453 |
75
+ | 10 | 0.0189 | 0.1304 | 0.9526 | 0.9412 | 0.9527 | 0.9408 | 0.9529 | 0.9421 | 0.9526 |
76
+ | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
77
+ | 20 | 0.0025 | 0.1618 | 0.9572 | 0.9435 | 0.9569 | 0.9444 | 0.9571 | 0.9430 | 0.9572 |
78
+
79
+ πŸ“† **Final Accuracy:** **95.72%**
80
+ πŸ“† **Final F1 (Weighted):** **0.957**
81
+ πŸ“† **Final Precision:** **0.944**
82
+ πŸ“† **Final Recall:** **0.943**
83
+
84
+ ---
85
+
86
+ ## πŸ› οΈ Training Configuration
87
+
88
+ ```python
89
+ training_args = TrainingArguments(
90
+ output_dir="./deberta-large-3-merged_augmented",
91
+ eval_strategy="epoch",
92
+ save_strategy="epoch",
93
+ learning_rate=1e-5,
94
+ per_device_train_batch_size=32,
95
+ per_device_eval_batch_size=32,
96
+ gradient_accumulation_steps=2,
97
+ num_train_epochs=20,
98
+ weight_decay=0.01,
99
+ lr_scheduler_type="cosine",
100
+ logging_dir="./logs",
101
+ logging_steps=50,
102
+ save_total_limit=1,
103
+ load_best_model_at_end=True,
104
+ metric_for_best_model="accuracy",
105
+ report_to="none",
106
+ dataloader_num_workers=8
107
+ )
108
+ ```
109
+
110
+ ---
111
+
112
+ ## πŸ”„ Confusion Matrix
113
+
114
+ ![Confusion Matrix](https://huggingface.co/Tanneru/Emotion-Classification-DeBERTa-v3-Large/resolve/main/Confusion_Matrix.png)
115
+
116
+ ---
117
+
118
+ ## πŸ“Š Classification Report
119
+
120
+ ![Classification Report](https://huggingface.co/Tanneru/Emotion-Classification-DeBERTa-v3-Large/resolve/main/Classification_Report.png)
121
+ ---
122
+
123
+ ## πŸ”§ How to Use
124
+
125
+ ```python
126
+ from transformers import DebertaV2Tokenizer, DebertaV2ForSequenceClassification
127
+ import torch
128
+
129
+ text = "I'm feeling very nervous about tomorrow."
130
+
131
+ tokenizer = DebertaV2Tokenizer.from_pretrained('Tanneru/Emotion-Classification-DeBERTa-v3-Large')
132
+ model = DebertaV2ForSequenceClassification.from_pretrained('Tanneru/Emotion-Classification-DeBERTa-v3-Large')
133
+
134
+
135
+ inputs = tokenizer(text, return_tensors="pt")
136
+ outputs = model(**inputs)
137
+ predicted_class_id = torch.argmax(outputs.logits).item()
138
+
139
+ print("Predicted emotion:", model.config.id2label[predicted_class_id])
140
+ ```
141
+
142
+ ---
143
+
144
+ ## πŸ“„ License
145
+
146
+ This model is released under the **Apache 2.0 License**. You are free to use, modify, and distribute the model with proper attribution.
147
+
148
+ ---
149
+
150
+ ## ✍️ Author
151
+
152
+ * **Username**: Tanneru
153
+ * **Base model**: [`microsoft/deberta-v3-large`](https://huggingface.co/microsoft/deberta-v3-large)
154
+
155
+ ---
156
+
157
+ ## πŸ“š Citation
158
+
159
+ If you use this model in your work, please cite:
160
+
161
+ ```bibtex
162
+ @misc{tanneru2025deberta_emotion,
163
+ title={DeBERTa-v3-Large fine-tuned on Merged & Augmented Emotion Datasets},
164
+ author={Tanneru},
165
+ year={2025},
166
+ publisher={Hugging Face},
167
+ howpublished={\url{https://huggingface.co/Tanneru/Emotion-Classification-DeBERTa-v3-Large}},
168
+ }
169
+
170
+ @article{he2021deberta,
171
+ title={DeBERTa: Decoding-enhanced BERT with Disentangled Attention},
172
+ author={He, Pengcheng and Liu, Xiaodong and Gao, Jianfeng and Chen, Weizhu},
173
+ journal={arXiv preprint arXiv:2006.03654},
174
+ year={2021}
175
+ }
176
+ ```