Skip to content

Latest commit

 

History

History
 
 

README.md

Globally Normalized Reader

This model implements the work in the following paper:

Jonathan Raiman and John Miller. Globally Normalized Reader. Empirical Methods in Natural Language Processing (EMNLP), 2017.

If you use the dataset/code in your research, please cite the above paper:

@inproceedings{raiman2015gnr,
    author={Raiman, Jonathan and Miller, John},
    booktitle={Empirical Methods in Natural Language Processing (EMNLP)},
    title={Globally Normalized Reader},
    year={2017},
}

You can also visit https://github.com/baidu-research/GloballyNormalizedReader to get more information.

Installation

  1. Please use docker image to install the latest PaddlePaddle, by running:
    docker pull paddledev/paddle
  2. Download all necessary data by running:
    cd data && ./download.sh && cd ..
  3. Preprocess and featurizer data:
    python featurize.py --datadir data --outdir data/featurized  --glove-path data/glove.840B.300d.txt

Training a Model

  • Configurate the model by modifying config.py if needed, and then run:

    python train.py 2>&1 | tee train.log

Inferring by a Trained Model

  • Infer by a trained model by running:
    python infer.py \
      --model_path models/pass_00000.tar.gz \
      --data_dir data/featurized/ \
      --batch_size 2 \
      --use_gpu 0 \
      --trainer_count 1 \
      2>&1 | tee infer.log