CGMH: Constrained Sentence Generation by Metropolis-Hastings Sampling
Abstract
In real-world applications of natural language generation, there are often constraints on the target sentences in addition to fluency and naturalness requirements. Existing language generation techniques are usually based on recurrent neural networks (RNNs). However, it is non-trivial to impose constraints on RNNs while maintaining generation quality, since RNNs generate sentences sequentially (or with beam search) from the first word to the last. In this paper, we propose CGMH, a novel approach using Metropolis-Hastings sampling for constrained sentence generation. CGMH allows complicated constraints such as the occurrence of multiple keywords in the target sentences, which cannot be handled in traditional RNN-based approaches. Moreover, CGMH works in the inference stage, and does not require parallel corpora for training. We evaluate our method on a variety of tasks, including keywords-to-sentence generation, unsupervised sentence paraphrasing, and unsupervised sentence error correction. CGMH achieves high performance compared with previous supervised methods for sentence generation. Our code is released at https://github.com/NingMiao/CGMH
Cite
Text
Miao et al. "CGMH: Constrained Sentence Generation by Metropolis-Hastings Sampling." AAAI Conference on Artificial Intelligence, 2019. doi:10.1609/AAAI.V33I01.33016834Markdown
[Miao et al. "CGMH: Constrained Sentence Generation by Metropolis-Hastings Sampling." AAAI Conference on Artificial Intelligence, 2019.](https://mlanthology.org/aaai/2019/miao2019aaai-cgmh/) doi:10.1609/AAAI.V33I01.33016834BibTeX
@inproceedings{miao2019aaai-cgmh,
title = {{CGMH: Constrained Sentence Generation by Metropolis-Hastings Sampling}},
author = {Miao, Ning and Zhou, Hao and Mou, Lili and Yan, Rui and Li, Lei},
booktitle = {AAAI Conference on Artificial Intelligence},
year = {2019},
pages = {6834-6842},
doi = {10.1609/AAAI.V33I01.33016834},
url = {https://mlanthology.org/aaai/2019/miao2019aaai-cgmh/}
}