Text Classification
Transformers
PyTorch
Safetensors
English
roberta
emotion
20 classes
code
emotions
text-embeddings-inference
Instructions to use jitesh/emotion-english with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jitesh/emotion-english with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="jitesh/emotion-english")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("jitesh/emotion-english") model = AutoModelForSequenceClassification.from_pretrained("jitesh/emotion-english") - Inference
- Notebooks
- Google Colab
- Kaggle
Emotion classification from 20 classes
20 Emotion labels
| id | label |
|---|---|
| 0 | anger |
| 1 | cheeky |
| 2 | confuse |
| 3 | curious |
| 4 | disgust |
| 5 | empathetic |
| 6 | energetic |
| 7 | fear |
| 8 | grumpy |
| 9 | guilty |
| 10 | impatient |
| 11 | joy |
| 12 | love |
| 13 | neutral |
| 14 | sadness |
| 15 | serious |
| 16 | surprise |
| 17 | suspicious |
| 18 | think |
| 19 | whiny |
How to use
Here is how to use this model to get the emotion label of a given text:
from transformers import AutoModelForSequenceClassification, pipeline
model_name = 'jitesh/emotion-english'
model = AutoModelForSequenceClassification.from_pretrained(model_name)
classifier = pipeline("text-classification", model=model, tokenizer=model_name)
text = "I can't wait any longer "
prediction = classifier(text)
print(prediction[0], text)
The above code outputs the following line.
{'label': 'impatient', 'score': 0.924211859703064} I can't wait any longer
- Downloads last month
- 125,101