《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (12): 3703-3710.DOI: 10.11772/j.issn.1001-9081.2022121894

• 人工智能 • 上一篇    下一篇

基于多层次注意力的语义增强情感分类模型

曹建乐, 李娜娜()   

  1. 河北工业大学 人工智能与数据科学学院,天津 300401
  • 收稿日期:2023-02-01 修回日期:2023-03-05 接受日期:2023-03-08 发布日期:2023-03-17 出版日期:2023-12-10
  • 通讯作者: 李娜娜
  • 作者简介:曹建乐(1998—),男,山东潍坊人,硕士研究生,主要研究方向:文本分类、情感分析;

Semantically enhanced sentiment classification model based on multi-level attention

Jianle CAO, Nana LI()   

  1. School of Artificial Intelligence,Hebei University of Technology,Tianjin 300401,China
  • Received:2023-02-01 Revised:2023-03-05 Accepted:2023-03-08 Online:2023-03-17 Published:2023-12-10
  • Contact: Nana LI
  • About author:CAO Jianle, born in 1998, M. S. candidate. His research interests include text classification, sentiment analysis.

摘要:

由于自然语言的复杂语义、词的多情感极性以及文本的长期依赖关系,现有的文本情感分类方法面临严峻挑战。针对这些问题,提出了一种基于多层次注意力的语义增强情感分类模型。首先,使用语境化的动态词嵌入技术挖掘词汇的多重语义信息,并且对上下文语义进行建模;其次,通过内部注意力层中的多层并行的多头自注意力捕获文本内部的长期依赖关系,从而获取全面的文本特征信息;再次,在外部注意力层中,将评论元数据中的总结信息通过多层次的注意力机制融入评论特征中,从而增强评论特征的情感信息和语义表达能力;最后,采用全局平均池化层和Softmax函数实现情感分类。在4个亚马逊评论数据集上的实验结果表明,与基线模型中表现最好的TE-GRU (Transformer Encoder with Gated Recurrent Unit)相比,所提模型在App、Kindle、Electronic和CD数据集上的情感分类准确率至少提升了0.36、0.34、0.58和0.66个百分点,验证了该模型能够进一步提高情感分类性能

关键词: 情感分类, 自然语言处理, 词嵌入, 注意力机制, 神经网络

Abstract:

The existing text sentiment classification methods face serious challenges due to the complex semantics of natural language, the multiple sentiment polarities of words, and the long-term dependency of text. To solve these problems, a semantically enhanced sentiment classification model based on multi-level attention was proposed. Firstly, the contextualized dynamic word embedding technology was used to mine the multiple semantic information of words, and the context semantics was modeled. Secondly, the long-term dependency within the text was captured by the multi-layer parallel multi-head self-attention in the internal attention layer to obtain comprehensive text feature information. Thirdly, in the external attention layer, the summary information in the review metadata was integrated into the review features through a multi-level attention mechanism to enhance the sentiment information and semantic expression ability of the review features. Finally, the global average pooling layer and Softmax function were used to realize sentiment classification. Experimental results on four Amazon review datasets show that, compared with the best-performing TE-GRU (Transformer Encoder with Gated Recurrent Unit) in the baseline models, the proposed model improves the sentiment classification accuracy on App, Kindle, Electronic and CD datasets by at least 0.36, 0.34, 0.58 and 0.66 percentage points, which verifies that the proposed model can further improve the sentiment classification performance.

Key words: sentiment classification, Natural Language Processing (NLP), word embedding, attention mechanism, neural network

中图分类号: