An open API service indexing awesome lists of open source software.

https://github.com/p-baleine/qanet-tensorflow

An implementation of QANet with Tensorflow and Keras.
https://github.com/p-baleine/qanet-tensorflow

keras nlp squad tensorflow

Last synced: about 2 months ago
JSON representation

An implementation of QANet with Tensorflow and Keras.

Awesome Lists containing this project

README

          

#+TITLE: QANet-Tensorflow

An implementation of [[https://arxiv.org/abs/1804.09541][QANet]] with [[https://www.tensorflow.org/][Tensorflow]] and [[https://keras.io/][Keras]].

This implementation reaches EM/F1 = 66/77 in 50k steps. (The original paper reaches EM/F1 = 73.6/82.7 in 150k steps. I think there is still room for improvement.)

** Requirements

- Docker
- [[https://github.com/NVIDIA/nvidia-docker][nvidia-docker]]

** Usage

*** Build container

First, clone this repository.

#+BEGIN_SRC bash
git clone https://github.com/p-baleine/keras-QANet.git
#+END_SRC

Then build the docker image.

#+BEGIN_SRC bash
docker build -t qanet .
#+END_SRC

The following instructions assume that you've logged in to this container. To log in to this continer, run:

#+BEGIN_SRC bash
docker run --runtime nvidia --rm --name qanet -it -v $(pwd):/qanet -p 6006:6006 -p 8888:8888 qanet
#+END_SRC

*** Download data

**** Glove

Download and save [[https://www.kaggle.com/thanakomsn/glove6b300dtxt/version/1#_=_:][pre-trained Glove data]] in word2vec directory.

**** SQuAD

Download and save train-v1.1.json and dev-1.1.json in data directory from [[https://rajpurkar.github.io/SQuAD-explorer/][SQuAD]].

*** Preprocessing data

To preprocess data, run:

#+BEGIN_SRC bash
make
#+END_SRC

*** Training

#+BEGIN_SRC bash
make train
#+END_SRC

*** Evaluation

=evaluation= target will calcurate exact-match score on =data/dev-v1.1.json=.

#+BEGIN_SRC bash
make evaluate
#+END_SRC