Update README.md
Browse files
README.md
CHANGED
|
@@ -1,64 +1,59 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
| 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 |
-
- Transformers 4.46.3
|
| 62 |
-
- Pytorch 2.5.1+cu118
|
| 63 |
-
- Datasets 3.1.0
|
| 64 |
-
- Tokenizers 0.20.3
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
tags:
|
| 4 |
+
- distilbert
|
| 5 |
+
- emotion-classification
|
| 6 |
+
- text-classification
|
| 7 |
+
datasets:
|
| 8 |
+
- dair-ai/emotion
|
| 9 |
+
metrics:
|
| 10 |
+
- accuracy
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# Emotion Classification Model
|
| 14 |
+
|
| 15 |
+
## Model Description
|
| 16 |
+
This model fine-tunes DistilBERT for multi-class emotion classification on the `dair-ai/emotion` dataset.
|
| 17 |
+
The model is designed to classify text into one of six emotions: sadness, joy, love, anger, fear, or surprise.
|
| 18 |
+
It can be used in applications requiring emotional analysis in English text.
|
| 19 |
+
|
| 20 |
+
## Training and Evaluation
|
| 21 |
+
- **Training Dataset**: `dair-ai/emotion` (16,000 examples)
|
| 22 |
+
- **Training Time**: 8 minutes and 51 seconds
|
| 23 |
+
- **Training Hyperparameters**:
|
| 24 |
+
- Learning Rate: `3e-5`
|
| 25 |
+
- Batch Size: `32`
|
| 26 |
+
- Epochs: `4`
|
| 27 |
+
- Weight Decay: `0.01`
|
| 28 |
+
|
| 29 |
+
### Training results
|
| 30 |
+
|
| 31 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|
| 32 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|
|
| 33 |
+
| 0.511 | 1.0 | 500 | 0.1797 | 0.933 |
|
| 34 |
+
| 0.1495 | 2.0 | 1000 | 0.1449 | 0.938 |
|
| 35 |
+
| 0.1002 | 3.0 | 1500 | 0.1350 | 0.9415 |
|
| 36 |
+
| 0.0707 | 4.0 | 2000 | 0.1382 | 0.94 |
|
| 37 |
+
|
| 38 |
+
- **Validation Accuracy**:
|
| 39 |
+
- Epoch 1: 0.9275
|
| 40 |
+
- Epoch 2: 0.9345
|
| 41 |
+
- Epoch 3: 0.940
|
| 42 |
+
- Epoch 4: 0.940
|
| 43 |
+
- **Test Accuracy**: 100% accuracy on the provided 10 test examples.
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
## Usage
|
| 47 |
+
```python
|
| 48 |
+
from transformers import pipeline
|
| 49 |
+
classifier = pipeline("text-classification", model="Zoopa/emotion-classification-model")
|
| 50 |
+
|
| 51 |
+
text = "I am so happy today!"
|
| 52 |
+
result = classifier(text)
|
| 53 |
+
print(result)
|
| 54 |
+
‘‘‘
|
| 55 |
+
|
| 56 |
+
## Limitations
|
| 57 |
+
- The model only supports English.
|
| 58 |
+
- The training dataset may contain biases, affecting model predictions on test data.
|
| 59 |
+
- Edge Cases like mixed emotions might reduce accuracy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|