Code & data accompanying the IJCAI 2020 paper "GRAPHFLOW: Exploiting Conversation Flow with Graph Neural Networks for Conversational Machine Comprehension"
This code is written in python 3. You will need to install a few python packages in order to run the code.
We recommend you to use virtualenv
to manage your python packages and environments.
Please take the following steps to create a python virtual environment.
- If you have not installed
virtualenv
, install it withpip install virtualenv
. - Create a virtual environment with
virtualenv venv
. - Activate the virtual environment with
source venv/bin/activate
. - Install the package requirements with
pip install -r requirements.txt
.
-
Download the preprocessed data from here and put the data folder under the root directory. (Note: if you cannot access the above data, please download from here.)
-
Run the model
python main.py -config config/graphflow_dynamic_graph_coqa.yml
-
Download the raw data
sh download.sh
-
Run the stanford-core-nlp script
check out https://stanfordnlp.github.io/CoreNLP/corenlp-server.html
-
Run the preprocessing script
python coqa_scripts/preprocess.py -d path_to_input_data -o path_to_output_data
-
Annotate the data if you want to have the input passage represented as graph-structured data
python annotate_graphs.py -i path_to_input_data -o path_to_output_data
If you found this code useful, please consider citing the following paper:
Yu Chen, Lingfei Wu, Mohammed J. Zaki. "Graphflow: Exploiting Conversation Flow with Graph Neural Networks for Conversational Machine Comprehension." In Proceedings of the 29th International Joint Conference on Artificial Intelligence (IJCAI 2020), Yokohama, Japan, Jul 11-17, 2020.
@article{chen2019graphflow,
title={Graphflow: Exploiting conversation flow with graph neural networks for conversational machine comprehension},
author={Chen, Yu and Wu, Lingfei and Zaki, Mohammed J},
journal={arXiv preprint arXiv:1908.00059},
year={2019}
}