🚀 情緒分類模型
本項目是一個能夠從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許可證。