Views
No views yet
1from transformers import pipeline
2classifier = pipeline("text-classification",
3model="your-username/emotion-classification-model")
4text = "I’m so happy today!"
5result = classifier(text)
6print(result)
7# Output: [{'label': 'LABEL_1', 'score': 0.9996680021286011}] ; which corresponds to 'joy' with a 99.9% accuracy