计算机科学与探索 ›› 2024, Vol. 18 ›› Issue (1): 205-216.DOI: 10.3778/j.issn.1673-9418.2210012

• 人工智能·模式识别 • 上一篇    下一篇

基于BERT的双特征融合注意力的方面情感分析模型

李锦,夏鸿斌,刘渊   

  1. 1. 江南大学 人工智能与计算机学院,江苏 无锡 214122
    2. 江苏省媒体设计与软件技术重点实验室,江苏 无锡 214122
  • 出版日期:2024-01-01 发布日期:2024-01-01

Dual Features Local-Global Attention Model with BERT for Aspect Sentiment Analysis

LI Jin, XIA Hongbin, LIU Yuan   

  1. 1. School of Artificial Intelligence and Computer, Jiangnan University, Wuxi, Jiangsu 214122, China
    2. Jiangsu Key Laboratory of Media Design and Software Technology, Wuxi, Jiangsu 214122, China
  • Online:2024-01-01 Published:2024-01-01

摘要: 方面情感分析旨在预测句子或文档中一个特定方面的情感极性,现阶段大部分的研究都是使用注意力机制对上下文进行建模。然而,目前情感分类模型在使用BERT模型计算表征之间的依赖关系抽取特征时,大多未根据不同的语境背景考虑上下文信息,导致建模后的特征缺乏上下文的语境信息。同时,方面词的重要性未能得到充分的重视而影响模型整体分类的性能。针对上述问题,提出双特征融合注意力方面情感分析模型(DFLGA-BERT),分别设计了局部与全局的特征抽取模块,充分捕捉方面词和上下文的语义关联。并将一种改进的“准”注意力添加到DFLGA-BERT的全局特征抽取器中,使模型学习在注意力的融合中使用减性注意力以削弱噪声产生的负面影响。基于条件层规泛化(CLN)设计了局部特征和全局特征的特征融合结构来更好地融合局部和全局特征。在SentiHood和SemEval 2014 Task 4数据集上进行了实验,实验结果表明,与基线模型相比该模型在融入了上下文语境特征后取得了较明显的性能提升。

关键词: 情感分析, 自然语言理解, 准注意力机制, 上下文注意

Abstract: Aspect-based sentiment analysis aims to predict the sentiment polarity of a specific aspect in a sentence or document. Most of recent research uses attention mechanism to model the context. But there is a problem in that the context information needs to be considered according to different contexts when the BERT model is used to calculate the dependencies between representations to extract features by sentiment classification models, which leads to the lack of contextual knowledge of the modelled features. And the importance of aspect words is not given more attention, affecting the overall classification performance of the model. To address the problems above, this paper proposes a dual features local-global attention model with BERT (DFLGA-BERT). Local and global feature extraction modules are designed respectively to fully capture the semantic association between aspect words and context. Moreover, an improved quasi-attention mechanism is used in DFLGA-BERT, which leads to the model using minus attention in the fusion of attention to weaken the effect of noise on classification in the text. The feature fusion structure of local and global features is designed to better integrate regional and global features based on conditional layer normalization (CLN). Experiments are conducted on the SentiHood and SemEval 2014 Task 4 datasets. Experimental results show that the performance of the proposed model is significantly improved compared with the baselines after incorporating contextual features.

Key words: sentiment analysis, natural language understanding, quasi-attention mechanism, contextual attention