摘要
针对目前在短文本语义情感分析过程中会存在的传统词嵌入对情感语义表达不充分,特征挖掘不全面,准确率较低等问题,提出一种基于多头注意力机制的MACGRU并行混合网络模型。首先,根据胶囊网络(CapsNet)与双向门限循环单元网络(BiGRU)不同的特点选择BERT词嵌入与Glove词嵌入对短文本做向量化表示,并对Glove词嵌入改进加入位置嵌入和词性嵌入,使短文本在词嵌入阶段获取更丰富的短文本信息;其次,将BERT训练的词向量和Glove训练的词向量分别输入CapsNet和BiGRU中提取短文本局部语义信息和短文本的上下文语义信息;然后,在CapsNet和BiGRU的特征输出后都加入多头注意力机制对提取到的情感特征进行加权处理;最后,将多头注意力机制加权后的局部特征和上下文语义特征进行融合并通过softmax函数进行情感分类输出。上述模型在公开数据集COVID-19上进行实验验证,其模型的准确率,精准率,召回率,F1指标都达到了95%以上,相较于其它基准模型性能更优,也充分证明了该模型的优越性。
Aiming at the problems that traditional word embeddings do not adequately express emotional seman⁃tics,feature mining is not comprehensive,and accuracy is low in the process of semantic sentiment analysis of short texts,a MACGRU parallel hybrid network model based on multi-head attention mechanism is proposed.First,accord⁃ing to the different characteristics of Capsule Network(CapsNet)and Bidirectional Gated Recurrent Unit(BiGRU),BERT word embedding and Glove word embedding are selected to vectorize short texts,and position embedding and part-of-speech embedding are added to the improvement of Glove word embedding,so that the short text obtains ric⁃her short text information in the word embedding stage.Secondly,the word vector trained by BERT and the word vec⁃tor trained by Glove are input into CapsNet and BiGRU to extract the local semantic information of the short text and the contextual semantic information of the short text.Then,after the feature output of CapsNet and BiGRU,a multihead attention mechanism is added to weigh the extracted emotional features.Finally,the local features and contextual semantic features weighted by the multi-head attention mechanism are fused and output by the softmax function for e⁃motional classification.The model was experimentally verified on the public data set COVID-19,and its accuracy,precision,recall,and F1 indicators have all reached more than 95%.Compared with other benchmark models,the per⁃formance of the model is better,which fully proves its superiority.
作者
任楚岚
仇全涛
REN Chu-lan;QIU Quan-tao(School of Computer Science and Technology,Shenyang University of Chemical Technology,Shenyang Liaoning 110142,China;Liaoning Provincial Key Laboratory of Industrial Intelligent Technology for Chemical Processes,Shenyang Liaoning 110142,China)
出处
《计算机仿真》
2024年第6期570-577,共8页
Computer Simulation
基金
辽宁省教育厅科学研究项目(LJKZ0449)。
关键词
语义情感分析
短文本
胶囊网络
双向门限循环单元
多头注意力机制
并行混合网络
Semantic sentiment analysis
Short text
Capsule network(CapsNet)
Bidirectional gated recurrent unit(BiGRU)
Multi-head attention mechanism
Parallel hybrid network