distilbert-base-uncased-finetuned-emotion-en-tweets

作者 suvrobaner · 下载 4 · 点赞 0 · 更新 2023-10-31

text-classification pytorch

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()

模型信息

该模型卡暂无预览图和文字说明。以下信息来自 Hugging Face。

作者 suvrobaner
类型—
基础模型—
标签text-classification、pytorch
下载4
点赞0
更新时间2023-10-31
Hugging Face https://huggingface.co/suvrobaner/distilbert-base-uncased-finetuned-emotion-en-tweets