摘要
方面情感分析旨在预测句子或文档中一个特定方面的情感极性。最近大部分的研究都是通过使用注意力机制及外部语义知识对全局上下文进行建模,以完成这项工作。方面的情感极性往往取决于与方面高度相关的局部上下文,但大多数模型将过多的注意力集中于全局上下文,这使得模型的参数量普遍比较大,导致计算量也随之增大。为此,提出一种基于多头注意力机制的轻量化网络模型——局部与全局特征融合网络模型。首先,使用双向门控循环单元来对上下文进行编码。其次,根据与方面项的语义相关距离掩蔽掉与方面项相关度较小的上下文词,以此得到局部上下文表示。最后,通过多头Aspect-aware注意力网络对局部和全局上下文分别进行提取,将两者提取的结果进行结合。此外,还将预先训练的BERT应用于这项任务,并获得了更好的结果。在三个数据集Twitter、Laptop、Restaurant上进行实验,采用Accuracy和F1指标进行评估。实验结果表明,该模型在参数量较小的情况下,取得了比其他基于方面的情感分类算法更好的结果。
Aspect-based sentiment analysis aims to predict the sentiment polarity of a specific aspect in a sentence or document.Most of the recent research is to use attention mechanism and external semantic knowledge to model the global context.The sentiment polarity of an aspect often depends on the local context which is highly related to the aspect,but most models focus too much on the global context,which makes the parameter amount of the model generally larger,resulting in an increase in the amount of calculation.To this end,this paper proposes a lightweight network model based on multi-head attention mechanism,which is named local and global feature fusion network.Firstly,a bidirectional gated recurrent unit is used to encode the context.Secondly,context words that are less relevant to the aspect term are masked out according to the semantic relation distance with the aspect term,so as to obtain the local context representation.Finally,the local and global context are extracted respectively by multi-head Aspect-aware attention network,and the results of the two extraction are combined.In addition,the pre-trained BERT is also applied to the proposed model and better results are obtained.Experiments are conducted on three datasets:Twitter,Laptop,and Restaurant.Accuracy and F1 indicators are used for evaluation.Experimental results show that the proposed model achieves better results than other aspect-based sentiment classification algorithms with a small amount of parameters.
作者
夏鸿斌
李强
刘渊
XIA Hongbin;LI Qiang;LIU Yuan(School of Artificial Intelligence and Computer Science,Jiangnan University,Wuxi,Jiangsu 214122,China;Jiangsu Key Laboratory of Media Design and Software Technology,Wuxi,Jiangsu 214122,China)
出处
《计算机科学与探索》
CSCD
北大核心
2023年第4期902-911,共10页
Journal of Frontiers of Computer Science and Technology
基金
国家自然科学基金(61972182)。
关键词
注意力机制
局部上下文注意
情感分析
文本分类
attention mechanism
local context attention
sentiment analysis
text classification