DistilBERT for English emotion classification
This six-way classifier was fine-tuned from DistilBERT on the 16,000-example Emotion training split. Label IDs 0โ5 correspond to sadness, joy, love, anger, fear, and surprise. It expects English short text.
The selected run used learning rate 2e-05, 1 epoch, batch size 8, and seed 42. On the 2,000-example validation split, it achieved accuracy 0.9345 and weighted F1 0.9348. This split was also used to select the learning rate.
from transformers import pipeline
classify = pipeline("text-classification", model="./model", tokenizer="./model")
print(classify("I was afraid the rope might snap."))
The model assigns one of six labels. An input may express multiple emotions or require missing conversational context. Sarcasm, negation, and ambiguous expressions can lead to errors.
- Downloads last month
- 20
Model tree for Linn-9/ENGLISH-EMOTION
Base model
distilbert/distilbert-base-uncased