End-to-end hard constrained text generation via incrementally predicting segments

Jinran Nie,Xuancheng Huang,Yang Liu,Cunliang Kong,Xin Liu,Liner Yang,Erhong Yang
DOI: https://doi.org/10.1016/j.knosys.2023.110886
IF: 8.139
2023-08-11
Knowledge-Based Systems
Abstract:Hard-constrained text generation is an important task that requires generating fluent sentences to include several specific keywords. It has numerous real-world applications, such as advertisement generation, keyword-based summary generation, and query rewriting. Although previous plug-and-play approaches like enhanced beam search and stochastic search have been proven effective, they lack time efficiency and may reduce the quality of generated sentences. While end-to-end methods based on seq2seq models are superior in speed, they cannot guarantee that outputs satisfy all constraints. In this work, we propose a novel end-to-end method for lexically constrained text generation via incrementally predicting segments (IPS) between every two adjacent lexical constraints using seq2seq models. Our approach guarantees that all constrained keywords will be included in the generated sentence. The experimental results show that our method not only satisfies all lexical constraints but also achieves state-of-the-art performance. Our code and data will be available at https://github.com/blcuicall/IPS .
computer science, artificial intelligence
What problem does this paper attempt to address?