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.
- Host: GitHub
- URL: https://github.com/p-baleine/qanet-tensorflow
- Owner: p-baleine
- Created: 2018-04-30T07:42:31.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-19T00:11:25.000Z (almost 8 years ago)
- Last Synced: 2024-10-18T20:49:41.005Z (over 1 year ago)
- Topics: keras, nlp, squad, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 1.73 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.org
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