A pytorch implementation of Reading Wikipedia to Answer Open-Domain Questions.
A pytorch implementation of Reading Wikipedia to Answer Open-Domain Questions.
A pytorch implementation of the ACL 2017 paper Reading Wikipedia to Answer Open-Domain Questions (DrQA).
Reading comprehension is a task to produce an answer when given a question and one or more pieces of evidence (usually natural language paragraphs). Compared to question answering over knowledge bases, reading comprehension models are more flexible and have revealed a great potential for zero-shot learning.
SQuAD is a reading comprehension benchmark where there's only a single piece of evidence and the answer is guaranteed to be a part of the evidence. Since the publication of SQuAD dataset, there has been fast progress in the research of reading comprehension and a bunch of great models have come out. DrQA is one that is conceptually simpler than most others but still yields strong performance even as a single model.
The motivation for this project is to offer a clean version of DrQA for the machine reading comprehension task, so one can quickly do some modifications and try out new ideas. Click here to see the comparison with what's described in the original paper and with two "official" projects ParlAI and DrQA.
git clone https://github.com/hitvoice/DrQA.git; cd DrQApip install -r requirements.txtbash download.sh.# prepare the data
python prepro.py
# train for 40 epochs with batchsize 32
python train.py -e 40 -bs 32Warning: Running prepro.py takes about 9G memory when using 8 threads. If there's not enough memory on your machine, try reducing the number of threads used by the script, for example,
python prepro.py --threads 2
python interact.pyExample interactions:
…The last example is a randomly picked product description from Amazon (not in SQuAD).
| EM | F1 | |
|---|---|---|
| in the original paper | 69.5 | 78.8 |
| in this project | 69.64 | 78.76 |
| offical(Spacy) | 69.71 | 78.94 |
| offical(CoreNLP) | 69.76 | 79.09 |
Compared with the official implementation:
Compared to what's described in the original paper:
Compared to the code in facebookresearch/DrQA:
Compared to the code in facebookresearch/ParlAI:
Maintainer: Runqi Yang.
Credits: thank Jun Yang for code review and advice.
Most of the pytorch model code is borrowed from Facebook/ParlAI under a BSD-3 license.
No open issues yet, or sync has not completed.