SpaceFusion is a regularized multi-task learning paradigm proposed to align and structure the unstructured latent spaces learned by different models trained over different datasets. Of particular interest is its application to neural conversation modelling, where SpaceFusion is used to jointly optimize the relevance and diversity of generated responses.
- The slides presented at NAACL-HLT 2019 is available.
- We published a blog to discuss the intuition and implication
- A Keras implementation is provided
the code is tested using Python 3.6 and Keras 2.2.4
- Reddit data is downloaded from a third party. However, as we don't own the data, we cannot release it here. But this script can be used to process the raw data.
- Switchboard data is downloaded from this repo
- We provided a toy dataset in this repo for debugging.
Tokenization functions and other preprocessing tools can be found here.
- To train a SpaceFusion model:
python src/main.py mtask train --data_name=toy
- To visualize the learned latent space:
python src/vis.py --data_name=toy
- To interact with the trained model:
python src/main.py interact_rand --data_name=toy
main.py
is the main filemodel.py
defines the SpaceFusion model (seeclass MTask
) and some baselinesvis.py
defines the function we used to visulize and analysis the latent spacedataset.py
defines the data feedershared.py
defines the default hyperparameters
Please cite our NAACL paper if this repo inspired your work :)
@article{gao2019spacefusion,
title={Jointly Optimizing Diversity and Relevance in Neural Response Generation},
author={Gao, Xiang and Lee, Sungjin and Zhang, Yizhe and Brockett, Chris and Galley, Michel and Gao, Jianfeng and Dolan, Bill},
journal={NAACL-HLT 2019},
year={2019}
}