Aspect Based Sentiment Analysis with Gated Convolutional Networks
这是ACL2018上的一篇长文。
属性级情感分析
相比于预测句子整体上的情感倾向,属性级情感分析(aspect-based sentiment analysis, ABSA)更具有研究价值。关于如何给定aspect信息,ABSA可以分为两种:
- aspect-category sentiment analysis(ACSA),即一个句子的aspect属于预先定义的若干类别中的一个。
- aspect-term sentiment analysis(ATSA),即一个句子的aspect是句子中出现的一个词或多个词。
如句子“Average to good Thai food, but terrible delivery”,ATSA会问句子对“thai food”和“delivery”的情感,ACSA会问句子在“taste”和“service”上的情感。
现存的模型大都使用LSTM+Attention结构,但是LSTM和Attention都很耗费时间。而CNN并行性很好,更快。因此,文章在CNN的基础上加上了门机制,以融合aspect信息。
Gated CNN
如下图所示,gated CNN的结构非常简单。通过嵌入层获得词向量之后,卷积层通过不同的卷积核大小捕捉句子的n-gram特征。常规的textCNN是直接经过激活函数后接一个pooling层,而gated CNN接了一个门机制以保留那些与aspect有关的信息。
具体来说,记卷积层的一个输出为
aspect embedding
aspect embedding如何得到,对于ACSA,由于预定义的类别都是单词,比如“food, price, service, ambience, and misc”,可以直接使用这些单词的词向量。而ATSA中给定的aspect有时会是一个短语,如“thai food”,那么可以通过一个简单的卷积+pooling得到,如下图
实验及结果
由于没有使用LSTM和Attention,此模型的运行速度非常不错。如下图,其中ATAE是指Attention-based aspect embedding[1],IAN是指interactive attention network[2],RAM是指Recurrent attention network on memory[3],TD-LSTM是指Target-dependent LSTM[4],GCAE就是本文中的Gated CNN with aspect embedding。
分类准确率就略微高过其他深度学习模型。其中Hard test中的数据,是那些包含多个aspect但这些aspect上情感倾向不同的句子。作者认为Hard test上的实验结果更有价值。
参考
- ^Wang Y, Huang M, Zhao L. Attention-based LSTM for aspect-level sentiment classification[C]//Proceedings of the 2016 conference on empirical methods in natural language processing. 2016: 606-615.
- ^Ma D, Li S, Zhang X, et al. Interactive attention networks for aspect-level sentiment classification[C]//Proceedings of the 26th International Joint Conference on Artificial Intelligence. AAAI Press, 2017: 4068-4074.
- ^Chen P, Sun Z, Bing L, et al. Recurrent attention network on memory for aspect sentiment analysis[C]//Proceedings of the 2017 conference on empirical methods in natural language processing. 2017: 452-461.
- ^Tang D, Qin B, Feng X, et al. Effective LSTMs for Target-Dependent Sentiment Classification[C]//Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers. 2016: 3298-3307.