Skip to content
Implementation of <Learning to Ask: Neural Question Generation for Reading Comprehension> by Xinya Du et al.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data/xinyadu_data Add data and code May 15, 2018
.gitignore Add data and code May 15, 2018
README.md
enc_and_dec.py Fix bugs related to beamsearch Apr 8, 2019
main.py Fix bugs related to beamsearch Apr 8, 2019
model.py Fix bugs related to beamsearch Apr 8, 2019
params.py Beamsearch available Mar 27, 2019
process_data.py Fix bug in process_data.py Mar 29, 2019
process_embedding.py Modification to process_embedding.py and run.sh Mar 27, 2019
run.sh
utils.py Add function: check bleu score during evaluation Mar 29, 2019

README.md

neural_question_generation

Implemenration of <Learning to Ask: Neural Question Generation for Reading Comprehension> by Xinya Du et al.

The source code still needs to be modified

  1. Model
  • Embedding

    • Pretrained GloVe embeddings
    • Randomly initialized embeddings
  • RNN-based seq2seq

    • GRU/LSTM
  • To be updated

    • Post-processing code for unknown words
  1. Dataset

processed data provided by Xinya Du et al.

Requirements

  • python 2.7
  • numpy
  • Tensorflow 1.4

Usage

  1. Data preprocessing
mkdir data/processed
python process_data.py
  1. Download & process GloVe
wget http://nlp.stanford.edu/data/glove.840B.300d.zip -P data/
unzip data/glove.840B.300d.zip -d data/
python process_embedding.py # This will take a couple of minutes
  1. Train model
# data_name : dataset name which is defined in run.sh
# hyperparameters : hyperparameters setting which is defined in params.py
# epochs: training epochs

bash run.sh train [data_name] [hyperparameters] [epochs]
# example : bash run.sh train squad basic_params 10
  1. Test model
mkdir result # only for the first time, predicted result will be saved here
bash run.sh pred [data_name] [hyperparameters] 0 
# example : bash run.sh pred squad basic_params 0 
You can’t perform that action at this time.