Model
Model IA Berta_Base_Uncased entrened with dateset emotion
Model Details
Model Base: bert_base_uncased
dataset: dair-ai/emotion
Config train:
num_train_epochs= 8 learning_rate= 2e-5 weight_decay=0.01 batch_size: 64
Eval Exam
{
'test_loss': 0.14830373227596283
'test_accuracy': 0.9415
'test_f1': 0.9411005763302622
'test_runtime': 8.372
'test_samples_per_second': 238.892
'test_steps_per_second': 3.822
}
How to Use the model:
from transformers import pipeline
classifier = pipeline("text-classification",model='Cesar42/bert-base-uncased-emotion_v2', return_all_scores=True)
prediction = classifier("I love using transformers. The best part is wide range of support and its easy to use", )
print(prediction)
"""
output:
[[
{'label': 'sadness', 'score': 0.0005138228880241513},
{'label': 'joy', 'score': 0.9972520470619202},
{'label': 'love', 'score': 0.0007443308713845909},
{'label': 'anger', 'score': 0.0007404946954920888},
{'label': 'fear', 'score': 0.00032938539516180754},
{'label': 'surprise', 'score': 0.0004197491507511586}
]]
"""
Referece
- bhadresh-savani/bert-base-uncased-emotion
- Colab Notebook. bhadresh-savani