Skip to content

Latest commit

 

History

History
 
 

KVMemNN

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Requirements

  • python3
  • pytorch>=1.2.0
  • nltk

How to run

  1. Download GloVe 300d vectors, unzip it to get the file glove.840B.300d.txt, and then convert it to a pickle file for faster loading:
python -m utils.pickle_glove --input <path/of/glove.840B.300d.txt> --output <path/of/glove/pt>

This step can be skipped if you have obtained the glove pickle file in other models. 2. Preprocess the training data

python -m KVMemNN.preprocess --input_dir ./dataset --output_dir <dir/of/processed/files>
  1. Train
python -m KVMemNN.train --input_dir <dir/of/processed/files> --save_dir <dir/of/checkpoint> --glove_pt <path/of/glove/pt>
  1. Predict answers of the test set. It will produce a file named predict.txt in the --save_dir, storing the predictions of test questions in order.
python -m KVMemNN.predict --input_dir <dir/of/processed/files> --save_dir <dir/of/checkpoint>