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.
翻译:提示方法最近在文本风格迁移任务中得到探索,该方法通过文本提示以自回归方式逐词查询预训练语言模型生成风格迁移后的文本。然而,这种生成过程可控性较低,且早期预测错误可能影响后续词汇预测。本文提出一种基于提示的编辑方法用于文本风格迁移。具体而言,我们通过提示预训练语言模型进行风格分类,并利用分类概率计算风格得分。随后,我们采用基于词级编辑的离散搜索方法,以最大化针对风格迁移任务的综合评分函数。通过这种方式,我们将基于提示的生成问题转化为分类问题,该过程无需训练且比句子自回归生成更具可控性。实验环节,我们在三个风格迁移基准数据集上进行了自动评估和人工评估,结果表明我们的方法在参数量仅为最优系统二十分之一的情况下仍显著超越其性能。进一步的实证分析也验证了本方法的有效性。