Git Product home page Git Product logo

vae-question-generation's Introduction

Variational Attention for Sequence to Sequence Models

This is the official codebase for the following paper, implemented in tensorflow:

Hareesh Bahuleyan*, Lili Mou*, Olga Vechtomova, and Pascal Poupart. Variational Attention for Sequence-to-Sequence Models. COLING 2018. https://arxiv.org/pdf/1712.08207.pdf

Overview

This package consists of 3 models, each of which have been organized into separate folders:

  1. Deterministic encoder-decoder with deterministic attention (ded_detAttn)
  2. Variational encoder-decoder with deterministic attention (ved_detAttn)
  3. Variational encoder-decoder with variational attention (ved_varAttn)

Datasets

The proposed model and baselines have been evaluated on two experiments:

  1. Neural Question Generation with the SQuAD dataset
  2. Conversation Systems with the Cornell Movie Dialogue dataset

The data has been preprocessed and the train-val-test split is provided in the data/ directory.

Requirements

  • tensorflow-gpu==1.3.0
  • Keras==2.0. 8
  • numpy==1.12.1
  • pandas==0.22.0
  • gensim==3.1.2
  • nltk==3.4.5
  • tqdm==4.19.1

Instructions

  1. Generate word2vec, required for initializing word embeddings, specifying the dataset:
python w2v_generator.py --dataset qgen 
  1. Train the desired model, set configurations in the model_config.py file. For example,
cd ved_varAttn
vim model_config.py # Make necessary edits
python train.py
  • The model checkpoints are stored in models/ directory, the summaries for Tensorboard are stored in summary_logs/ directory. As training progresses, the metrics on the validation set are dumped intolog.txt and bleu/ directory.
  1. Evaluate performance of the trained model. Refer to predict.ipynb to load desired checkpoint, calculate performance metrics (BLEU and diversity score) on the test set, and generate sample outputs.

Citation

If you found this code useful in your research, please cite:

@inproceedings{varAttn2018,
  title={Variational Attention for Sequence-to-Sequence Models},
  author={Bahuleyan, Hareesh and Mou, Lili and Vechtomova, Olga and Poupart, Pascal},
  booktitle={Proceedings of the 27th International Conference on Computational Linguistics (COLING)},
  year={2018}
}

vae-question-generation's People

Contributors

hareeshbahuleyan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.