🚀 基于方面的情感分析模型
本模型由 PyABSA 驱动,是一个用于基于方面的情感分析的开源工具。该模型使用 30k+ 的基于方面的情感分析(ABSA)样本进行训练,详情见 ABSADatasets。测试集未包含在预训练中,因此你可以使用此模型在常见的 ABSA 数据集(如 Laptop14、Rest14 数据集)上进行训练和基准测试(Rest15 数据集除外!)
🚀 快速开始
模型信息
属性 |
详情 |
标签 |
基于方面的情感分析、PyABSA |
许可证 |
MIT |
数据集 |
Laptop14、Restaurant14、Restaurant16、ACL - Twitter、MAMS、Television、TShirt、Yelp |
评估指标 |
准确率、宏 F1 值 |
示例文本 |
[CLS] when tables opened up, the manager sat another party before us. [SEP] manager [SEP] |
模型使用
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# 加载 ABSA 模型和分词器
model_name = "yangheng/deberta-v3-base-absa-v1.1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
for aspect in ['camera', 'phone']:
print(aspect, classifier('The camera quality of this phone is amazing.', text_pair=aspect))
✨ 主要特性
- 本模型是用于基于方面的情感分析的
deberta - v3 - base - absa
模型,使用来自 ABSADatasets 的英文数据集进行训练。
- 该模型基于
microsoft/deberta-v3-base
和 FAST - LCF - BERT 模型进行训练,相关代码来自 PyABSA。
📚 详细文档
训练模型
此模型基于 microsoft/deberta-v3-base
和 FAST - LCF - BERT 模型进行训练,相关代码来自 PyABSA。若要跟踪最先进的模型,请参阅 PyASBA。
PyASBA 中的示例
示例展示了如何在 PyASBA 数据集中使用 FAST - LCF - BERT。
数据集
该模型使用 180k 个 ABSA 数据集示例(包括增强数据)进行微调。训练数据集文件如下:
loading: integrated_datasets/apc_datasets/SemEval/laptop14/Laptops_Train.xml.seg
loading: integrated_datasets/apc_datasets/SemEval/restaurant14/Restaurants_Train.xml.seg
loading: integrated_datasets/apc_datasets/SemEval/restaurant16/restaurant_train.raw
loading: integrated_datasets/apc_datasets/ACL_Twitter/acl-14-short-data/train.raw
loading: integrated_datasets/apc_datasets/MAMS/train.xml.dat
loading: integrated_datasets/apc_datasets/Television/Television_Train.xml.seg
loading: integrated_datasets/apc_datasets/TShirt/Menstshirt_Train.xml.seg
loading: integrated_datasets/apc_datasets/Yelp/yelp.train.txt
引用
如果你在研究中使用此模型,请引用我们的论文:
@inproceedings{DBLP:conf/cikm/0008ZL23,
author = {Heng Yang and
Chen Zhang and
Ke Li},
editor = {Ingo Frommholz and
Frank Hopfgartner and
Mark Lee and
Michael Oakes and
Mounia Lalmas and
Min Zhang and
Rodrygo L. T. Santos},
title = {PyABSA: {A} Modularized Framework for Reproducible Aspect-based Sentiment
Analysis},
booktitle = {Proceedings of the 32nd {ACM} International Conference on Information
and Knowledge Management, {CIKM} 2023, Birmingham, United Kingdom,
October 21-25, 2023},
pages = {5117--5122},
publisher = {{ACM}},
year = {2023},
url = {https://doi.org/10.1145/3583780.3614752},
doi = {10.1145/3583780.3614752},
timestamp = {Thu, 23 Nov 2023 13:25:05 +0100},
biburl = {https://dblp.org/rec/conf/cikm/0008ZL23.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
@article{YangZMT21,
author = {Heng Yang and
Biqing Zeng and
Mayi Xu and
Tianxing Wang},
title = {Back to Reality: Leveraging Pattern-driven Modeling to Enable Affordable
Sentiment Dependency Learning},
journal = {CoRR},
volume = {abs/2110.08604},
year = {2021},
url = {https://arxiv.org/abs/2110.08604},
eprinttype = {arXiv},
eprint = {2110.08604},
timestamp = {Fri, 22 Oct 2021 13:33:09 +0200},
biburl = {https://dblp.org/rec/journals/corr/abs-2110-08604.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
📄 许可证
本项目采用 MIT 许可证。