Skip to content

Latest commit

 

History

History
82 lines (51 loc) · 3.57 KB

README.md

File metadata and controls

82 lines (51 loc) · 3.57 KB

Semantic Graphs for Generating Deep Questions

This repository contains code and models for the paper: Semantic Graphs for Generating Deep Questions (ACL 2020). Below is the framework of our proposed model (on the right) together with an input example (on the left).

Model Framework

Requirements

Environment

allennlp 0.9.0
overrides 3.1.0
allennlp-models 1.0.0

pytorch 1.4.0
nltk 3.4.4
numpy 1.18.1
tqdm 4.32.2

Data Preprocessing

We release all the datasets below which are processed based on HotpotQA.

  1. get tokenized data files of documents, questions, answers

  2. prepare the json files ready as illustrated in build-semantic-graphs

  3. run scripts/preprocess_data.sh to get the preprocessed data ready for training

    • get results in folder preprocessed-data

    • utilize glove.840B.300d.txt from GloVe to initialize the word-embeddings

Models

We release both classifier and generator models in this work. The models are constructed based on a sequence-to-sequence architecture. Typically, we use GRU and GNN in the encoder and GRU in the decoder, you can choose other methods (e.g. Transformer) which have also been implemented in our repository.

Training

Translating

Evaluating

We take use of the Evaluation codes for MS COCO caption generation for evaluation on automatic metrics.

  • To install pycocoevalcap and the pycocotools dependency, run:
pip install git+https://github.com/salaniz/pycocoevalcap
  • To evaluate the results in the translated file, e.g. prediction.txt, run:
python evaluate_metrics.py prediction.txt

Citation

    @inproceedings{pan-etal-2020-DQG,
      title = {Semantic Graphs for Generating Deep Questions},
      author = {Pan, Liangming and Xie, Yuxi and Feng, Yansong and Chua, Tat-Seng and Kan, Min-Yen},
      booktitle = {Proceedings of Annual Meeting of the Association for Computational Linguistics (ACL)},
      year = {2020}
    }