distilbert-base-uncased-finetuned-emotions-text-classification
This model is a fine-tuned version of distilbert-base-uncased on emotion dataset. It achieves the following results on the evaluation set:
- Loss: 0.2130
- Accuracy: 0.928
- F1: 0.9278
Model description
More information needed
Intended uses & limitations
import pandas as pd
from transformers import pipeline
import pandas as pd
import matplotlib.pyplot as plt
model_id = 'ithattieu/distilbert-base-uncased-finetuned-emotions-text-classification'
classifier = pipeline('text-classification', model=model_id)
labels = ['sadness', 'joy', 'love', 'anger', 'fear', 'surprise']
text = 'I am not a really smart lady, which makes it challenging to grasp certain concepts, but you made it super easy to understand NLP and relevant applications. So, thank you!'
preds_df = pd.DataFrame(preds[0])
preds = classifier(text, return_all_scores=True)
preds_df = pd.DataFrame(preds[0])
plt.bar(labels, 100 * preds_df["score"], color='C0')
plt.title(f'"{text}"')
plt.ylabel("Class probability (%)")
plt.show()
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 2
Training results
Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 |
---|---|---|---|---|---|
0.8161 | 1.0 | 250 | 0.3051 | 0.912 | 0.9114 |
0.2464 | 2.0 | 500 | 0.2130 | 0.928 | 0.9278 |
Framework versions
- Transformers 4.41.2
- Pytorch 2.5.0.dev20240815
- Datasets 2.19.1
- Tokenizers 0.19.1
- Downloads last month
- 0
Model tree for ithattieu/distilbert-base-uncased-finetuned-emotions-text-classification
Base model
distilbert/distilbert-base-uncased