Skip to content
/ KEIM Public

Code for the paper Natural Language Inference Enhanced by Knowledge Graph Embedding (KEIM)

Notifications You must be signed in to change notification settings

qikunxun/KEIM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Natural Language Inference Enhanced by Knowledge Graph Embedding (KEIM)

Dependencies

To run it perfectly, you will need (recommend using Anaconda to set up environment):

  • Python 3.5 or 3.6
  • Tensorflow 1.10.0
  • Java >= 1.6

1. Download and preprocess

cd data_process

Download the data and the resources for preprocess:

  • SNLI dataset
  • MultiNLI dataset
  • SciTail dataset
  • GloVe embedding (300D)
  • Wordnet 3.0
  • CoreNLP
python download.py

Preprocess for SNLI dataset

python preprocess_data_snli.py

Preprocess for MultiNLI dataset

python preprocess_data_multinli.py

Preprocess for SciTail dataset

python process_data_scitail.py

2. Train KEIM

Hyper-parameters are set in configure file in ./config/xxx.sample.config

Training process for SNLI dataset

cd src
python Main.py --config_path ../configs/snli.sample.config

Training process for MultiNLI dataset

python Main.py --config_path ../configs/multinli.sample.config

Training process for SciTail dataset

python Main.py --config_path ../configs/scitail.sample.config

The model and results are saved in $model_dir$.

3. Evaluation

cd src
python Evaluation.py --model_prefix your_model --in_path The path to the test file.

About

Code for the paper Natural Language Inference Enhanced by Knowledge Graph Embedding (KEIM)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published