应用科学学报 ›› 2019, Vol. 37 ›› Issue (4): 541-550.doi: 10.3969/j.issn.0255-8297.2019.04.011

• 计算机科学与应用 • 上一篇    下一篇

基于Attention机制的卷积神经网络文本分类模型

赵云山, 段友祥   

  1. 中国石油大学(华东) 计算机与通信工程学院, 山东 青岛 266580
  • 收稿日期:2018-09-14 修回日期:2018-10-29 出版日期:2019-07-31 发布日期:2019-10-11
  • 通信作者: 段友祥,教授,研究方向:人工智能、图形图像处理、理论计算机科学,E-mail:yxduan@upc.edu.cn E-mail:yxduan@upc.edu.cn
  • 基金资助:
    国家科技重大专项基金(No.2017ZX05009001-09)资助

Convolutional Neural Networks Text Classification Model Based on Attention Mechanism

ZHAO Yunshan, DUAN Youxiang   

  1. College of Computer & Communication Engineering, China University of Petroleum, Qingdao 266580, Shandong Province, China
  • Received:2018-09-14 Revised:2018-10-29 Online:2019-07-31 Published:2019-10-11

摘要: 文本分类是自然语言处理的重要内容,而有效提取文本全局语义是成功完成分类任务的关键.为了体现卷积神经网络提取特征的非局部重要性,在模型中引入Attention机制并建立了包含4个Attention CNN层的A-CNN文本分类模型.其中,Attention CNN层中普通卷积层用于提取局部特征,Attention机制用于生成非局部相关度特征.最后,使用A-CNN模型分别在情感分析、问题分类、问题答案选择等数据集上进行了实验和对比分析.结果表明:相比于其他对比模型,A-CNN模型完成上述3个文本分类任务时的最高精度分别提高了1.9%、4.3%、0.6%,可见A-CNN模型在文本分类任务中具有较高的精度和较强的通用性.

关键词: 文本分类, 卷积神经网络, Attention机制, 非局部相关度

Abstract: Text categorization is an important part of natural language processing. Effective extraction of global semantics is the key to the success of text categorization. In order to emphasize the non-local importance of the extracting feature of convolutional neural networks, an A-CNN text classification model including four Attention CNN layers is established by using Attention mechanism. In the A-CNN model, the general convolution of the Attention CNN layer is used to extract local features, and the Attention mechanism is used to generate feature non-local correlation. Finally, the A-CNN model is experimentally used for the analysis on data sets such as sentiment analysis, problem classification, and question answer selection. Compared with other models, the A-CNN model improves the classification precision of the three above tasks by 1.9%, 4.3%, and 0.6%, respectively. The A-CNN model performs higher accuracy in text classification tasks and stronger versatility.

Key words: text categorization, convolutional neural network (CNN), Attention mechanism, non-local correlation

中图分类号: