计算机工程与应用2024,Vol.60Issue(15):101-110,10.DOI:10.3778/j.issn.1002-8331.2304-0255
融合非负正弦位置编码和混合注意力机制的情感分析模型
Sentiment Classification Model Based on Non-Negative Sinusoidal Positional Encoding and Hybrid Attention Mechanism
摘要
Abstract
NSPEHA-BiLSTM is proposed to address the issues of sequence models in sentiment analysis tasks,such as difficulty in obtaining the relative positional information of text and the loss of critical information when processing long sequences.The model integrates non-negative sinusoidal position encoding(NSPE)and hybrid attention mechanism(HAM)to incorporate relative positional information into word embeddings and weight the global and local information features of text using HAM,respectively,ensuring the accurate transmission of critical information.The text features are extracted by Bi-LSTM,and sentiment analysis is performed using a fully connected layer.NSPEHA-BiLSTM achieves higher accu-racy than Bi-LSTM and Text-CNN by 4.67 and 2.02 percentage points,respectively,on the IMDB dataset,and the model performance improves with longer input text.The results also verify that NSPE is superior to other position encodings.关键词
情感分析/双向长短期记忆网络(Bi-LSTM)/非负正弦位置编码(NSPE)/混合注意力机制(HAM)Key words
sentiment analysis/bi-directional long short-term memory(Bi-LSTM)/non-negative sinusoidal position encoding(NSPE)/hybrid attention mechanism(HAM)分类
信息技术与安全科学引用本文复制引用
郑志超,陈进东,张健..融合非负正弦位置编码和混合注意力机制的情感分析模型[J].计算机工程与应用,2024,60(15):101-110,10.基金项目
国家重点研发计划课题(2019YFB1405303) (2019YFB1405303)
北京市属高等学校优秀青年人才培育计划项目(BPHR202203233) (BPHR202203233)
国家自然科学基金(72174018). (72174018)