Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,199 +1,176 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
tags:
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
-
|
| 22 |
-
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
[
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 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 |
+

|
| 115 |
+
|
| 116 |
+
---
|
| 117 |
+
|
| 118 |
+
## π Classification Report
|
| 119 |
+
|
| 120 |
+

|
| 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 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|