笔记:Position-aware Attention and Supervised Data Improve Slot Filling
Position-aware Attention and Supervised Data Improve Slot Filling
作者:Yuhao Zhang et al., EMNLP 2017.
简介
模型很简单就是postion-aware attention over LSTM。
有两个点挺有意思的一个是position-aware的attention的设计,另一个是实验中的entity masking的使用。
下图为position-aware 简化,编码用的lstm。
具体位置的计算如下公式:
以subject 实体为例,s=subject,\(p_i^s\)表示当前位置i的词距离subject实体距离,之后根据position embedding matrix(随机初始化的)查表得到position embedding。
得分\(u_i\)使用位置\(p_i^s,p_i^o\)以及\(q=h_n\)与每个hidden state \(h_j\)计算得到,这里加了个lstm最后的输出\(h_n\)为了加入整个句子的语义信息吧,\(\mathbf{z}\)就是attention聚合后的句子的表示。
实验中还用了个Entity masking,把原始句子中每个subject实体用特殊符号\(
其他的没细看,感兴趣的可以看看原文。
参考
【1】Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, Christopher D. Manning.Position-aware Attention and Supervised Data Improve Slot Filling.EMNLP 2017.