摘要
针对短文本的细粒度情感分类,提出一种基于胶囊网络的模型,在词嵌入层使用BERT预训练模型对上下文序列、目标词序列编码;然后采用LSTM对上下文序列、目标词序列提取相应的特征;在注意力编码层均采用多头注意力完成注意力编码;最后在胶囊层完成情感分类。实验采用三个情感极性,分别对应积极、中性和消极情感。结果表明,该方法不仅提高了分类精度,而且F1值也得到了不小的提升,说明提出的模型对短文本的细粒度情感分类是有效的。
For fine⁃grained sentiment classification of short texts,a model based on capsule network is proposed.The BERT pre⁃training model is used in the word embedding layer to encode the context sequence and target word sequence.Then LSTM is applied to extract the corresponding features on the context sequence and target word sequence.In the attention encoding layer,multi⁃head attention is used to complete the attention encoding.Finally,the emotion classification is completed in the capsule layer.Experimental adopts three affective polarities,corresponding to positive,neutral and negative affect,respectively.The results show that this method not only improves the classification accuracy,but also improves the F1 value,which shows that the model is effective for fine⁃grained sentiment classification of short texts.
作者
邵辉
Shao Hui(Computer Engineering Technology College,Guangdong Polytechnic Science and Technology,Zhuhai 519090)
出处
《现代计算机》
2023年第2期99-102,共4页
Modern Computer
基金
2021年广东省高职教育教学改革研究与实践项目(GDJG2021153)
广东科学技术职业学院2022年度校级科研项目(XJPY202209):基于胶囊模型的细粒度短文本情感分析技术研究。
关键词
胶囊模型
短文本
BERT
情感分类
capsule model
short text
BERT
sentiment classification