Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -1,64 +1,83 @@
|
|
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 |
-
|
62 |
-
|
63 |
-
|
64 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# emotion-classification-model
|
3 |
+
|
4 |
+
This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on the [dair-ai/emotion dataset](https://huggingface.co/datasets/dair-ai/emotion). It is designed to classify text into various emotional categories.
|
5 |
+
|
6 |
+
It achieves the following results:
|
7 |
+
- **Validation Accuracy:** 97.68%
|
8 |
+
- **Test Accuracy:** 94.25%
|
9 |
+
|
10 |
+
## Model Description
|
11 |
+
|
12 |
+
This model uses the DistilBERT architecture, which is a lighter and faster variant of BERT. It has been fine-tuned specifically for emotion classification, making it suitable for tasks such as sentiment analysis, customer feedback analysis, and user emotion detection.
|
13 |
+
|
14 |
+
### Key Features
|
15 |
+
- Efficient and lightweight for deployment.
|
16 |
+
- High accuracy for emotion detection tasks.
|
17 |
+
- Pretrained on a diverse dataset and fine-tuned for high specificity to emotions.
|
18 |
+
|
19 |
+
## Intended Uses & Limitations
|
20 |
+
|
21 |
+
### Intended Uses
|
22 |
+
- Emotion analysis in text data.
|
23 |
+
- Sentiment detection in customer reviews, tweets, or user feedback.
|
24 |
+
- Psychological or behavioral studies to analyze emotional tone in communications.
|
25 |
+
|
26 |
+
### Limitations
|
27 |
+
- May not generalize well to datasets with highly domain-specific language.
|
28 |
+
- Might struggle with sarcasm, irony, or other nuanced forms of language.
|
29 |
+
- The model is English-specific and may not perform well on non-English text.
|
30 |
+
|
31 |
+
## Training and Evaluation Data
|
32 |
+
|
33 |
+
### Training Dataset
|
34 |
+
- **Dataset:** [dair-ai/emotion](https://huggingface.co/datasets/dair-ai/emotion)
|
35 |
+
- **Training Set Size:** 16,000 examples
|
36 |
+
- **Dataset Description:** The dataset contains English sentences labeled with six emotional categories: anger, joy, optimism, sadness, fear, and disgust.
|
37 |
+
|
38 |
+
### Results
|
39 |
+
- **Training Time:** ~226 seconds
|
40 |
+
- **Training Loss:** 0.1987
|
41 |
+
- **Validation Accuracy:** 97.68%
|
42 |
+
- **Test Accuracy:** 94.25%
|
43 |
+
|
44 |
+
## Training Procedure
|
45 |
+
|
46 |
+
### Hyperparameters
|
47 |
+
- **Learning Rate:** 5e-05
|
48 |
+
- **Batch Size:** 16 (train and evaluation)
|
49 |
+
- **Epochs:** 3
|
50 |
+
- **Seed:** 42
|
51 |
+
- **Optimizer:** AdamW (betas=(0.9,0.999), epsilon=1e-08)
|
52 |
+
- **Learning Rate Scheduler:** Linear
|
53 |
+
- **Mixed Precision Training:** Native AMP
|
54 |
+
|
55 |
+
### Training and Validation Results
|
56 |
+
|
57 |
+
| Epoch | Training Loss | Validation Loss | Validation Accuracy |
|
58 |
+
|-------|---------------|-----------------|---------------------|
|
59 |
+
| 1 | 0.5383 | 0.1845 | 92.9% |
|
60 |
+
| 2 | 0.2254 | 0.1589 | 93.55% |
|
61 |
+
| 3 | 0.0739 | 0.0520 | 97.68% |
|
62 |
+
|
63 |
+
### Test Results
|
64 |
+
- **Loss:** 0.1485
|
65 |
+
- **Accuracy:** 94.25%
|
66 |
+
|
67 |
+
### Performance Metrics
|
68 |
+
- **Training Speed:** ~212 samples/second
|
69 |
+
- **Evaluation Speed:** ~1149 samples/second
|
70 |
+
|
71 |
+
## Usage Example
|
72 |
+
|
73 |
+
```python
|
74 |
+
from transformers import pipeline
|
75 |
+
|
76 |
+
# Load the fine-tuned model
|
77 |
+
classifier = pipeline("text-classification", model="Panda0116/emotion-classification-model")
|
78 |
+
|
79 |
+
# Example usage
|
80 |
+
text = "I am so happy to see you!"
|
81 |
+
emotion = classifier(text)
|
82 |
+
print(emotion)
|
83 |
+
```
|