《Attention-based LSTM for Aspect-level Sentiment Classification 》笔记

1、问题的提出:the sentiment polarity of a sentence is highly dependent on both content and aspect. For example, the sentiment polarity of “Staffs are not that friendly, but the taste covers all.” will be positive if the aspect is food but negative when considering the aspect service.

介绍两个概念:

Aspect-level sentiment classification :给定一个句子和句子中出现的某个Aspect,Aspect-level的目标是分析出这个句子在给定Aspect上的情感倾向。aspect-level的情感分析相对document level来说粒度更细。

Attention-based(注意力机制):最早是在计算机视觉图像领域提出来的,思想是人们在进行观察图像的时候,并不是一次就把整幅图像的每个位置像素都看过,大多树会根据自己的需要,将注意力集中到图像的特定部分。在本文中,作者说,The attention mechanism can concentrate on different parts of a sentence when different aspects are taken as input.

2、主要贡献:

We propose attention-based Long Short-Term memory for aspect-level sentiment classification. The models are able to attend different parts of a sentence when different aspects are concerned. Results show that the attention mechanism is effective.(提出了基于注意力机制的长短期记忆网络,用于方面级别的情感分类。当涉及不同的方面时,这个模型能够注意到句子的不同部分)

Since aspect plays a key role in this task, we propose two ways to take into account aspect information during attention: one way is to concatenate the aspect vector into the sentence hidden representations for computing attention weights, and another way is to additionally append the aspect vector into the input word vectors.(提出两种方法加入aspect信息:一种是在隐藏层加,另一种是在输入层加)

3、在本文中作者主要提出了三种模型:LSTM with Aspect Embedding(AE-LSTM)、Attention-based LSTM(AT-LSTM)、Attention-based LSTM with Aspect Embedding(ATAE-LSTM )


AT-LSTM

α是注意力权重向量,r是具有给定方面的句子的加权表示。Va 是aspect embedding (方面的词向量)。

最终句子的表示是:

     hN是隐藏层的最后一层。h ∗ is considered as the feature representation of a sentence given an input aspect.

然后作者添加了一个linear layer 将句子向量转为向量e,e的长度与最终分类的类别数目相等。然后输入到softmax层。softmax层的作用是求出属于每个类别的的概率。

ATAE-LSTM

4、本文的优化目标是交叉熵,学习方法是随机梯度下降,词向量是用Twitter数据经GloVe预训练的。

数据集:We experiment on the dataset of SemEval 2014 Task4 ,The dataset consists of customers reviews.

任务定义:

任务1,Aspect-level Classification:Given a set of preidentified aspects, this task is to determine the polarity of each aspect.(指定一组aspect,确定每个aspect上面的情感极性)

任务2,Aspect-Term-level Classification :For a given set of aspects term within a sentence, this task is to determine whether the polarity of each aspect term is positive, negative or neutral.

结果:

任务1


任务2 数据:餐厅数据

5、说明

数据格式:

任务1的aspect 指的是aspectCategory,任务2的aspect指的是aspectTerm。

论文作者在写这边文章的时候主要和Tang etal ..,2015a这篇文章做了比较。Tang的文章采用LSTM解决一个句子针对Target情感分类问题。此时的Target指的是aspectTerm

注意力机制,作者使用可视化工具可视化了α,结果如下所示;


6、参考文献

Attention-based LSTM for Aspect-level Sentiment Classification 作者Yequan Wang and Minlie Huang and Li Zhao* and Xiaoyan Zhu

西土城的搬砖日常

注意力机制在自然语言处理中的应用

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 把自己灌醉 像一具腐尸 浓度的酒精 嗜血的蚂蚁 在周身攀爬 给自己写首墓志铭 刻进不朽的骨头 易腐的躯体 不朽的傲...
    日斜寒林阅读 385评论 5 3
  • 大家好!我是宋晓霞,来自美丽的滨州,三年的时间,我慢慢地喜欢上了这里,宽阔的马路,,惊讶的普禾吧,心灵成长的平安果...
    安安木棉阅读 229评论 0 0
  • 小青并不是一条蛇,也不是白素贞的妹妹,它是一只青蛙,爱唱歌,男。 小青生来就住在一所大宅子的一口大池塘里,直至死去...
    阅_阅读 790评论 0 0
  • 今天使我印象最深刻的就是我们的主持人小燕子。她不仅阳光还给我们带来很多正能量。小白龙老师又为我们分享几种裂变的好方...
    佳妮520阅读 190评论 0 0
  • 室友仔仔是广东人,在无数次吐槽江苏的梅雨季,怀念湛江的蓝天大海之后说,去我家吧,包吃包住还带你玩,我说好,于是就定...
    清洺阅读 496评论 3 7