Bert is a Transformer Bidirectional Encoder based Architecture trained on MLM(Mask Language Modeling) objective
[bert-base-uncased]finetuned on the emotion dataset using HuggingFace Trainer with below training parameters
learning rate 2e-5,
batch size 64,
num_train_epochs=8,from openmind import pipeline
classifier = pipeline("text-classification",model='Changchun_Ascend/bert-base-uncased-emotion', 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.0005138218402862549}, {'label': 'joy', 'score': 0.9972521662712097}, {'label': 'love', 'score': 0.0007443303475156426}, {'label': 'anger', 'score': 0.000740492541808635}, {'label': 'fear', 'score': 0.0003293847548775375}, {'label': 'surprise', 'score': 0.0004197478701826185}][Twitter-Sentiment-Analysis].
Colab Notebook follow the above notebook by changing the model name from distilbert to bert
{
'test_accuracy': 0.9405,
'test_f1': 0.9405920712282673,
'test_loss': 0.15769127011299133,
'test_runtime': 10.5179,
'test_samples_per_second': 190.152,
'test_steps_per_second': 3.042
}