7AM7 / InferSent

TensorFlow implementation of FAIR's InferSent (Supervised Learning of Universal Sentence Representations from Natural Language Inference Data)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InferSent

A Tensorflow implementation of Alexis Conneau's Supervised Learning of Universal Sentence Representations from Natural Language Inference Data from EMNLP 2017.

Desctription

InferSent is a sentence embeddings method that provides semantic representations for English sentences. It is trained on natural language inference data and generalizes well to many different tasks.

To-do List

  1. Save sentence embeddings permanently.

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.

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

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

python3 Utils.py

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

Training model:

python3 Train.py

About

TensorFlow implementation of FAIR's InferSent (Supervised Learning of Universal Sentence Representations from Natural Language Inference Data)


Languages

Language:Python 100.0%