项目作者: HsiaoYetGun

项目描述 :
TensorFlow implementation of the ESIM model (Enhanced LTSM for natural language inference)
高级语言: Python
项目地址: git://github.com/HsiaoYetGun/ESIM.git
创建时间: 2018-07-26T15:59:18Z
项目社区:https://github.com/HsiaoYetGun/ESIM

开源协议:

下载


Notice

There are some problems with this version code (the mask of attention weight [Model.py, line 160-170] and the mask of mean and max [Model.py, line 220-225]), please don’t use this code directly!

I’m too busy recently to follow this repo, and I will update this code in my winter vacation (starting from the 26th, Jan).

ESIM

A Tensorflow implementation of Chen-Qian’s Enhanced LSTM for Natural Language Inference from ACL 2017.

Dataset

The dataset used for this task is Stanford Natural Language Inference (SNLI). Pretrained GloVe embeddings obtained from common crawl with 840B tokens used for words.

Requirements

  • Python>=3
  • NumPy
  • TensorFlow>=1.8

Usage

Download dataset from Stanford Natural Language Inference, then move snli_1.0_train.jsonl, snli_1.0_dev.jsonl, snli_1.0_test.jsonl into ./SNLI/raw data.

  1. # move dataset to the right place
  2. mkdir -p ./SNLI/raw\ data
  3. mv snli_1.0_*.jsonl ./SNLI/raw\ data

Data preprocessing for convert source data into an easy-to-use format.

  1. python3 Utils.py

Default hyper-parameters have been stored in config file in the path of ./config/config.yaml.

Training model:

  1. python3 Train.py

Test model:

  1. python3 Test.py