ActiveQA: Active Question Answering
This repo contains code for our paper Ask the Right Questions: Active Question Reformulation with Reinforcement Learning.
Small forewarning, this is still much more of a research codebase than a library. No support is provided.
If you use this code for your research, please cite the paper.
Introduction
ActiveQA is an agent that transforms questions online in order to find the best answers. The agent consists of a Tensorflow model that reformulates questions and an Answer Selection model. It interacts with an environment that contains a question-answering system. The agent queries the environment with variants of a question and calculates a score for the answer against the original question. The model is trained end-to-end using reinforcement learning.
This version addresses the SearchQA question-answering task, and the environment consists of the Bi-directional Attention Flow (BiDAF) model of Seo et al. (2017).
Setup
Dependencies
We require tensorflow and many other supporting libraries. Tensorflow should be installed separately following the docs. To install the other dependencies use
pip install -r requirements.txt
Note: We only ran this code with Python 2, so Python 3 is not officially supported.
Data
Download the source dataset from SearchQA, GloVe, and NLTK corpus and save them in $HOME/data.
export DATA_DIR=$HOME/data
mkdir $DATA_DIR
Download
Download the SearchQA dataset (~600 MB) for training, testing, and validation here: https://drive.google.com/open?id=1OxRhw81g7amW3aBd_iu2By5THysgr2uv
<Download the dataset to $DATA_DIR/SearchQA.zip>
unzip $DATA_DIR/SearchQA.zip -d $DATA_DIR
Download GloVe (~850 MB):