Downloads · 30 days
27
3% of all-time downloads
suvrobaner/distilbert-base-uncased-finetuned-emotion-en-tweets
distilbert-base-uncased-finetuned-emotion-en-tweets is a text classification model from suvrobaner. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Downloads · 30 days
27
3% of all-time downloads
All-time downloads
921
Public
Parameters
67M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt536 MB · 50%
From the Hugging Face model README
from transformers import pipeline
model_id = "suvrobaner/distilbert-base-uncased-finetuned-emotion-en-tweets"
classifier = pipeline("text-classification", model = model_id)
custom_tweet = "I saw a movie today and it was really good."
preds = classifier(custom_tweet, return_all_scores=True)
labels = ['sadness', 'joy', 'love', 'anger', 'fear', 'surprise']
preds_df = pd.DataFrame(preds[0])
import matplotlib.pyplot as plt
plt.bar(labels, 100 * preds_df["score"], color='C0')
plt.title(f'"{custom_tweet}"')
plt.ylabel("Class probability (%)")
plt.show()