《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (6): 1796-1802.DOI: 10.11772/j.issn.1001-9081.2022060891
所属专题: 人工智能
郑智雄1,2, 刘建华1,2(), 孙水华1,2, 徐戈3, 林鸿辉1,2
收稿日期:
2022-06-20
修回日期:
2022-09-23
接受日期:
2022-10-11
发布日期:
2022-11-07
出版日期:
2023-06-10
通讯作者:
刘建华
作者简介:
郑智雄(1996—),男,福建莆田人,硕士研究生,CCF会员,主要研究方向:方面级情感分析基金资助:
Zhixiong ZHENG1,2, Jianhua LIU1,2(), Shuihua SUN1,2, Ge XU3, Honghui LIN1,2
Received:
2022-06-20
Revised:
2022-09-23
Accepted:
2022-10-11
Online:
2022-11-07
Published:
2023-06-10
Contact:
Jianhua LIU
About author:
ZHENG Zhixiong, born in 1996, M. S. candidate. His research interests include aspect-based sentiment analysis.Supported by:
摘要:
针对目前方面级情感分析(ABSA)模型过多依赖关系较为稀疏的句法依赖树学习特征表示,导致模型学习局部信息能力不足的问题,提出了一种融合多窗口局部信息的ABSA模型MWGAT(combining Multi-Window local information and Graph ATtention network)。首先,通过多窗口局部特征学习机制学习局部上下文特征,并挖掘文本包含的潜在局部信息;其次,采用能够较好理解依赖树的图注意力网络(GAT)学习句法依赖树所表示的语法结构信息,并生成语法感知的上下文特征;最后,将这两种表示不同语义信息的特征融合,形成既包含句法依赖树的语法信息又包含局部信息的特征表示,从而便于分类器高效判别方面词的情感极性。在Restaurant、Laptop和Twitter这3个公开数据集上进行实验,结果表明与结合了句法依赖树的T-GCN(Type-aware Graph Convolutional Network)模型相比,所提模型的Macro-F1分数分别提高了2.48%、2.37%和0.32%。可见,所提模型能够有效挖掘潜在的局部信息,并更为精确地预测方面词的情感极性。
中图分类号:
郑智雄, 刘建华, 孙水华, 徐戈, 林鸿辉. 融合多窗口局部信息的方面级情感分析模型[J]. 计算机应用, 2023, 43(6): 1796-1802.
Zhixiong ZHENG, Jianhua LIU, Shuihua SUN, Ge XU, Honghui LIN. Aspect-based sentiment analysis model fused with multi-window local information[J]. Journal of Computer Applications, 2023, 43(6): 1796-1802.
数据集 | 积极 | 消极 | 中性 | |||
---|---|---|---|---|---|---|
训练 | 测试 | 训练 | 测试 | 训练 | 测试 | |
Restaurant | 2 164 | 727 | 807 | 196 | 637 | 196 |
Laptop | 976 | 337 | 851 | 128 | 455 | 167 |
1 507 | 172 | 1 528 | 169 | 3 016 | 336 |
表1 实验数据统计信息
Tab. 1 Experimental data statistical information
数据集 | 积极 | 消极 | 中性 | |||
---|---|---|---|---|---|---|
训练 | 测试 | 训练 | 测试 | 训练 | 测试 | |
Restaurant | 2 164 | 727 | 807 | 196 | 637 | 196 |
Laptop | 976 | 337 | 851 | 128 | 455 | 167 |
1 507 | 172 | 1 528 | 169 | 3 016 | 336 |
参数 | 值 | 说明 |
---|---|---|
BERT Model | bert-base-uncased | BERT模型版本 |
Embedding Dimension | 768 | 词嵌入维度 |
BERT Dropout | 0.1 | BERT随机失活比例 |
MWFLL Dropout | 0.1 | MWFLL随机失活比例 |
Number of GAT Head | 4 | GAT的注意力头数 |
Learning Rate | 2×10-5 | 学习率 |
L2 Regularization Term | 10-5 | L2正则化超参数 |
表2 超参数设置
Tab. 2 Hyperparameter setting
参数 | 值 | 说明 |
---|---|---|
BERT Model | bert-base-uncased | BERT模型版本 |
Embedding Dimension | 768 | 词嵌入维度 |
BERT Dropout | 0.1 | BERT随机失活比例 |
MWFLL Dropout | 0.1 | MWFLL随机失活比例 |
Number of GAT Head | 4 | GAT的注意力头数 |
Learning Rate | 2×10-5 | 学习率 |
L2 Regularization Term | 10-5 | L2正则化超参数 |
参数 | 值 | 说明 |
---|---|---|
Operating System | Windows 10 | 操作系统 |
GPU | Nvidia RTX 3070 | 图像处理器 |
GPU Memory | 8.0GB | 图像处理器内存 |
Development Tool | PyCharm 2020.3.1 | 开发工具 |
Deep Learning Framework | PyTorch 1.10.0 | 深度学习框架 |
表3 实验环境
Tab. 3 Environment of experiments
参数 | 值 | 说明 |
---|---|---|
Operating System | Windows 10 | 操作系统 |
GPU | Nvidia RTX 3070 | 图像处理器 |
GPU Memory | 8.0GB | 图像处理器内存 |
Development Tool | PyCharm 2020.3.1 | 开发工具 |
Deep Learning Framework | PyTorch 1.10.0 | 深度学习框架 |
类别 | 模型 | Restaurant | Laptop | ||||
---|---|---|---|---|---|---|---|
Acc | MF1 | Acc | MF1 | Acc | MF1 | ||
w/o Syn | ATAE-LSTM | 77.20 | — | 68.70 | — | — | — |
IAN | 78.60 | — | 72.10 | — | — | — | |
MGAN | 81.25 | 71.94 | 75.39 | 72.47 | 72.54 | 70.81 | |
AEN | 80.98 | 72.14 | 73.51 | 69.04 | 72.83 | 69.81 | |
AEN-BERT | 83.12 | 73.76 | 79.93 | 76.31 | 74.71 | 73.13 | |
CapsNet | 80.79 | — | — | — | 79.78 | — | |
W Syn | PhraseRNN | 66.20 | 59.32 | — | — | — | — |
LSTM+SynAtt | 80.45 | 71.26 | 72.57 | 69.13 | — | — | |
TD-GAT | 81.20 | — | 74.00 | — | — | — | |
CDT | 82.30 | 74.02 | 77.19 | 72.99 | 74.66 | 73.66 | |
R-GAT+BERT | 85.44 | 79.17 | 78.01 | 75.57 | 75.93 | 74.60 | |
T-GCN | 86.12 | 79.95 | 80.32 | 76.82 | 76.45 | 75.25 | |
MWGAT | 87.21 | 81.93 | 81.56 | 78.64 | 76.74 | 75.49 |
表4 不同模型的实验结果 (%)
Tab. 4 Experimental results of different models
类别 | 模型 | Restaurant | Laptop | ||||
---|---|---|---|---|---|---|---|
Acc | MF1 | Acc | MF1 | Acc | MF1 | ||
w/o Syn | ATAE-LSTM | 77.20 | — | 68.70 | — | — | — |
IAN | 78.60 | — | 72.10 | — | — | — | |
MGAN | 81.25 | 71.94 | 75.39 | 72.47 | 72.54 | 70.81 | |
AEN | 80.98 | 72.14 | 73.51 | 69.04 | 72.83 | 69.81 | |
AEN-BERT | 83.12 | 73.76 | 79.93 | 76.31 | 74.71 | 73.13 | |
CapsNet | 80.79 | — | — | — | 79.78 | — | |
W Syn | PhraseRNN | 66.20 | 59.32 | — | — | — | — |
LSTM+SynAtt | 80.45 | 71.26 | 72.57 | 69.13 | — | — | |
TD-GAT | 81.20 | — | 74.00 | — | — | — | |
CDT | 82.30 | 74.02 | 77.19 | 72.99 | 74.66 | 73.66 | |
R-GAT+BERT | 85.44 | 79.17 | 78.01 | 75.57 | 75.93 | 74.60 | |
T-GCN | 86.12 | 79.95 | 80.32 | 76.82 | 76.45 | 75.25 | |
MWGAT | 87.21 | 81.93 | 81.56 | 78.64 | 76.74 | 75.49 |
窗口尺寸 | 不同数据集上的预测准确率 | |
---|---|---|
Restaurant | Laptop | |
3 | 86.51 | 80.70 |
5 | 87.12 | 81.25 |
7 | 86.15 | 79.06 |
9 | 85.08 | 79.22 |
11 | 85.88 | 78.75 |
表5 不同窗口尺寸的性能对比 (%)
Tab. 5 Performance comparison results for different window sizes
窗口尺寸 | 不同数据集上的预测准确率 | |
---|---|---|
Restaurant | Laptop | |
3 | 86.51 | 80.70 |
5 | 87.12 | 81.25 |
7 | 86.15 | 79.06 |
9 | 85.08 | 79.22 |
11 | 85.88 | 78.75 |
窗口数 | 窗口尺寸组合 | 不同数据集上的预测准确率 | |
---|---|---|---|
Restaurant | Laptop | ||
1 | (5) | 87.12 | 81.25 |
2 | (3,5) | 87.21 | 81.56 |
3 | (3,5,7) | 86.86 | 80.78 |
4 | (3,5,7,9) | 86.60 | 79.69 |
5 | (3,5,7,9,11) | 84.71 | 77.81 |
表6 不同窗口数的实验结果 (%)
Tab. 6 Experimental results for different numbers of windows
窗口数 | 窗口尺寸组合 | 不同数据集上的预测准确率 | |
---|---|---|---|
Restaurant | Laptop | ||
1 | (5) | 87.12 | 81.25 |
2 | (3,5) | 87.21 | 81.56 |
3 | (3,5,7) | 86.86 | 80.78 |
4 | (3,5,7,9) | 86.60 | 79.69 |
5 | (3,5,7,9,11) | 84.71 | 77.81 |
模型 | Restaurant | Laptop | ||
---|---|---|---|---|
Acc | MF1 | Acc | MF1 | |
w/o MWFLL | 86.32 | 79.58 | 80.16 | 76.93 |
w/o GAT | 85.61 | 78.78 | 78.91 | 74.92 |
MWGAT | 87.21 | 81.93 | 81.56 | 78.64 |
表7 消融实验结果 (%)
Tab. 7 Results of ablation study
模型 | Restaurant | Laptop | ||
---|---|---|---|---|
Acc | MF1 | Acc | MF1 | |
w/o MWFLL | 86.32 | 79.58 | 80.16 | 76.93 |
w/o GAT | 85.61 | 78.78 | 78.91 | 74.92 |
MWGAT | 87.21 | 81.93 | 81.56 | 78.64 |
1 | 张严,李天瑞.面向评论的方面级情感分析综述[J].计算机科学,2020,47(6):194-200. 10.11896/jsjkx.200200127 |
ZHANG Y, LI T R. Review of comment-oriented aspect-level sentiment analysis[J]. Computer Science, 2020, 47(6):194-200. 10.11896/jsjkx.200200127 | |
2 | 史伟,付月. 考虑语境的微博短文本挖掘:情感分析的方法[J]. 计算机科学, 2021, 48(6A):158-164. 10.11896/jsjkx.210200089 |
SHI W, FU Y. Microblog short text mining considering context: a method of sentiment analysis [J]. Computer Science, 2021, 48(6A):158-164. 10.11896/jsjkx.210200089 | |
3 | AKOURY N, KRISHNA K, IYYER M. Syntactically supervised transformers for faster neural machine translation [C]// Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. Stroudsburg, PA: ACL, 2019: 1269-1281. 10.18653/v1/p19-1122 |
4 | PHAN M H, OGUNBONA P O. Modelling context and syntactical features for aspect-based sentiment analysis [C]// Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. Stroudsburg, PA: ACL, 2020: 3211-3220. 10.18653/v1/2020.acl-main.293 |
5 | WANG Y Q, HUANG M L, ZHU X Y, et al. Attention-based LSTM for aspect-level sentiment classification [C]// Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing. Stroudsburg, PA: ACL, 2016: 606-615. 10.18653/v1/d16-1058 |
6 | VASWANI A, SHAZEER N, PARMAR N, et al. Attention is all you need [C]// Proceedings of the 31st International Conference on Neural Information Processing Systems. Red Hook, NY: Curran Associates Inc., 2017: 6000-6010. |
7 | MA D H, LI S J, ZHANG X D, et al. Interactive attention networks for aspect-level sentiment classification[C]// Proceedings of the 26th International Joint Conference on Artificial Intelligence. California: ijcai.org, 2017: 4068-4074. 10.24963/ijcai.2017/568 |
8 | LI X, BING L D, LAM W, et al. Transformation networks for target-oriented sentiment classification [C]// Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Stroudsburg, PA: ACL, 2018: 946-956. 10.18653/v1/p18-1087 |
9 | ZENG B Q, YANG H, XU R Y, et al. LCF: a local context focus mechanism for aspect-based sentiment classification[J]. Applied Sciences, 2019, 9(16): No.3389. 10.3390/app9163389 |
10 | HUANG B X, CARLEY K M. Syntax-aware aspect level sentiment classification with graph attention networks[C]// Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing. Stroudsburg, PA: ACL, 2019: 5469-5477. 10.18653/v1/d19-1549 |
11 | YAN H, DAI J Q, JI T, et al. A unified generative framework for aspect-based sentiment analysis[C]// Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). Stroudsburg, PA: ACL, 2021: 2416-2429. 10.18653/v1/2021.acl-long.188 |
12 | MA L H, RABBANY R, ROMERO-SORIANO A. Graph attention networks with positional embeddings [C]// Proceedings of the 2021 Pacific-Asia Conference on Knowledge Discovery and Data Mining, LNCS 12712. Cham: Springer, 2021: 514-527. |
13 | BAI X F, LIU P B, ZHANG Y. Investigating typed syntactic dependencies for targeted sentiment classification using graph attention neural network[J]. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 2021, 29: 503-514. 10.1109/taslp.2020.3042009 |
14 | HOCHREITER S, SCHMIDHUBER J. Long short-term memory[J]. Neural Computation, 1997, 9(8): 1735-1780. 10.1162/neco.1997.9.8.1735 |
15 | CHO K, van MERRIËNBOER B, GU̇LÇEHRE Ç, et al. Learning phrase representations using RNN encoder-decoder for statistical machine translation[C]// Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing. Stroudsburg, PA: ACL, 2014: 1724-1734. 10.3115/v1/d14-1179 |
16 | JOZEFOWICZ R, ZAREMBA W, SUTSKEVER I. An empirical exploration of recurrent network architectures [C]// Proceedings of the 32nd International Conference on Machine Learning. New York: JMLR.org, 2015: 2342-2350. |
17 | DOZAT T, MANNING C D. Deep biaffine attention for neural dependency parsing[EB/OL]. (2017-03-10) [2022-06-19].. 10.18653/v1/k17-3002 |
18 | FAN F F, FENG Y S, ZHAO D Y. Multi-grained attention network for aspect-level sentiment classification [C]// Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. Stroudsburg, PA: ACL, 2018: 3433-3442. 10.18653/v1/d18-1380 |
19 | SONG Y W, WANG J H, JIANG T, et al. Attentional encoder network for targeted sentiment classification [EB/OL]. (2019-04-01) [2022-06-19].. 10.1007/978-3-030-30490-4_9 |
20 | JIANG Q N, CHEN L, XU R F, et al. A challenge dataset and effective models for aspect-based sentiment analysis[C]// Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing. Stroudsburg, PA: ACL, 2019: 6280-6285. 10.18653/v1/d19-1654 |
21 | SABOUR S, FROSST N, HINTON G E. Dynamic routing between capsules [C]// Proceedings of the 31st International Conference on Neural Information Processing Systems. Red Hook, NY: Curran Associates Inc., 2017: 3859-3869. |
22 | NGUYEN T H, SHIRAI K. PhraseRNN: phrase recursive neural network for aspect-based sentiment analysis[C]// Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing. Stroudsburg, PA: ACL, 2015: 2509-2514. 10.18653/v1/d15-1298 |
23 | DONG L, WEI F R, TAN C Q, et al. Adaptive recursive neural network for target-dependent Twitter sentiment classification [C]// Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers). Stroudsburg, PA: ACL, 2014: 49-54. 10.3115/v1/p14-2009 |
24 | NGUYEN H T, LE NGUYEN M. Effective attention networks for aspect-level sentiment classification [C]// Proceedings of the 10th International Conference on Knowledge and Systems Engineering. Piscataway: IEEE, 2018: 25-30. 10.1109/kse.2018.8573324 |
25 | SUN K, ZHANG R C, MENSAH S, et al. Aspect-level sentiment analysis via convolution over dependency tree [C]// Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing. Stroudsburg, PA: ACL, 2019: 5679-5688. 10.18653/v1/d19-1569 |
26 | WANG K, SHEN W Z, YANG Y Y, et al. Relational graph attention network for aspect-based sentiment analysis[C]// Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics. Stroudsburg, PA: ACL, 2020: 3229-3238. 10.18653/v1/2020.acl-main.295 |
27 | TIAN Y H, CHEN G M, SONG Y. Aspect-based sentiment analysis with type-aware graph convolutional networks and layer ensemble[C]// Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Stroudsburg, PA: ACL, 2021: 2910-2922. 10.18653/v1/2021.naacl-main.231 |
[1] | 秦璟, 秦志光, 李发礼, 彭悦恒. 基于概率稀疏自注意力神经网络的重性抑郁疾患诊断[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2970-2974. |
[2] | 李力铤, 华蓓, 贺若舟, 徐况. 基于解耦注意力机制的多变量时序预测模型[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2732-2738. |
[3] | 杨航, 李汪根, 张根生, 王志格, 开新. 基于图神经网络的多层信息交互融合算法用于会话推荐[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2719-2725. |
[4] | 杜郁, 朱焱. 构建预训练动态图神经网络预测学术合作行为消失[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2726-2731. |
[5] | 杨兴耀, 陈羽, 于炯, 张祖莲, 陈嘉颖, 王东晓. 结合自我特征和对比学习的推荐模型[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2704-2710. |
[6] | 唐廷杰, 黄佳进, 秦进. 基于图辅助学习的会话推荐[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2711-2718. |
[7] | 赵志强, 马培红, 黑新宏. 基于双重注意力机制的人群计数方法[J]. 《计算机应用》唯一官方网站, 2024, 44(9): 2886-2892. |
[8] | 杨莹, 郝晓燕, 于丹, 马垚, 陈永乐. 面向图神经网络模型提取攻击的图数据生成方法[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2483-2492. |
[9] | 薛凯鹏, 徐涛, 廖春节. 融合自监督和多层交叉注意力的多模态情感分析网络[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2387-2392. |
[10] | 汪雨晴, 朱广丽, 段文杰, 李书羽, 周若彤. 基于交互注意力机制的心理咨询文本情感分类模型[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2393-2399. |
[11] | 高鹏淇, 黄鹤鸣, 樊永红. 融合坐标与多头注意力机制的交互语音情感识别[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2400-2406. |
[12] | 李钟华, 白云起, 王雪津, 黄雷雷, 林初俊, 廖诗宇. 基于图像增强的低照度人脸检测[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2588-2594. |
[13] | 莫尚斌, 王文君, 董凌, 高盛祥, 余正涛. 基于多路信息聚合协同解码的单通道语音增强[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2611-2617. |
[14] | 杨帆, 邹窈, 朱明志, 马振伟, 程大伟, 蒋昌俊. 基于图注意力Transformer神经网络的信用卡欺诈检测模型[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2634-2642. |
[15] | 刘丽, 侯海金, 王安红, 张涛. 基于多尺度注意力的生成式信息隐藏算法[J]. 《计算机应用》唯一官方网站, 2024, 44(7): 2102-2109. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||