论文笔记&翻译——Enhanced LSTM for Natural Language Inference(ESIM)

时间:2022-07-24
本文章向大家介绍论文笔记&翻译——Enhanced LSTM for Natural Language Inference(ESIM),主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

0.前言

在Query 扩召回项目中,通过各种手段挖掘出一批同义词,想对其进行流程化,所以考虑加上语义推断,在同事的推荐下使用了 ESIM 模型,据了解这个模型在近两年横扫了好多比赛,算是 NLI (Natural Language Inference) 领域未来几年一个很难绕过的超强 baseline 了,单模型的效果可以达到 88.0% 的 Acc。

ESIM模型出自 Qian Chen 等人发表在 ACL2017 上的 Enhanced LSTM for Natural Language Inference

顾名思义,一种专为自然语言推断而生的加强版 LSTM,从文中得出主要改进在于

Unlike the previous top models that use very complicated network architectures, we first demonstrate that carefully designing sequential inference models based on chain LSTMs can outperform all previous models. Based on this, we further show that by explicitly considering recursive architectures in both local inference modeling and inference composition, we achieve additional improvement.

总结一下主要是:

  1. 精细的设计序列式的推断结构。
  2. 考虑局部推断和全局推断。

接下来看看模型结构

1. 模型结构

文中给出的模型结构如下:

ESIM主要分为三部分:input encodinglocal inference modelinginference composition。如上图所示,ESIM 是左边一部分。

1.1 input encoding

1.3 inference composition

2. 模型实现

模型核心代码见Python实战——ESIM 模型搭建(keras版)