Panda0116 commited on
Commit
99bd8f3
1 Parent(s): b6a7129

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +83 -64
README.md CHANGED
@@ -1,64 +1,83 @@
1
- ---
2
- library_name: transformers
3
- license: apache-2.0
4
- base_model: distilbert-base-uncased
5
- tags:
6
- - generated_from_trainer
7
- metrics:
8
- - accuracy
9
- model-index:
10
- - name: emotion-classification-model
11
- results: []
12
- ---
13
-
14
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
15
- should probably proofread and complete it, then remove this comment. -->
16
-
17
- # emotion-classification-model
18
-
19
- This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on an unknown dataset.
20
- It achieves the following results on the evaluation set:
21
- - Loss: 0.1485
22
- - Accuracy: 0.9425
23
-
24
- ## Model description
25
-
26
- More information needed
27
-
28
- ## Intended uses & limitations
29
-
30
- More information needed
31
-
32
- ## Training and evaluation data
33
-
34
- More information needed
35
-
36
- ## Training procedure
37
-
38
- ### Training hyperparameters
39
-
40
- The following hyperparameters were used during training:
41
- - learning_rate: 5e-05
42
- - train_batch_size: 16
43
- - eval_batch_size: 16
44
- - seed: 42
45
- - optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
46
- - lr_scheduler_type: linear
47
- - num_epochs: 3
48
- - mixed_precision_training: Native AMP
49
-
50
- ### Training results
51
-
52
- | Training Loss | Epoch | Step | Validation Loss | Accuracy |
53
- |:-------------:|:-----:|:----:|:---------------:|:--------:|
54
- | 0.2254 | 1.0 | 1000 | 0.1845 | 0.929 |
55
- | 0.1297 | 2.0 | 2000 | 0.1589 | 0.9355 |
56
- | 0.0739 | 3.0 | 3000 | 0.1485 | 0.9425 |
57
-
58
-
59
- ### Framework versions
60
-
61
- - Transformers 4.46.2
62
- - Pytorch 2.5.1+cu124
63
- - Datasets 3.1.0
64
- - Tokenizers 0.20.3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ```