Theano implementation of Deep LSTM Reader & Attentive Reader from Google DeepMind's paper Teaching Machines to Read and Comprehend - Hermann et al. (2015).
- Python 2.7
- Numpy
- Theano
- scikit-learn (for computing F1 score)
I am using processed RC datasets from this repository. The original datasets can be downloaded from https://github.com/deepmind/rc-data or https://cs.nyu.edu/~kcho/DMQA/. Processed ones are just simply concatenation of all data instances and keeping document, question and answer only.
Note: story & question are alias for document & query respectively.
python data.py
train.py
provides an easy interface to train deep/attentive reader, model/*_reader.py
contains the actual code for model definition and training. Please note that call to train_*(..)
using use_existing_model=True
will replace the current existing best model with the new best model, so save your intermediate models accordingly.
eval.py
provide interface to compute various performance params (accuracy, f1-score) for trained models.
python eval.py
Use ask.py
to let the model infer from your stories and questions.
python ask.py
This code uses portion of Data reading interface written by Danqi Chen.