Downloads · 30 days
202K
5% of all-time downloads
jitesh/emotion-english
emotion-english is a text classification model from jitesh. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
Here is how to use this model to get the emotion label of a given text:
Downloads · 30 days
202K
5% of all-time downloads
All-time downloads
4.5M
Public
Parameters
82.1M
657 MB on disk
Likes
10
Public
Click a slice to open those files.
.bin329 MB · 50%
How the weights are stored.
F3282.1M · 100%
From the Hugging Face model README
| 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 |
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