snakeztc / NeuralDialog-ZSDG

PyTorch codebase for zero-shot dialog generation SIGDIAL 2018, It is released by Tiancheng Zhao (Tony) from Dialog Research Center, LTI, CMU
https://www.cs.cmu.edu/~tianchez
Apache License 2.0
133 stars 27 forks source link
dialog domain-adaptation end-to-end-machine-learning neural-dialogue-agents sigdial-2018 zero-shot-learning

Zero-shot Dialog Generation (ZSDG) for End-to-end Neural Dialog Models

Codebase for Zero-Shot Dialog Generation with Cross-Domain Latent Actions, published as a long paper in SIGDIAL 2018. Reference information is in the end of this page. Presentation slides can be found here.

This work won the best paper award at SIGDIAL 2018.

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{zhao2018zero,
  title={Zero-Shot Dialog Generation with Cross-Domain Latent Actions},
  author={Zhao, Tiancheng and Eskenazi, Maxine},
  journal={arXiv preprint arXiv:1805.04803},
  year={2018}
}

Requirements

python 2.7
pytorch >= 0.3.0.post4
numpy
nltk

Datasets

The data folder contains three datasets:

Getting Started

The following scripts implement 4 different models, including:

Training

Run the following to experiment on the SimDial dataset

python simdial-zsdg.py

Run the following to experiment on the Stanford Multi-Domain Dataset

python stanford-zsdg.py

Switching Model

The hyperparameters are exactly the same for the above two scripts. To train different models, use the following configurations. The following examples are for simdial-zsdg.py, which also apply to stanford-zsdg.py.

For baseline model with attetnion decoder:

python simdial-zsdg.py --action_match False --use_ptr False

For baseline model with pointer-sentinel mixture decoder:

python simdial-zsdg.py --action_match False --use_ptr True    

For action matching model with attetnion decoder:

python simdial-zsdg.py --action_match True --use_ptr False

For action matching model with attetnion decoder:

python simdial-zsdg.py --action_match True --use_ptr True    

Hyperparameters

The following are some of key hyperparameters:

Test a existing model

All trained models and log files are saved to the log folder. To run a existing model, you can: