🚀 英語情感分析DistilRoBERTa-base模型
本模型可用於對英文文本數據進行情感分類。它在6個不同的數據集上進行訓練(詳見下方附錄),能夠預測Ekman提出的6種基本情感,外加一箇中性類別:
- 憤怒 🤬
- 厭惡 🤢
- 恐懼 😨
- 喜悅 😀
- 中性 😐
- 悲傷 😭
- 驚訝 😲
該模型是DistilRoBERTa-base的微調版本。若需要“非蒸餾”的情感模型,請參考RoBERTa-large版本的模型卡片。
🚀 快速開始
單文本示例
在Google Colab上使用Hugging Face的pipeline命令,只需3行代碼即可運行情感模型:

from transformers import pipeline
classifier = pipeline("text-classification", model="j-hartmann/emotion-english-distilroberta-base", return_all_scores=True)
classifier("I love this!")
輸出:
[[{'label': 'anger', 'score': 0.004419783595949411},
{'label': 'disgust', 'score': 0.0016119900392368436},
{'label': 'fear', 'score': 0.0004138521908316761},
{'label': 'joy', 'score': 0.9771687984466553},
{'label': 'neutral', 'score': 0.005764586851000786},
{'label': 'sadness', 'score': 0.002092392183840275},
{'label': 'surprise', 'score': 0.008528684265911579}]]
多示例和完整數據集
在Google Colab上對多個示例和完整數據集(如.csv文件)運行情感模型:

💻 聯繫我們
如果您有任何問題或反饋,請聯繫 jochen.hartmann@tum.de。
感謝Samuel Domdey和 chrsiebert 對本模型發佈的支持。
✅ 引用信息
如果您使用此模型,請引用以下內容。相關工作論文即將發佈。
Jochen Hartmann, "Emotion English DistilRoBERTa-base". https://huggingface.co/j-hartmann/emotion-english-distilroberta-base/, 2022.
BibTex引用格式:
@misc{hartmann2022emotionenglish,
author={Hartmann, Jochen},
title={Emotion English DistilRoBERTa-base},
year={2022},
howpublished = {\url{https://huggingface.co/j-hartmann/emotion-english-distilroberta-base/}},
}
📚 附錄
以下是用於訓練的數據集概述。所有數據集均包含英文文本。該表格總結了每個數據集中包含哪些情感標籤。這些數據集涵蓋了多種文本類型,具體包括來自Twitter、Reddit、學生自我報告以及電視對話的文本情感標籤。由於MELD(多模態情感線數據集)是對流行的情感線數據集的擴展,因此這裡不包含情感線數據集本身。
名稱 |
憤怒 |
厭惡 |
恐懼 |
喜悅 |
中性 |
悲傷 |
驚訝 |
Crowdflower (2016) |
是 |
- |
- |
是 |
是 |
是 |
是 |
Emotion Dataset, Elvis et al. (2018) |
是 |
- |
是 |
是 |
- |
是 |
是 |
GoEmotions, Demszky et al. (2020) |
是 |
是 |
是 |
是 |
是 |
是 |
是 |
ISEAR, Vikash (2018) |
是 |
是 |
是 |
是 |
- |
是 |
- |
MELD, Poria et al. (2019) |
是 |
是 |
是 |
是 |
是 |
是 |
是 |
SemEval-2018, EI-reg, Mohammad et al. (2018) |
是 |
- |
是 |
是 |
- |
是 |
- |
該模型在上述數據集的一個平衡子集上進行訓練(每種情感2811個觀測值,即總共近20000個觀測值)。這個平衡子集的80%用於訓練,20%用於評估。評估準確率為66%(隨機猜測的基線準確率為1/7 = 14%)。
📖 科學應用
以下是使用“英語情感分析DistilRoBERTa-base模型”的論文列表。如果您希望您的論文被添加到列表中,請給我發送電子郵件。
- Butt, S., Sharma, S., Sharma, R., Sidorov, G., & Gelbukh, A. (2022). What goes on inside rumour and non-rumour tweets and their reactions: A Psycholinguistic Analyses. Computers in Human Behavior, 107345.
- Kuang, Z., Zong, S., Zhang, J., Chen, J., & Liu, H. (2022). Music-to-Text Synaesthesia: Generating Descriptive Text from Music Recordings. arXiv preprint arXiv:2210.00434.
- Rozado, D., Hughes, R., & Halberstadt, J. (2022). Longitudinal analysis of sentiment and emotion in news media headlines using automated labelling with Transformer language models. Plos one, 17(10), e0276367.