融合非负正弦位置编码和混合注意力机制的情感分析模型OA北大核心CSTPCD
Sentiment Classification Model Based on Non-Negative Sinusoidal Positional Encoding and Hybrid Attention Mechanism
针对情感分析任务中,序列模型存在难以获取文本的相对位置信息,且处理较长序列时容易丢失关键信息等问题,提出了一种融合非负正弦位置编码(non-negative sinusoidal position encoding,NSPE)和混合注意力机制(hybrid attention mechanism,HAM)的双向长短期记忆网络(bi-directional long short-term memory,Bi-LSTM)情感分析模型(NSPEHA-BiLSTM).提出NSPE方法,建立词语的NSPE,为词向量融入相对位置信息;通过Bi-LSTM提取文本特征,并基于HAM分别对特征的全局和局部特征进行赋权,确保关键信息的准确传递;通过全连接层实现文本情感分析.在IMDB数据集中,NSPEA-BiLSTM相较于Bi-LSTM和Text-CNN准确率分别提升了4.67和2.02个百分点,且输入的文本长度越长,模型效果越好,同时验证了NSPE优于其他位置编码.
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.
郑志超;陈进东;张健
北京信息科技大学 计算机学院,北京 100192北京信息科技大学 经济管理学院,北京 100192||智能决策与大数据应用北京市国际科技合作基地,北京 100192
计算机与自动化
情感分析双向长短期记忆网络(Bi-LSTM)非负正弦位置编码(NSPE)混合注意力机制(HAM)
sentiment analysisbi-directional long short-term memory(Bi-LSTM)non-negative sinusoidal position encoding(NSPE)hybrid attention mechanism(HAM)
《计算机工程与应用》 2024 (015)
101-110 / 10
国家重点研发计划课题(2019YFB1405303);北京市属高等学校优秀青年人才培育计划项目(BPHR202203233);国家自然科学基金(72174018).
评论