Prompting approaches have been recently explored in text style transfer, where a textual prompt is used to query a pretrained language model to generate style-transferred texts word by word in an autoregressive manner. However, such a generation process is less controllable and early prediction errors may affect future word predictions. In this paper, we present a prompt-based editing approach for text style transfer. Specifically, we prompt a pretrained language model for style classification and use the classification probability to compute a style score. Then, we perform discrete search with word-level editing to maximize a comprehensive scoring function for the style-transfer task. In this way, we transform a prompt-based generation problem into a classification one, which is a training-free process and more controllable than the autoregressive generation of sentences. In our experiments, we performed both automatic and human evaluation on three style-transfer benchmark datasets, and show that our approach largely outperforms the state-of-the-art systems that have 20 times more parameters. Additional empirical analyses further demonstrate the effectiveness of our approach.
翻译:提示方法近期在文本风格迁移任务中得到探索,通过文本提示以自回归方式逐词查询预训练语言模型生成风格迁移后的文本。然而,这种生成过程可控性较低,且早期预测误差可能影响后续词语预测。本文提出一种基于提示的文本风格迁移编辑方法:具体而言,我们利用预训练语言模型进行风格分类,并使用分类概率计算风格分数;随后通过词级编辑进行离散搜索,以最大化针对风格迁移任务的综合评分函数。通过这种方式,我们将基于提示的生成问题转化为分类问题,该过程无需训练且比自回归句子生成更具可控性。在实验中,我们在三个风格迁移基准数据集上进行了自动评估和人工评估,结果表明本方法显著优于参数规模大20倍的最先进系统。进一步的实证分析也证明了本方法的有效性。