Delete, Retrieve, Generate: A Simple Approach to Sentiment and Style Transfer
Juncen Li 1 Robin Jia2 He He2 Percy Liang2 1 WeChat Search Application Department, Tencent 2 Computer Science Department, Stanford University Work done while the author was a visiting researcher at Stanford University.
Abstract
We consider the task of text attribute transfer: transforming a sentence to alter a specific attribute (e.g., sentiment) while preserving its attribute-independent content (e.g., changing “screen is just the right size” to “screen is too small”). Our training data includes only sentences labeled with their attribute (e.g., positive or negative), but not pairs of sentences that differ only in their attributes, so we must learn to disentangle attributes from attribute-independent content in an unsupervised way. Previous work using adversarial methods has struggled to produce high-quality outputs. In this paper, we propose simpler methods motivated by the observation that text attributes are often marked by distinctive phrases (e.g., “too small”). Our strongest method extracts content words by deleting phrases associated with the sentence’s original attribute value, retrieves new phrases associated with the target attribute, and uses a neural model to fluently combine these into a final output. On human evaluation, our best method generates grammatical and appropriate responses on $22\%$ more inputs than the best previous system, averaged over three attribute transfer datasets: alteri
中文速览
改变一句话的情感或风格(如把"屏幕大小刚好"改成"屏幕太小了"),同时保留其他内容不变,是文本属性迁移(text attribute transfer)任务的核心挑战,而此前基于对抗网络的方法效果并不理想。本文提出了一种更简单直接的思路:句子中只有少数几个词或短语真正携带属性信息(如情感词),只要精准删掉这些"属性标记词"、保留其余内容,再从目标属性的语料库中检索合适的替换短语,最后用神经网络解码器把两者流畅拼合,就能完成属性迁移。在Yelp评论、Amazon评论和图像描述三个数据集上,人工评估显示,最佳神经模型(DeleteAndRetrieve)平均有34%的输出在语法、内容和属性三方面均达标,远超此前最好对抗方法的12%,连最简单的规则基线都以23%的成功率超越了对抗方法。这项工作表明,针对任务特性设计简洁的结构归纳偏置,往往比引入复杂对抗训练更有效,也为可控文本生成提供了切实可用的参考方案。
原文 arXiv:1804.06437;中英对照 + 大白话阅读 https://aha.fim.ai/paper/1804.06437v1