方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)

the link of paper:《Aspect Level Sentiment Classification with Deep Memory Network》

By :Jasminexjf

Time: 2019-06-24

来源:EMNLP2016
问题:aspect level sentiment classification

参考文章:https://zhuanlan.zhihu.com/p/22841142

 

一、关于aspect level的情感分析

给定一个句子和句子中出现的某个aspect,aspect-level 情感分析的目标是分析出这个句子在给定aspect上的情感倾向。

例如:great food but the service was dreadful! 在aspect “food”上,情感倾向为pos,在aspect “service”上情感倾向为neg。Aspect level的情感分析相对于document level来说粒度更细。

aspect level情感分析相关工作

  1. SemEval-2014 Task 4: Aspect Based Sentiment Analysis
  2. NRC-Canada-2014: Detecting Aspects and Sentiment in Customer Reviews
  3. DCU: Aspect-based Polarity Classification for SemEval Task 4
  4. Adaptive Recursive Neural Network for Target-dependent Twitter Sentiment Classification
  5. Aspect Specific Sentiment Analysis using Hierarchical Deep Learning
  6. PhraseRNN: Phrase Recursive Neural Network for Aspect-based Sentiment Analysis
  7. Effective LSTMs for Target-Dependent Sentiment Classification

1:aspect level情感分析的系统介绍;
2、3:传统分类器方法实现aspect level的情感分析;
4、5、6、7:神经网络方法实现aspect level的情感分析。

分类器方法

将情感分析作为一个文本分类问题,用机器学习的方法训练文本分类器。分类器的性能极大依赖于文本特征 text feature、情感词典 sentiment lexicon等信息。目前效果比较好的是SVM。

神经网络方法

利用神经网络学习低维文本特征,获取文本的语义表示。

神经网络模型的问题

传统的神经网络模型能够捕捉背景信息,但是不能明确的区分对某个aspect的更重要的上下文信息。LSTM通过sequence的方式对所有的context word执行同样的操作,因此不能明确反映出不同context word的重要性。而对于aspect-level的情感分析来说,只有一部分上下文信息对于判定某个特定的aspect的情感倾向是比较重要的。

例:great food but the service was dreadful!

在这个句子里,对于“food”这个aspect来说,要判断它的情感倾向,“great”是一个重要的线索,“dreadful”基本没什么用。同样的对于“service”这个aspect来说,“dreadful”比较重要,“great”就没有什么作用了。

解决这个问题的方法

捕捉不同的context word对于特定aspect的重要性,利用这个信息做句子的语义表示。作者的想法来自于memory network。

 

二、关于memory network

memory network是Jason Weston在14年提出来的想法,Sainbayar Sukhbaatar在15年提出了让memory network进行end to end的训练方法,并在QA上取得了较好的效果。

关于memory network的相关内容可参考下面两篇论文:

  • [Weston et al.2014] MEMORY NETWORKS
  • [Sukhbaatar et al.2015] End-To-End Memory Networks

memory network的总体说明

按照我的理解,memory network就是有一个可以读写的外部memory,模型可以根据memory的内容来确定输出的符号。memory里面存储需要的信息,比如上下文的语义信息,这样可以解决长期大量的记忆问题

 

结构

Memory network包括:一个memory m,四个component I,G,O,R

  • m:一组vector
  •  I:把输入转化成interal feature representation
  • G:根据新的输入更新old memories
  • O:根据当前memory和新的输入得到output representation
  • R:根据output representation得到模型输出


以QA为例说明memory network

输入:一系列sentence:,和question q
task:根据这些sentence得到q的答案

  1. I 每次读一个sentence ,encode得到vector representation;
  2. G 根据当前的sentence representation更新memory;
  3. 所有sentence都处理完得到完整的memory m,存储这些sentence的语义信息;
  4. Encode question q得到;
  5. O 根据从memory m选择related evidence得到一个输出向量o;
  6. R 根据o得到最终的输出。

三、本文的算法架构

            方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)_第1张图片

给定句子s=(w_{1},w_{2},\cdots, w_{i},\cdots,w_{n})和aspect word w_{i}

1、map each word into its embedding vector

这些word vectors包括context vectors和aspect vectors。

aspect vectors:

如果aspect word是单个词,aspect vectors就是aspect word的word embedding;

如果aspect word是多个词组成的,aspect vectors就是几个词的embedding的平均值。

context word vectors:

即sentence中除了aspect word之外的所有词的word embedding堆叠到一起,这就是模型中初始的memory。

2、computational layer

  • 模型包括多个computational layers,每个computational layer包括一个attention layer和一个linear layer。
  • 第一个computational layer,attention layer的输入是非线性化后的aspect vector,输出memory中的比较重要的部分,linear layer的输入是aspect vector。第一个computational layer的attention layer和linear layer的输出结果求和作为下一个computational layer的输入;
  • 其它computational layer执行同样的操作,上一层的输出作为输入,通过attention机制获取memory中较重要的信息,与线性层得到的结果求和作为下一层的输入。
  • 最后一层的输出作为结合aspect信息的sentence representation,作为aspect-level情感分类的特征,作为类别softmax的输入。

3、Attention

包括content attention和location attention两部分。

content attention

一方面,不同context word对于句子的语义表示贡献不一样;

另一方面,不同的context word对于特定aspect的情感倾向的重要性也是不一样的。于是就有了content attention。

输入:external memory m \belong R^{dxk} 和 aspect vector v_{aspect} \belong R^{dx1}
输出:vec \belong R^{dx1}

                        方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)_第2张图片

location attention

我们从直观上来看,通常情况下,与aspect word距离较近的context word对于相应aspect的情感倾向的判断更重要。于是就有了location attention。所谓的location attention其实就是把context word的位置信息加入到memory中。

location of the context word 的定义:absolute distance with the aspect word in the original sentence.

作者定义了四种模型来encode位置信息:

                              方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)_第3张图片

4、分类

  • 最后一层的输出作为特征
  • Softmax
  • 交叉熵

四、实验

1.数据集

                            方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)_第4张图片

2.结果:

                      方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)_第5张图片

从以上结果可以看到memory network的方法在两个数据集上都取得了不错的效果。

3.运行时间对比:

                   方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)_第6张图片

4. 4中不同location attention 结果对比

                                   方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)_第7张图片

根据上图可以看出:

  • 随着computational layers的增多,分类准确率有提升;
  • 在computational layer数大于5的时候,四个模型准确率相差不大;
  • model 2计算量最小,准确率也不差。

5.计算单元层数和location信息的作用分析

  方面级分类paper4:Aspect Level Sentiment Classification with Deep Memory Network(2016EMNLP)_第8张图片

从Table 4和Table 5可以看出:

  • 增加computational layer可以提取更abstractive的evidence(针对某个特定的aspect),更好的区分不同context word对特定aspect的贡献;
  • 引入location信息明可以更好地捕获针对特定aspect更重要的context信息。

五、总结

1、作者将memory network的思想用在aspect-level的情感分析上,通过上下文信息构建memory,通过attention捕获对于判断不同aspect的情感倾向较重要的信息,在实验数据集上取得了较好的结果。和RNN、LSTM等神经网络模型相比,本文提出的模型更简单计算更快。

2、将content信息和location信息结合起来学习context weight是一种比较适合aspect-level的情感分析的方法,对模型性能有较大提升。

3、多层计算单元可以学到更多更abstractive的信息,可以提升模型性能。

你可能感兴趣的:(aspect-level,sentiment,classif)