Upload README.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263641234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283---
library_name: transformers
license: apache-2.0
base_model: distilbert-base-uncased
tags:
- generated_from_trainer
metrics:
- accuracy
model-index:
- name: emotion-classification-model
results: []
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
# emotion-classification-model
This model is a fine-tuned version of [distilbert-base-uncased](https://huggingface.co/distilbert-base-uncased) on an unknown dataset.
It achieves the following results on the evaluation set:
- Loss: 0.1606
- Accuracy: 0.942
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 16
- eval_batch_size: 16
- seed: 42
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 3
- mixed_precision_training: Native AMP
### Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:--------:|
| 0.2304 | 1.0 | 1000 | 0.2112 | 0.926 |
| 0.1308 | 2.0 | 2000 | 0.1700 | 0.936 |
| 0.0862 | 3.0 | 3000 | 0.1606 | 0.942 |
### Framework versions
- Transformers 4.46.2
- Pytorch 2.5.1+cu124
- Datasets 3.1.0
- Tokenizers 0.20.3
# emotion-classification-model
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.
It achieves the following results:- **Validation Accuracy:** 97.44%- **Test Accuracy:** 94.2%
## Model Description
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.
### Key Features- Efficient and lightweight for deployment.- High accuracy for emotion detection tasks.- Pretrained on a diverse dataset and fine-tuned for high specificity to emotions.
## Intended Uses & Limitations
### Intended Uses- Emotion analysis in text data.- Sentiment detection in customer reviews, tweets, or user feedback.- Psychological or behavioral studies to analyze emotional tone in communications.
### Limitations- May not generalize well to datasets with highly domain-specific language.- Might struggle with sarcasm, irony, or other nuanced forms of language.- The model is English-specific and may not perform well on non-English text.
## Training and Evaluation Data
### Training Dataset- **Dataset:** [dair-ai/emotion](https://huggingface.co/datasets/dair-ai/emotion)- **Training Set Size:** 16,000 examples- **Dataset Description:** The dataset contains English sentences labeled with six emotional categories: anger, joy, optimism, sadness, fear, and disgust.
### Results- **Training Time:** ~178 seconds- **Training Loss:** 0.2104- **Validation Accuracy:** 97.44%- **Test Accuracy:** 94.2%
## Training Procedure
### Hyperparameters- **Learning Rate:** 5e-05- **Batch Size:** 16 (train and evaluation)- **Epochs:** 3- **Seed:** 42- **Optimizer:** AdamW (betas=(0.9,0.999), epsilon=1e-08)- **Learning Rate Scheduler:** Linear- **Mixed Precision Training:** Native AMP
### Training and Validation Results
| Epoch | Training Loss | Validation Loss | Validation Accuracy ||-------|---------------|-----------------|---------------------|| 1 | 0.2293 | 0.1746 | 93.35% || 2 | 0.1315 | 0.1529 | 93.70% || 3 | 0.2104 | 0.0553 | 97.44% |
### Test Results- **Loss:** 0.1606- **Accuracy:** 94.2%
### Performance Metrics- **Training Speed:** ~269 samples/second- **Evaluation Speed:** ~1310 samples/second
## Usage Example
```pythonfrom transformers import pipeline
# Load the fine-tuned modelclassifier = pipeline("text-classification", model="Panda0116/emotion-classification-model")
# Example usagetext = "I am so happy to see you!"emotion = classifier(text)print(emotion)```README.md+83-64