Codebase for Unsupervised Discrete Sentence Representation Learning for Interpretable Neural Dialog Generation, published as a long paper in ACL 2018. You can find my presentation slides here.
If you use any source codes or datasets included in this toolkit in your work, please cite the following paper. The bibtex are listed below:
@article{zhao2018unsupervised,
title={Unsupervised Discrete Sentence Representation Learning for Interpretable Neural Dialog Generation},
author={Zhao, Tiancheng and Lee, Kyusong and Eskenazi, Maxine},
journal={arXiv preprint arXiv:1804.08069},
year={2018}
}
python 2.7
pytorch >= 0.3.0.post4
numpy
nltk
The data folder contains three datasets:
The first two scripts are sentence models (DI-VAE/DI-VST) that learn discrete sentence representations from either auto-encoding or context-predicting.
The following command will train a DI-VAE on the PTB dataset. To run on different datasets, follows the pattern in PTB dataloader and corpus reader and implement your own data interface.
python ptb-utt.py
The following command will train a DI-VST on the Daily Dialog corpus.
python dailydialog-utt-skip.py
The next two train a latent-action encoder decoder with either DI-VAE or DI-VST.
The following command will first train a DI-VAE on the Stanford multi domain dialog dataset, and then train a hierarchical encoder decoder (HRED) model with the latent code from the DI-VAE.
python stanford-ae.py
The following command will first train a DI-VST on the Stanford multi domain dialog dataset, and then train a hierarchical encoder decoder (HRED) model with the latent code from the DI-VST.
python stanford-skip.py
Generally all the parameters are defined at the top of each script. You can either passed a different value in the command line or change the default value of each parameters. Some key parameters are explained below:
Extra essential parameters for LA-ED or ST-ED:
All trained models and log files are saved to the log folder. To run a existing model, you can: