A Tensorflow Implementation of R-net: Machine reading comprehension with self matching networks.


  • Python2.7
  • NumPy
  • tqdm
  • spacy
  • TensorFlow==1.2

Downloads and Setup

Once you clone this repo, run the following lines from bash just once to process the dataset (SQuAD).

$ pipenv install
$ bash setup.sh
$ pipenv shell
$ python process.py --reduce_glove True --process True

Training / Testing / Debugging / Interactive Demo

You can change the hyperparameters from params.py file to fit the model in your GPU. To train the model, run the following line.

$ python model.py

To test or debug your model after training, change mode="train" to debug or test from params.py file and run the model.

To use demo, put batch size = 1


Run tensorboard for visualisation.

$ tensorboard --logdir=r-net:train/