项目作者: seanie12

项目描述 :
Pytorch implementation of Paragraph-level Neural Question Generation with Maxout Pointer and Gated Self-attention Networks
高级语言: Python
项目地址: git://github.com/seanie12/neural-question-generation.git
创建时间: 2019-04-05T05:19:25Z
项目社区:https://github.com/seanie12/neural-question-generation

开源协议:MIT License

下载


Neural Question Generation

This is not official implementation for the paper Paragraph-level Neural Question Generation with Maxout Pointer and Gated Self-attention Networks.
I implemented in Pytorch to reproduce similar result as the paper. You can find the checkpoint of pretrained model here.

Dependencies

This code is written in Python. Dependencies include

Download data and Preprocess

  1. mkdir squad
  2. wget http://nlp.stanford.edu/data/glove.840B.300d.zip -O ./data/glove.840B.300d.zip
  3. unzip ./data/glove.840B.300d.zip
  4. wget https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v1.1.json -O ./squad/train-v1.1.json
  5. wget https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v1.1.json -O ./squad/dev-v1.1.json
  6. cd data
  7. python process_data.py

Configuration

You might need to change configuration in config.py.

If you want to train, change train = True and set the gpu device in config.py

Evaluation from this repository

  1. cd qgevalcap
  2. python2 eval.py --out_file prediction_file --src_file src_file --tgt_file target_file

Results

BLEU_1
BLEU_2
BLEU_3
BLEU_4
45.22
29.94
22.01
16.76