Tagging Without Rewriting: A Probabilistic Model for Unpaired Sentiment and Style Transfer (2022)

Abstract: Style transfer is the task of paraphrasing text into a target-style domain while retaining the content. Unsupervised approaches mainly focus on training a generator to rewrite input sentences. In this work, we assume that text styles are determined by only a small proportion of words; therefore, rewriting sentences via generative models may be unnecessary. As an alternative, we consider style transfer as a sequence tagging task. Specifically, we use edit operations (i.e., deletion, insertion and substitution) to tag words in an input sentence. We train a classifier and a language model to score tagged sequences and build a conditional random field. Finally, the optimal path in the conditional random field is used as the output. The results of experiments comparing models indicate that our proposed model exceeds end-to-end baselines in terms of accuracy on both sentiment and style transfer tasks with comparable or better content preservation.

## introduction text style refers to the attributes of text written in a particular form. style transfer is the task of paraphrasing text into a target-style domain while retaining its content. in the domain of natural language generation, research on style transfer tasks @xcite allows us to control the attributes of produced utterances. recently, sentiment transfer @xcite has attracted much attention as a subtask of style transfer, an example being 'the food here is delicious' (positive) → 'the food here is gross' (negative). a styleindicative word is a word with a large contribution to style @xcite ). in the above example, 'delicious' and 'gross' are style-indicative words. a critical problem in sentiment transfer is the lack of available parallel data @xcite . as a result, related work has mainly focused on unsupervised learning. among unsupervised approaches, those based on word modification have achieved state-of-the-art performance due to their ability to retain content words. this paper mainly focuses on sentiment transfer and follows two generative models: the tag model @xcite and lewis model @xcite . the tag model calculates term frequency-inverse document frequency scores to identify style-indicative words and trains an autoregressive model to substitute those words. the lewis model removes style-indicative words to extract a content template and trains a generator to perform edit operations on the template. however, the aforementioned methods have the following drawbacks: to address the above-mentioned drawbacks, we propose the following: in this paper, we first introduce our tagging strategy and a method we employed to implement edit operations ( § 3.1). further, we introduce feature functions of the crf ( § 3.2) and search strategies used ( § 3.3). we tested our model for transfer accuracy and content preservation on four data sets ( § 4) and analysed the experimental results of the automated evaluation ( § 5.1) and the experimental results of the manual evaluation ( § 5.2). in additional analysis ( § 5.3), we discussed the variances of sentence features in transformation. 1 our contributions are as follows: to the best of our knowledge, this study is the first to apply crfs to style transfer tasks. ## methodology instead of training an end-to-end model, we perform a search over small edits to an input sentence, as it provides an interpretable record of the decisions the model made. ## case study to further demonstrate the superiority of our model, we randomly sampled some positive and negative sentences from the outputs of our model and baselines for comparison, as shown in for the human reference outputs, although the hired workers were not asked to make minimal changes to change the sentiment of input sentences, we noticed that overlaps are commonly between inputs and human references. in other words, people naturally tend to retain content words from an input sentence when rewriting it. an interesting thing is that, for the amazon data set, comments with 1 or 2 stars are considered to be negative and comments with 4 or 5 stars are considered to be positive. however, looking at the data, not all low scoring reviews contain only negative sentiment, while not all high scoring reviews contain only positive sentiment. furthermore, the human reference of the amazon data set is not always effective. for example, a negative reference sentence "because it might not be worth full price ." is labelled as positive. cases of mislabeling may be the reason why the models did not perform well on the amazon data set. yelp positive to negative negative to positive input it is a cool place , with lots to see and try . unfortunately , it is the worst . human nothing to see there , not a nice place . fortunately , it is the best . tag it is a shame , not to see and try . great food , great service and the staff is friendly . dgst it is a sad place , with lots to see and try . overall , it is the best . dirr it is a cold place , with no to see and try . fortunately , it is the best . lewis it is a very busy place , with lots to see and try . cajun food , it is the best ! ours + gs it is a place , with nothing to see and try . seriously , it is the best . ours + vs it is a mess , with nothing to see and try . seriously , it is the best . amazon positive to negative negative to positive input for my purpose this is the perfect item . because it is definitely not worth full price . human for my purpose this is the worst item. because it might not be worth full price . tag for my purpose this is the worst item . because it is definitely not worth full price . dgst for my purpose this is the perfect item . because it is definitely not worth full price . dirr for my purpose this is the same thing . because it is definitely worth full price . lewis for my purpose this is the best game ever made . because it is definitely well made and worth full price . ours + gs for my purpose this is the item . because it is definitely well worth full price . ours + vs for my purpose this is the worst item . because it is definitely well worth full price . imdb positive to negative negative to positive input i rate this movie 8/10 . please , do n't see this movie . stytrans i rate this movie 4/10 . please , do also see this movie . dgst i rate this movie 1/10 u , do n't see this " dirr i rate this movie 1/10 . please , see this movie . ours + gs i rate this movie 1/10 . please , do n ' t miss this movie today . ours + vs i rate this movie 1/10 . please , do n ' t miss this movie . for the method based on transformation in latent space (i.e., dgst), it always copies sentences without transferring them into correct style domains. for this same reason, the dgst model obtained high bleu values on all of the used data sets. for the method based on the modification of words (i.e., tag and lewis), they will retain the majority of input words. however, recognition of style-indicative words may result that part of styleindicative words are retained and content words are deleted, that is, examples listed in ## conclusion in this study, we proposed a probabilistic model for sentiment and style transfer on non-parallel data. we used a classifier and an lm to construct a crf. using dynamic programming search algorithms, we generated a tag sequence to modify the input sentences. the experimental results revealed that our proposed model outperformed the baselines in terms of accuracy by approximately 2%. our future work will focus on the simplification of the search process. by using the policy gradient @xcite of reinforcement learning, we might be able to speed up the transfer model.