Author Login Editor-in-Chief Peer Review Editor Work Office Work

Computer Engineering ›› 2022, Vol. 48 ›› Issue (8): 266-273. doi: 10.19678/j.issn.1000-3428.0061995

• Development Research and Engineering Application • Previous Articles     Next Articles

Text Sentiment Analysis Model Based on Parallel Hybrid Network and Attention Mechanism

TIAN Qiaoxin1, KONG Weiwei1,2, TENG Jinbao1, WANG Zhaoqian1   

  1. 1. School of Computer, Xi'an University of Posts and Telecommunications, Xi'an 710121, China;
    2. Guangxi Key Laboratory of Trusted Software, Guilin, Guangxi 541004, China
  • Received:2021-07-07 Revised:2021-09-26 Published:2021-10-11

基于并行混合网络与注意力机制的文本情感分析模型

田乔鑫1, 孔韦韦1,2, 滕金保1, 王照乾1   

  1. 1. 西安邮电大学 计算机学院, 西安 710121;
    2. 广西可信软件重点实验室, 广西 桂林 541004
  • 作者简介:田乔鑫(1997-),男,硕士研究生,主研方向为文本情感分析、深度学习;孔韦韦,副教授、博士;滕金保、王照乾,硕士研究生。
  • 基金资助:
    国家自然科学基金(61772396,61902296)。

Abstract: Existing text sentiment analysis models based on deep learning and neural networks typically have problems, such as incomplete text feature extraction.In addition, they do not consider the impact of key information on text sentiment tendencies.Based on the parallel hybrid network and dual-way attention mechanism, an improved text sentiment analysis model is proposed.GloVe and Word2vec are used to vectorize text based on the characteristics of different networks to obtain richer text information.The Bidirectional Gated Recurrent Unit(BiGRU) and Convolutional Neural Network(CNN) are used to construct a parallel hybrid network to improve the feature extraction capacity of the model, and the two-word vectors are input into the parallel hybrid network to extract global and local features.The dual-way attention mechanism is used to strengthen the key information in the global and local features and perform feature fusion to improve the capacity of the model to recognize key information.The fused entire-text features are input to the fully connected layer for final sentiment polarity classification.The experimental results for the IMDb and SST-2 public datasets show that the classification accuracy of the model reaches 91.73% and 91.16%, respectively.This study proves that the dual-way attention mechanism can comprehensively capture the key information in the text and improve the text sentiment classification effect.

Key words: nature language processing, text sentiment analysis, Bidirectional Gated Recurrent Unit(BiGRU), Convolutional Neural Network(CNN), dual-way attention mechanism, feature fusion

摘要: 现有基于深度学习和神经网络的文本情感分析模型通常存在文本特征提取不全面,且未考虑关键信息对文本情感倾向的影响等问题。基于并行混合网络与双路注意力机制,提出一种改进的文本情感分析模型。根据不同神经网络的特点分别采用GloVe和Word2vec两种词向量训练工具将文本向量化,得到更丰富的文本信息。将两种不同的词向量并行输入由双向门控循环单元与卷积神经网络构建的并行混合网络,同时提取上下文全局特征与局部特征,提高模型的特征提取能力。使用双路注意力机制分别对全局特征和局部特征中的关键信息进行加强处理及特征融合,增强模型识别关键信息的能力。将融合后的整个文本特征输入全连接层,实现最终的情感极性分类。在IMDb和SST-2公开数据集上的实验结果表明,该模型的分类准确率分别达到91.73%和91.16%,相比于同类文本情感分析模型有不同程度的提升,从而证明了双路注意力机制可以更全面地捕获文本中的关键信息,提高文本情感分类效果。

关键词: 自然语言处理, 文本情感分析, 双向门控循环单元, 卷积神经网络, 双路注意力机制, 特征融合

CLC Number: