Aspect-level sentiment analysis aims to analyze the corresponding sentimental polarity of different aspects in long sentences. Currently, newer neural network models primarily concentrate on the impact of aspect term extraction on sentiment prediction but overlook real text defects such as ambiguity and lack of textual information. This oversight leads to inadequate exploration of the complementarity between external knowledge and aspect term information, leaving room for further optimization of model performance. To solve this problem, this paper proposes a method based on knowledge enhancement and a multi-layer attention mechanism. The model stores text representation and auxiliary information through a bi-directional long short-term memory network, obtains syntax information using a graph convolutional network, and extracts categorical representation of aspect terms by knowledge enhancement. This means a multi-layer attention mechanism is introduced to input the fused features into the global average pooling layer to improve accuracy. On the SemEval task and Twitter dataset, the proposed model outperforms the baseline and achieves good experimental results.
方面级情感分析的方面词提取和情感分类能力已经表现不错,但在现实中,一方面文本冗长,导致方面词需要关联的上下文处于较远位置;另一方面文本的用词偏生活化,文本出现歧义、生僻等现象后,方面词无法利用全文信息找到对应的情感信息。于是,方面词归类子任务的重要性逐渐显现。例如,“Food was good, but for the price here, four raviolis doesn’t cut it as an entre.”这一例句中谈及了三个方面,它们分别是:food、price和raviolis。简单地,food的情感极性是积极的,但price的情感极性则需要借助文本距离较长的后半句来辅助判断;文本后半句的ravioli则较为生僻,在以往工作中不易被归为方面词,导致所有方面的情感分类准确率降低。
图卷积神经网络在句法依存树的基础上沿依赖路径(即连接两个词语在依赖关系上的路径,反映了句法关系的远近)将邻居节点信息聚合到目标节点,从而捕捉输入句子的句法特征,以“Food was good, but for the price here, four raviolis doesn’t cut it as an entre.”为例,构造句子中的依存关系树,如图2所示。
为了更准确地对方面词进行归类,引入了知识图谱WordNet2作为外部知识库,它根据词汇的矩阵进行组织,包含超过110 000个词形和语义对,并使用同义词集表示单词概念。概念之间有名词、动词、形容词、副词、虚词五个大类,在各词性中关系各不同,例如名词中常用关系:上位关系、内含关系、同义关系、反义关系等。WordNet通过上位词及同义词理解单词,重新关联方面词与对应形容词、副词,解决了在以往的方法中生僻方面词由于无法被归类导致其情感极性无法判断的问题。例如文本“Food was good, but for the price here, four raviolis doesn't cut it as an entre.”中的“ravioli”是“pasta”的下位词,它与“pastry”“food”等方面词直接相关,WordNet即可判断 “n't cut”在此语境知识下是消极倾向的。
其中,为上下文文本信息特征,为上一层得到的方面词及相关词的归类表示。这两者的融合,保证了原文本的部分有效信息不会被遗漏。进行平均池化得到。以“Food was good, but for the price here, four raviolis doesn’t cut it as an entre.”为例,结果为“Food was good, food’ price n’t cut as an entre.”,即为多层注意力机制的处理结果,文本特征将更关注方面词的归类抽象表示和相关形容的归类表示,输出到情感分类层。
TRISNAK W, JIEH J. Deep learning approach for aspect-based sentiment classification: A comparative review[J]. Applied Artificial Intelligence, 2022, 36(1): 1-37. DOI: 10.1080/08839514.2021.2014186 .
[4]
KIMY. Convolutional neural networks for sentence classification[C]//Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP). Stroudsburg: Association for Computational Linguistics, 2014: 1746-1751. DOI: 10.3115/v1/d14-1181 .
[5]
TANGD, QINB, FENGX, et al. Effective LSTMs for target-dependent sentiment classification[DB/OL].[2023-09-10].
[6]
WANGY Q, HUANGM L, ZHUX 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: Association for Computational Linguistics, 2016: 606-615. DOI: 10.18653/v1/d16-1058 .
[7]
MAD H, LIS J, ZHANGX D, et al. Interactive attention networks for aspect-level sentiment classification[DB/OL].[2023-09-10]. DOI: 10.24963/ijcai.2017/568 .
[8]
CHENP, SUNZ Q, BINGL D, et al. Recurrent attention network on memory for aspect sentiment analysis[DB/OL].[2023-09-10]. DOI: 10.18653/v1/d17-1047 .
[9]
HUM T, ZHAOS W, ZHANGL, et al. CAN: Constrained attention networks for multi-aspect sentiment analysis[DB/OL].[2023-09-10].DOI: 10.18653/v1/d19-1467 .
[10]
DINGX W, LIUB, YUP S. A holistic lexicon-based approach to opinion mining[DB/OL].[2023-09-10]. DOI: 10.1145/1341531.1341561 .
[11]
MILLERG A. WordNet: A lexical database for English [J]. Communications of the ACM, 1995, 38(11): 39-41. DOI: 10.1145/219717.219748 .
[12]
KIRITCHENKOS, ZHUX D, CHERRYC, et al. NRC-Canada-2014: Detecting aspects and sentiment in customer reviews[C]//Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014). Stroudsburg: Association for Computational Linguistics, 2014: 437-442. DOI: 10.3115/v1/s14-2076 .
[13]
ZHUX D, SOBHANIP, GUOH Y. Long short-term memory over recursive structures[DB/OL].[2023-09-10]. DOI: 10.18653/v1/n16-1106 .
[14]
SUNK, ZHANGR C, MENSAHS, et al. Aspect-level sentiment analysis via convolution over dependency tree[DB/OL].[2023-09-10]. DOI: 10.18653/v1/d19-1569 .
[15]
ZHANGC, LIQ C, SONGD W. Aspect-based sentiment classification with aspect-specific graph convolutional networks[DB/OL].[2032-09-10]. DOI: 10.18653/v1/d19-1464 .
[16]
CHENY Q, SKIENAS. Building sentiment lexicons for all major languages[DB/OL].[2023-09-10]. DOI: 10.3115/v1/p14-2063 .
[17]
ZHUX D, GUOH Y, MOHAMMADS, et al. An empirical study on the effect of negation words on sentiment[DB/OL].[2023-09-10]. DOI: 10.3115/v1/p14-1029 .
[18]
WANGF X, ZHANGZ H, LANM. ECNU at SemEval-2016 task 7: An enhanced supervised learning method for lexicon sentiment intensity ranking[DB/OL].[2023-09-10]. DOI: 10.18653/v1/s16-1080 .
[19]
LINY K, LIUZ Y, SUNM S, et al. Learning entity and relation embeddings for knowledge graph completion[DB/OL].[2023-09-10]. DOI: 10.1609/aaai.v29i1.9491 .
[20]
TENGZ Y, VOD T, ZHANGY. Context-sensitive lexicon features for neural sentiment analysis[C]//Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing. Stroudsburg: Association for Computational Linguistics, 2016: 1629-1638. DOI: 10.18653/v1/d16-1169 .
LIH H, XUEY, ZHAOH Y, et al. Co-attention networks for aspect-level sentiment analysis[C]//CCF International Conference on Natural Language Processing and Chinese Computing. Cham: Springer, 2019: 200-209. DOI:10.1007/978-3-030-32236-6_17 .
[23]
FENGA, ZHANGX L, SONGX Y. Unrestricted attention may not be all you need⁃masked attention mechanism focuses better on relevant parts in aspect-based sentiment analysis[J]. IEEE Access, 2022, 10: 8518-8528. DOI: 10.1109/ACCESS.2022.3142178 .
PONTIKIM, GALANISD, PAVLOPOULOSJ, et al. SemEval-2014 task 4: Aspect based sentiment analysis[C]//Proceedings of the 8th International Workshop on Semantic Evaluation (SemEval 2014). Stroudsburg: Association for Computational Linguistics, 2014: 27-35. DOI: 10.3115/v1/s14-2004 .
[26]
DONGL, WEIF R, TANC Q, et al. Adaptive recursive neural network for target-dependent twitter sentiment classification[DB/OL]. [2023-09-10]. DOI: 10.3115/v1/p14-2009 .
[27]
ZHOUJ, HUANGJ X, HUQ V, et al. SK-GCN: Modeling syntax and knowledge via graph convolutional network for aspect-level sentiment classification[J]. Knowledge-Based Systems, 2020, 205: 106292. DOI: 10.1016/j.knosys.2020.106292 .
[28]
ZHAOM, YANGJ, ZHANGJ P, et al. Aggregated graph convolutional networks for aspect-based sentiment classification[J]. Information Sciences, 2022, 600: 73-93. DOI: 10.1016/j.ins.2022.03.082 .