文章目录
模型介绍
Hybrid Neural Inference Models
![](https://img-blog.csdnimg.cn/2019040817384079.png)
可以用BiLSTM编码, 也可以使用Tree-LSTM.
这里只介绍基于BiLSTM的结构.
1. Input Encoding
![](https://img-blog.csdnimg.cn/20190408174228539.png)
输入两句话分别接embeding + BiLSTM
2. Local Inference Modeling
就是一个计算attention的过程
Locality of inference
首先计算两个句子 word 之间的相似度,得到2维的相似度矩阵.
![](https://img-blog.csdnimg.cn/20190408174833659.png)
Local inference collected over sequences
利用前面的词相似矩阵, 进行两句话的 local inference. 用之前得到的相似度矩阵,结合 a,b 两句话,互相生成彼此相似性加权后的句子.attention的常规操作,公式如下
![](https://img-blog.csdnimg.cn/20190408175357894.png)
Enhancement of local inference information
利用减法和element-wise product计算 < a ˉ , a ~ > <\bar a, \tilde a>