QAnetEstimator is an implementation of Google's QANet using TensorFlow's estimator API. It has been proven to have excellent performance.
QAnetEstimator is a TensorFlow implementation of Google's QANet, inspired by the work done by nlplearn . While some implementation details were taken from their work, this version is a complete rewrite using TensorFlow's estimator API, dataset API, and layers API. These APIs make the code more concise and clear.
Furthermore, additional processing has been done on padding to ensure that the padding data does not affect the normal input data in the neural network. This has resulted in higher F1 and EM scores compared to nlplearn's version.
- Python>=3.5
- TensorFlow>=1.10
I use a parameter to switch models (there is a bidaf flow model inside)
--procedure "wordembedding","QAnetEmbedding","dcn","QaModelBlock","QAOutput"
using this procedure, a qanet is built.
add elmo to replace embedding layer
The dataset used for this task is Stanford Question Answering Dataset I did not use it directly, but copy my network to nlplearn's qanet, you can see the replacement in my fork version ,and the comparison of result is shown below
nlplearn's em
nlplearn's f1
my version's em
my version's f1