江汉大学学报(自然科学版) ›› 2020, Vol. 48 ›› Issue (4): 80-89.doi: 10.16389/j.cnki.cn42-1737/n.2020.04.011

• 计算机与信息科学 • 上一篇    下一篇

基于BGRU 和自注意力机制的情感分析

孙敏,李旸*,庄正飞,钱涛   

  1. 安徽农业大学 信息与计算机学院,安徽 合肥 230036
  • 发布日期:2020-08-06
  • 通讯作者: 李旸
  • 作者简介:孙敏(1994— ),女,硕士生,研究方向:深度学习、情感分析。
  • 基金资助:
    国家自然科学基金资助项目(61402013)

Sentiment Analysis Based on BGRU and Self-Attention Mechanism

SUN Min,LI Yang*,ZHUANG Zhengfei,QIAN Tao   

  1. School of Information and Computer Science,Anhui Agriculture University,Hefei 230036,Anhui,China
  • Published:2020-08-06
  • Contact: LI Yang

摘要: 自然语言处理领域的一个研究热点是对社交网络产生的文本数据进行情感分析。由于循环神经网络结构复杂且存在记忆丢失、梯度弥散问题影响分类的准确率;而注意力机制需要依赖较多的 参数,无法关注更多文本的内部序列关系。针对此问题,提出基于BGRU 和自注意力机制的情感分析。模型首先将文本用GloVe 向量化,之后使用BGRU 提取文本的上下文信息,再通过自注意力机制 动态调整特征的权重,最后用分类器得到情感分类的结果。提出的模型在IMDB 英文语料库上进行多组对比实验,结果表明,该方法在文本分类中的准确率达到91. 23%。

关键词: 情感分析, 双向门限循环单元(BGRU), 自注意力机制

Abstract: Sentiment analysis of text data generated by social networks has become a research hot spot in the field of natural language processing. Because of the complex structure,memory loss, and gradient diffusion of the recurrent neural network, the accuracy of classification is affected. However,the attention mechanism needs more parameters and can't pay attention to the more internal sequence relationship of texts. To solve this problem,this paper proposes a sentiment analysis based on BGRU and self-attention mechanism. In the model,firstly,the text is vectorized by GloVe,and the context information is extracted by BGRU. Then the weight of features is dynamically adjusted by the self-attention mechanism. Finally,the result of sentiment classification is obtained by the classifier. The model proposed in this paper is applied to the IMDB English corpus,and the experimental results show that the accuracy of this method in text classification is 91. 23%。

Key words: sentiment analysis, bidirectional gated recurrent unit(BGRU), self-attention mechanism

中图分类号: