All Projects → ctr4si → A Hierarchical Latent Structure For Variational Conversation Modeling

ctr4si / A Hierarchical Latent Structure For Variational Conversation Modeling

Licence: mit
PyTorch Implementation of "A Hierarchical Latent Structure for Variational Conversation Modeling" (NAACL 2018 Oral)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to A Hierarchical Latent Structure For Variational Conversation Modeling

Attend infer repeat
A Tensorfflow implementation of Attend, Infer, Repeat
Stars: ✭ 82 (-46.41%)
Mutual labels:  rnn, vae
Vae Seq
Variational Auto-Encoders in a Sequential Setting.
Stars: ✭ 145 (-5.23%)
Mutual labels:  rnn, vae
char-VAE
Inspired by the neural style algorithm in the computer vision field, we propose a high-level language model with the aim of adapting the linguistic style.
Stars: ✭ 18 (-88.24%)
Mutual labels:  rnn, vae
Rnn recsys
Our implementation of the paper "Embedding-based News Recommendation for Millions of Users"
Stars: ✭ 135 (-11.76%)
Mutual labels:  rnn
Tensorflow Mnist Cvae
Tensorflow implementation of conditional variational auto-encoder for MNIST
Stars: ✭ 139 (-9.15%)
Mutual labels:  vae
Skip Thoughts.torch
Porting of Skip-Thoughts pretrained models from Theano to PyTorch & Torch7
Stars: ✭ 146 (-4.58%)
Mutual labels:  rnn
Sylvester Flows
Stars: ✭ 152 (-0.65%)
Mutual labels:  vae
Chatterbot
ChatterBot is a machine learning, conversational dialog engine for creating chat bots
Stars: ✭ 11,813 (+7620.92%)
Mutual labels:  conversation
Rnnoise
Recurrent neural network for audio noise reduction
Stars: ✭ 2,266 (+1381.05%)
Mutual labels:  rnn
Gestureai Coreml Ios
Hand-gesture recognition on iOS app using CoreML
Stars: ✭ 145 (-5.23%)
Mutual labels:  rnn
Awesome Speech Recognition Speech Synthesis Papers
Automatic Speech Recognition (ASR), Speaker Verification, Speech Synthesis, Text-to-Speech (TTS), Language Modelling, Singing Voice Synthesis (SVS), Voice Conversion (VC)
Stars: ✭ 2,085 (+1262.75%)
Mutual labels:  rnn
Rnn poetry generator
基于RNN生成古诗
Stars: ✭ 143 (-6.54%)
Mutual labels:  rnn
Vmf vae nlp
Code for EMNLP18 paper "Spherical Latent Spaces for Stable Variational Autoencoders"
Stars: ✭ 140 (-8.5%)
Mutual labels:  vae
Beat Blender
Blend beats using machine learning to create music in a fun new way.
Stars: ✭ 147 (-3.92%)
Mutual labels:  vae
Qrn
Query-Reduction Networks (QRN)
Stars: ✭ 137 (-10.46%)
Mutual labels:  rnn
Hart
Hierarchical Attentive Recurrent Tracking
Stars: ✭ 149 (-2.61%)
Mutual labels:  rnn
Lstm Crypto Price Prediction
Predicting price trends in cryptomarkets using an lstm-RNN for the use of a trading bot
Stars: ✭ 136 (-11.11%)
Mutual labels:  rnn
Conversation Tensorflow
TensorFlow implementation of Conversation Models
Stars: ✭ 143 (-6.54%)
Mutual labels:  conversation
Pytorch Image Comp Rnn
PyTorch implementation of Full Resolution Image Compression with Recurrent Neural Networks
Stars: ✭ 146 (-4.58%)
Mutual labels:  rnn
Vae Lagging Encoder
PyTorch implementation of "Lagging Inference Networks and Posterior Collapse in Variational Autoencoders" (ICLR 2019)
Stars: ✭ 153 (+0%)
Mutual labels:  vae

Variational Hierarchical Conversation RNN (VHCR)

PyTorch 0.4 Implementation of "A Hierarchical Latent Structure for Variational Conversation Modeling" (NAACL 2018 Oral)

Prerequisite

Install Python packages

pip install -r requirements.txt

Download & Preprocess data

Following scripts will

  1. Create directories ./datasets/cornell/ and ./datasets/ubuntu/ respectively.

  2. Download and preprocess conversation data inside each directory.

for Cornell Movie Dialogue dataset

python cornell_preprocess.py
    --max_sentence_length (maximum number of words in sentence; default: 30)
    --max_conversation_length (maximum turns of utterances in single conversation; default: 10)
    --max_vocab_size (maximum size of word vocabulary; default: 20000)
    --max_vocab_frequency (minimum frequency of word to be included in vocabulary; default: 5)
    --n_workers (number of workers for multiprocessing; default: os.cpu_count())

for Ubuntu Dialog Dataset

python ubuntu_preprocess.py
    --max_sentence_length (maximum number of words in sentence; default: 30)
    --max_conversation_length (maximum turns of utterances in single conversation; default: 10)
    --max_vocab_size (maximum size of word vocabulary; default: 20000)
    --max_vocab_frequency (minimum frequency of word to be included in vocabulary; default: 5)
    --n_workers (number of workers for multiprocessing; default: os.cpu_count())

Training

Go to the model directory and set the save_dir in configs.py (this is where the model checkpoints will be saved)

We provide our implementation of VHCR, as well as our reference implementations for HRED and VHRED.

To run training:

python train.py --data=<data> --model=<model> --batch_size=<batch_size>

For example:

  1. Train HRED on Cornell Movie:
python train.py --data=cornell --model=HRED
  1. Train VHRED with word drop of ratio 0.25 and kl annealing iterations 250000:
python train.py --data=ubuntu --model=VHRED --batch_size=40 --word_drop=0.25 --kl_annealing_iter=250000
  1. Train VHCR with utterance drop of ratio 0.25:
python train.py --data=ubuntu --model=VHCR --batch_size=40 --sentence_drop=0.25 --kl_annealing_iter=250000

By default, it will save a model checkpoint every epoch to <save_dir> and a tensorboard summary. For more arguments and options, see config.py.

Evaluation

To evaluate the word perplexity:

python eval.py --model=<model> --checkpoint=<path_to_your_checkpoint>

For embedding based metrics, you need to download Google News word vectors, unzip it and put it under the datasets folder. Then run:

python eval_embed.py --model=<model> --checkpoint=<path_to_your_checkpoint>

Reference

If you use this code or dataset as part of any published research, please refer the following paper.

@inproceedings{VHCR:2018:NAACL,
    author    = {Yookoon Park and Jaemin Cho and Gunhee Kim},
    title     = "{A Hierarchical Latent Structure for Variational Conversation Modeling}",
    booktitle = {NAACL},
    year      = 2018
    }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].