吉林大学学报(工学版) ›› 2024, Vol. 54 ›› Issue (7): 2026-2037.doi: 10.13229/j.cnki.jdxbgxb.20221229

• 计算机科学与技术 • 上一篇    

一种基于BiGRU和胶囊网络的文本情感分析方法

乔百友(),武彤,杨璐,蒋有文   

  1. 东北大学 计算机科学与工程学院,沈阳 110169
  • 收稿日期:2022-09-23 出版日期:2024-07-01 发布日期:2024-08-05
  • 作者简介:乔百友(1970-),男, 副教授, 博士. 研究方向:云计算、大数据管理与分析技术. E-mail: qiaobaiyou@mail.neu.edu.cn
  • 基金资助:
    国家重点研发计划项目(2019YFB1405302);国家自然科学基金项目(61872072)

A text sentiment analysis method based on BiGRU and capsule network

Bai-you QIAO(),Tong WU,Lu YANG,You-wen JIANG   

  1. School of Computer Science and Engineering,Northeastern University,Shenyang 110169,China
  • Received:2022-09-23 Online:2024-07-01 Published:2024-08-05

摘要:

针对现有基于商品评论文本的情感分析方法大都较少考虑评论文本的方面特征,相关分析模型也未同时考虑上下文长期依赖特征和文本局部特征,因而影响情感分析准确度的问题,提出了一种基于双向门控循环网络(BiGRU)和胶囊网络的文本情感分析方法。该方法首先采用基于词频统计的方法提取出评论文本的方面特征,并将其融入词向量表示中,从而有效提升词向量的表达能力。然后,采用BiGRU提取文本的上下文长期依赖特征,采用胶囊网络提取文本的局部特征,从而实现基于方面的高精度文本情感分析。真实数据集上的实验结果表明,本文提出的方法在准确率、查准率、查全率和F1分数等评价指标上,均优于双向长短期记忆网络(BiLSTM)、CNN-LSTM、TextCNN等现有情感分析模型。

关键词: 深度学习, 方面特征, 情感分析, 评论文本

Abstract:

Most of the existing sentiment analysis methods based on commodity comments texts seldom consider the aspect features, and the related analysis models can′t consider both the long-term context dependence and the local text features, thus affecting the accuracy of sentiment analysis. To solve the problem, a sentiment analysis method based on bidirectional gated recurrent network (BiGRU) and capsule network is proposed. Firstly, the method uses the approach based on the word frequency statistics to extract the aspect features from the comment texts, and integrate them into the word vector representation to effectively improve the expression ability of the word vector. Then, the BiGRU network is used to extract the long-term context features of the texts, and Capsule Network is used to extract local features of the comment texts, thus realizing high-precision text sentiment analysis based on aspect. The experimental results on real datasets show that the proposed method is superior to bidirectional long-short term memory (BiLSTM), CNN-LSTM, TextCNN and other sentiment classification models in Accuracy, Precision, Recall and F1 score.

Key words: deep learning, aspect features, sentiment analysis, comment text

中图分类号: 

  • TP311.13

图1

基于BiGRU与胶囊网络的文本情感分析框架"

图2

方面特征表示示例"

图3

ASP-BiGRU-CAPSULE模型"

表1

数据集"

情感极性积极中性消极
书籍评论10 6704 0343 740
手机评论12 9654 8505 321
酒店评论3 000-7 000

图4

卷积核大小对胶囊网络的影响"

图5

卷积核的数量对胶囊网络的影响"

图6

正则化对GRU模型的影响"

图7

正则化对胶囊网络的影响"

图8

几种模型的实验结果(准确率)"

图9

几种模型的实验结果(F1)"

表2

常用模型对比实验结果 (%)"

模型AccuracyPRF1
LSTM79.1565.8765.4065.82
BiLSTM80.5365.6765.0165.33
CNN78.3565.5764.9765.27
TextCNN80.7866.9266.7566.97
CNN-LSTM83.1168.0367.9867.95
LSTM-CNN84.5768.8968.7468.46
caps-BiLSTM85.1268.9769.1669.06
ABCDM85.0369.2969.3768.32
ASP-BiGRU-CAPSULE85.6169.9169.6769.07
1 Rao Y H, Lei J S, Liu W Y,et al. Building emotional dictionary for sentiment analysis of online news[J]. World Wide Web-internet & Web Information Systems, 2014, 17(4): 723-742.
2 Wu F, Song Y, Huang Y. Microblog sentiment classification with contextual knowledge regularization[C]∥Proceedings of the AAAI Conference on Artificial Intelligence, Austin, USA, 2015: 2332-2338.
3 Sabour S, Frosst N, Hinton G E. Dynamic routing between capsules[C]∥Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach,USA,2017: 3859-3869.
4 Wang Y, Sun A, Han J, et al. Sentiment analysis by capsules[C]∥Proceedings of the 2018 World Wide Web Conference,Lyon, France, 2018: 1165-1174.
5 Cheng Y, Sun H, Chen H, et al. Sentiment analysis using multi-head attention capsules with multi-channel CNN and bidirectional GRU[J]. IEEE Access, 2021, 9: 60383-60395.
6 Peters M, Neumann M, Iyyer M, et al. Deep contextualized word representations[EB/OL]. [2022-07-16].
7 Li S, Zhao Z, Hu R, et al. Analogical reasoning on chinese morphological and semantic relations[EB/OL]. [2022-07-20].
8 Devlin J, Chang M W, Lee K, et al. Bert: pre-training of deep bidirectional transformers for language understanding[EB/OL]. [2022-07-21].
9 Kim Y. Convolutional neural networks for sentence classification[EB/OL]. [2022-08-09].
10 Donahue J, Anne Hendricks L, Guadarrama S, et al. Long-term recurrent convolutional networks for visual recognition and description[C]∥Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, USA, 2015: 2625-2634.
11 Tan M, Santos C D, Xiang B, et al. LSTM-based deep learning models for non-factoid answer selection[EB/OL]. [2022-08-11].
12 Xiao Z, Li X, Wang L, et al. Using convolution control block for Chinese sentiment analysis[J]. Journal of Parallel and Distributed Computing, 2018, 116: 18-26.
13 Li H, Chai Y. Fine-grained sentiment analysis based on convolutional neural network[J]. Data Analysis and Knowledge Discovery, 2019, 3(1): 95-103.
14 Kumar A, Narapareddy V T, Srikanth V A, et al. Aspect-based sentiment classification using interactive gated convolutional network[J]. IEEE Access, 2020, 8: 22445-22453.
15 Cho K, Van Merriënboer B, Gulcehre C, et al. Learning phrase representations using RNN encoder-decoder for statistical machine translation[EB/OL].[2022-08-13].
16 Zhang B, Zhou W. Transformer-Encoder-GRU (T-E-GRU) for Chinese sentiment analysis on Chinese comment text[J]. Neural Processing Letters, 2023, 52(2): 1847-1867.
17 Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[C]∥Advances in Neural Information Processing Systems,Long Beach, USA, 2017: 5998-6008.
18 Basiri M E, Nemati S, Abdar M, et al. ABCDM: an attention-based bidirectional CNN-RNN deep model for sentiment analysis[J]. Future Generation Computer Systems, 2021, 115: 279-294.
19 Zhao W, Ye J, Yang M, et al. Investigating capsule networks with dynamic routing for text classification[EB/OL]. [2022-08-15].
20 Dong Y, Fu Y, Wang L, et al. A sentiment analysis method of capsule network based on BiLSTM[J]. IEEE Access, 2020, 8: 37014-37020.
21 Gu D, Wang J, Cai S, et al. Targeted aspect-based multimodal sentiment analysis: an attention capsule extraction and multi-head fusion network[J]. IEEE Access, 2021, 9: 157329-157336.
22 Yang K H, Liu J. Weibo sentiment analysis based on advanced capsule network[C]∥2021 International Symposium on Computer Science and Intelligent Controls (ISCSIC), Rome, Italy, 2021: 211-216.
23 Phan H T, Nguyen N T, Hwang D, et al. Aspect-level sentiment analysis using CNN over BERT-GCN[J]. IEEE Access, 2022, 10: 110402-110409.
24 Liao W, Zhou J, Wang Y, et al. Fine-grained attention-based phrase-aware network for aspect-level sentiment analysis[J]. Artificial Intelligence Review: An International Science and Engineering Journal, 2022(5): 55.
25 Huang B, Guo R, Zhu Y, et al. Aspect-level sentiment analysis with aspect-specific context position information[J]. Knowledge-Based Systems, 2022, 243: No.108473.
[1] 孙铭会,薛浩,金玉波,曲卫东,秦贵和. 联合时空注意力的视频显著性预测[J]. 吉林大学学报(工学版), 2024, 54(6): 1767-1776.
[2] 张丽平,刘斌毓,李松,郝忠孝. 基于稀疏多头自注意力的轨迹kNN查询方法[J]. 吉林大学学报(工学版), 2024, 54(6): 1756-1766.
[3] 陆玉凯,袁帅科,熊树生,朱绍鹏,张宁. 汽车漆面缺陷高精度检测系统[J]. 吉林大学学报(工学版), 2024, 54(5): 1205-1213.
[4] 李雄飞,宋紫萱,朱芮,张小利. 基于多尺度融合的遥感图像变化检测模型[J]. 吉林大学学报(工学版), 2024, 54(2): 516-523.
[5] 杨国俊,齐亚辉,石秀名. 基于数字图像技术的桥梁裂缝检测综述[J]. 吉林大学学报(工学版), 2024, 54(2): 313-332.
[6] 陈岳林,高铸成,蔡晓东. 基于BERT与密集复合网络的长文本语义匹配模型[J]. 吉林大学学报(工学版), 2024, 54(1): 232-239.
[7] 霍光,林大为,刘元宁,朱晓冬,袁梦,盖迪. 基于多尺度特征和注意力机制的轻量级虹膜分割模型[J]. 吉林大学学报(工学版), 2023, 53(9): 2591-2600.
[8] 金小俊,孙艳霞,于佳琳,陈勇. 基于深度学习与图像处理的蔬菜苗期杂草识别方法[J]. 吉林大学学报(工学版), 2023, 53(8): 2421-2429.
[9] 耿庆田,刘植,李清亮,于繁华,李晓宁. 基于一种深度学习模型的土壤湿度预测[J]. 吉林大学学报(工学版), 2023, 53(8): 2430-2436.
[10] 巫威眺,曾坤,周伟,李鹏,靳文舟. 基于多源数据和响应面优化的公交客流预测深度学习方法[J]. 吉林大学学报(工学版), 2023, 53(7): 2001-2015.
[11] 张振海,季坤,党建武. 基于桥梁裂缝识别模型的桥梁裂缝病害识别方法[J]. 吉林大学学报(工学版), 2023, 53(5): 1418-1426.
[12] 吴飞,农皓业,马晨浩. 基于粒子群优化算法长短时记忆模型的刀具磨损预测方法[J]. 吉林大学学报(工学版), 2023, 53(4): 989-997.
[13] 何科,丁海涛,赖宣淇,许男,郭孔辉. 基于Transformer的轮式里程计误差预测模型[J]. 吉林大学学报(工学版), 2023, 53(3): 653-662.
[14] 刘春晖,王思长,郑策,陈秀连,郝春蕾. 基于深度学习的室内导航机器人避障规划算法[J]. 吉林大学学报(工学版), 2023, 53(12): 3558-3564.
[15] 吕晓琪,李浩,谷宇. 基于深度学习算法的人脸图像活体特征变换尺度提取[J]. 吉林大学学报(工学版), 2023, 53(11): 3201-3206.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!