NeuralDialog LaRL
PyTorch implementation of latent space reinforcement learning for E2E dialog published at NAACL 2019. It is released by Tiancheng Zhao (Tony) from Dialog Research Center, LTI, CMU
Install / Use
npx skills add snakeztc/NeuralDialog-LaRLInstalls into whichever agent you are using.
README
Rethinking Action Spaces for Reinforcement Learning in End-to-end Dialog Agents with Latent Variable Models
Codebase for Rethinking Action Spaces for Reinforcement Learning in End-to-end Dialog Agents with Latent Variable Models, published as a long paper in NAACL 2019 with oral presentation.
<p align="center"> <img width="700" src="laRL-h.png"> </p>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{zhao2019rethinking,
title={Rethinking Action Spaces for Reinforcement Learning in End-to-end Dialog Agents with Latent Variable Models},
author={Zhao, Tiancheng and Xie, Kaige and Eskenazi, Maxine},
journal={arXiv preprint arXiv:1902.08858},
year={2019}
}
Requirements
python 3
pytorch == 0.4.0
numpy
Data
The data are in folder data. For DealOrNoDeal dataset, the files are in data/negotiate. For MultiWoz dataset, the processed version is a zip file (norm-multi-woz.zip). Please unzip it before run any experiments for MultiWoz.
Over structure:
The source code is under latent_dialog. The experiment script is under folders:
- experiments_deal: scripts for studies on DealOrNoDeal
- experiments_woz: scripts for studies on MultiWoz
For both datasets, the scripts follow the same structure: (1) first using supervised learning to create pre-train models. (2) use policy gradient reinforcement learning to fine tune the pretrain model via reinforcement learning.
Besides that, the other folders contains:
- FB: the original facebook implementation from Lewis et al 2017. We the pre-trained judge model
to score our DealOrNoDeal conversations.
- latent_dialog: source code
Step 1: Supervised Learning
- sl_word: train a standard encoder decoder model using supervised learning (SL)
- sl_cat: train a latent action model with categorical latetn varaibles using SL.
- sl_gauss: train a latent action model with gaussian latent varaibles using SL.
Step 2: Reinforcement Learning
Set the system model folder path in the script:
folder = '2019-04-15-12-43-05-sl_cat'
epoch_id = '8'
And then set the user model folder path in the script
sim_epoch_id = '5'
simulator_folder = '2019-04-15-12-43-38-sl_word' # set to the log folder of the user model
Each script is used for:
- reinforce_word: fine tune a pretrained model with word-level policy gradient (PG)
- reinforce_cat: fine tune a pretrained categorical latent action model with latent-level PG.
- reinforce_gauss: fine tune a pretrained gaussian latent action model with latent-level PG.
Related Skills
mcp
Use the `mcp_perplexity-ask_perplexity_search` tools to answer questions. You should use this instead of the `web_search` tool because it is a lot more accurate.
practical-power-systems-synthesis
This skill enables synthesis in the domain of power-systems (engineering). It represents research-level-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform synthesis operations related to power-systems.
semi-supervised-optogenetics-testing
This skill enables testing in the domain of optogenetics (neuroscience). It represents intermediate-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform testing operations related to optogenetics.
data-mining-interpretation-fundamental
This skill enables interpretation in the domain of data-mining (data-science). It represents fundamental-level expertise and is designed for production use in research, industry, and educational contexts. Use this skill when you need to perform interpretation operations related to data-mining.
