Aspect Level Sentiment Classification with Deep Memory Network笔记

来源:互联网 发布:软件license管理器 编辑:程序博客网 时间:2024/06/05 18:52

论文: Aspect Level Sentiment Classification with Deep Memory Network
代码:https://github.com/ganeshjawahar/mem_absa

这篇文章主要针对aspect level sentiment analysis. 借鉴了MemN2N,在Sem-Eval的laptop和restaurant两种数据上,跑出的结果与基于SVM的模型差不多的结果,LSTM和attention-based LSTM效果要好。

给定一个句子s={w1,w2,...,wn}, aspect word wi. 首先将context words 用embedding matrix 表示成词向量{e1,e2,...,en}, 将aspect word wi表示成vaspect, 作者使用了location attention:定义vj表示word wj在句子中距离aspect word的距离。 作者考虑了四种location attention 方式,最后实验结果表明Model2更好:mi=eivi, 其中vi=1li/nli是单词wi的位置。

每一个hop的计算方式如下:

gi=tanh(Watt[mi;vaspect]+batt)

αi=softmax(gi)

vec=i=1kmiαi

这里写图片描述
在MemN2N中队context用了两个不同的embedding matrix, 这里同样可以使用两个,一个用来计算αi, 另一个用来与αi作attention.

最后的结果如下图:
这里写图片描述

阅读全文
0 0
原创粉丝点击