模型:
该模型("SiEBERT",代表"Sentiment in English")是一个经过微调的检查点,用于不同类型的英语文本的可靠二元情感分析。对于每个实例,它预测正面(1)或负面(0)情感。该模型在15个不同文本源的数据集上进行了微调和评估,以提高在不同类型的文本(评论、推文等)上的泛化能力。因此,与仅在一种类型的文本上进行训练的模型(例如,来自流行的SST-2基准的电影评论)相比,当应用于新数据时,它表现出更好的性能,如下所示。
如果您想对自己的数据进行情感预测,我们通过 Google Colab 提供了一个示例脚本。您可以将数据加载到Google Drive,并在Colab GPU上免费运行该脚本。设置仅需几分钟。我们建议您手动标记数据的子集,以评估您的使用情况的性能。有关各种情感分析环境的性能基准值,请参阅我们的论文( Hartmann et al. 2022 )。
使用该模型进行单个预测的最简单方法是使用Hugging Face的 sentiment analysis pipeline ,只需几行代码即可,如下面的示例所示:
from transformers import pipeline
sentiment_analysis = pipeline("sentiment-analysis",model="siebert/sentiment-roberta-large-english")
print(sentiment_analysis("I love this!"))
该模型还可以用作在您的特定数据上进一步微调RoBERTa的起点。有关详细信息和示例代码,请参阅Hugging Face的 documentation 。
为了评估我们的通用情感分析模型的性能,我们从每个数据集中留出了一个评估集,该评估集没有用于训练。平均而言,我们的模型比仅在流行的SST-2数据集上进行微调的模型(78.1%对93.2%)更优越15个百分点以上,请参见下表。作为鲁棒性检验,我们以逐个排除的方式评估模型(在14个数据集上进行训练,对剩余的一个进行评估),平均而言,模型性能仅下降约3个百分点,强调其泛化能力。模型性能以评估集准确度的百分比表示。
| Dataset | DistilBERT SST-2 | This model |
|---|---|---|
| McAuley and Leskovec (2013) (Reviews) | 84.7 | 98.0 |
| McAuley and Leskovec (2013) (Review Titles) | 65.5 | 87.0 |
| Yelp Academic Dataset | 84.8 | 96.5 |
| Maas et al. (2011) | 80.6 | 96.0 |
| Kaggle | 87.2 | 96.0 |
| Pang and Lee (2005) | 89.7 | 91.0 |
| Nakov et al. (2013) | 70.1 | 88.5 |
| Shamma (2009) | 76.0 | 87.0 |
| Blitzer et al. (2007) (Books) | 83.0 | 92.5 |
| Blitzer et al. (2007) (DVDs) | 84.5 | 92.5 |
| Blitzer et al. (2007) (Electronics) | 74.5 | 95.0 |
| Blitzer et al. (2007) (Kitchen devices) | 80.0 | 98.5 |
| Pang et al. (2002) | 73.5 | 95.5 |
| Speriosu et al. (2011) | 71.5 | 85.5 |
| Hartmann et al. (2019) | 65.5 | 98.0 |
| Average | 78.1 | 93.2 |
其他值保持默认,如 here 所列。
当您使用我们的模型时,请引用 this paper (在 IJRM 发表),欢迎通过christian.siebert@uni-hamburg.de与我们联系,提出任何问题或反馈意见。
@article{hartmann2023,
title = {More than a Feeling: Accuracy and Application of Sentiment Analysis},
journal = {International Journal of Research in Marketing},
volume = {40},
number = {1},
pages = {75-87},
year = {2023},
doi = {https://doi.org/10.1016/j.ijresmar.2022.05.005},
url = {https://www.sciencedirect.com/science/article/pii/S0167811622000477},
author = {Jochen Hartmann and Mark Heitmann and Christian Siebert and Christina Schamp},
}