🚀 情绪分类模型
本项目是一个能够从20个类别中进行情绪分类的模型,可精准识别文本中的情绪标签,为文本分析提供有力支持。
✨ 主要特性
- 支持20种不同的情绪分类,涵盖愤怒、厌恶、恐惧等常见情绪。
- 提供多个示例文本,方便快速测试模型效果。
📦 安装指南
文档未提供具体安装步骤,暂不展示。
💻 使用示例
基础用法
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)
上述代码运行后将输出如下内容:
{'label': 'impatient', 'score': 0.924211859703064} I can't wait any longer
📚 详细文档
20种情绪标签
编号 |
标签 |
0 |
愤怒 |
1 |
调皮 |
2 |
困惑 |
3 |
好奇 |
4 |
厌恶 |
5 |
共情 |
6 |
精力充沛 |
7 |
恐惧 |
8 |
暴躁 |
9 |
内疚 |
10 |
不耐烦 |
11 |
喜悦 |
12 |
爱 |
13 |
中立 |
14 |
悲伤 |
15 |
严肃 |
16 |
惊讶 |
17 |
怀疑 |
18 |
思考 |
19 |
抱怨 |
示例文本
以下是一些示例文本及其对应的情绪标签:
示例文本 |
情绪标签 |
I'm so angry right now. I can't believe he did that to me. |
愤怒 |
I'm feeling disgusted by the smell of this food. |
厌恶 |
I'm feeling very afraid of what might happen next. |
恐惧 |
I'm so joyful right now! This is the best day of my life. |
喜悦 |
I'm feeling neutral about this situation. I don't really care one way or another. |
中立 |
I'm feeling really sad today after my dog passed away. |
悲伤 |
I'm so surprised by what just happened! I never saw that coming. |
惊讶 |
I'm feeling cheeky today. I'm going to play a little prank on my friend. |
调皮 |
I'm feeling confused about what to do next. I need some guidance. |
困惑 |
I'm feeling curious about the world around me. There's so much to learn! |
好奇 |
I'm feeling empathetic towards my friend who is going through a tough time. |
共情 |
I'm feeling grumpy today. Everything is annoying me! |
暴躁 |
I'm feeling guilty about what I did. I wish I could take it back. |
内疚 |
I'm feeling very energetic today. I'm ready to take on the world! |
精力充沛 |
I'm feeling impatient waiting for this movie to start. |
不耐烦 |
I'm feeling so much love for my family right now. They mean everything to me. |
爱 |
I'm thinking about my future and what I want to achieve. |
思考 |
I'm feeling serious about this issue. It's important and needs to be addressed. |
严肃 |
I'm feeling suspicious of what he's telling me. I think he's hiding something. |
怀疑 |
I'm feeling whiny today. Everything is bothering me! |
抱怨 |
I love football so much |
爱 |
I'm reflecting on my experiences to gain insights |
思考 |
I borrowed money from a friend and haven't paid it back yet. Now I feel ashamed. |
内疚 |
I'm starting to think that he's up to something. |
怀疑 |
We need to approach this matter with a sense of purpose |
严肃 |
📄 许可证
本项目采用MIT许可证。