M ULTIPLE -A TTRIBUTE T EXT R EWRITING
A BSTRACT
The dominant approach to unsupervised “style transfer” in text is based on the idea of learning a latent representation, which is independent of the attributes specifying its “style”.
In this paper, we show that this condition is not necessary and is not always met in practice, even with domain adversarial training that explicitly aims at learning such disentangled representations.
We thus propose a new model that controls several factors of variation in textual data where this condition on disentanglement is replaced with a simpler mechanism based on back-translation.
Our method allows control over multiple attributes, like gender, sentiment, product type, etc., and a more ﬁne-grained control on the trade-off between content preservation and change of style with a pooling operator in the latent space.
Our experiments demonstrate that the fully entangled model produces better generations, even when tested on new and more challenging benchmarks comprising reviews with multiple sentences and multiple attributes.
I NTRODUCTION
One of the objectives of unsupervised learning is to learn representations of data that enable ﬁne control over the underlying latent factors of variation, e.g., pose and viewpoint of objects in images, or writer style and sentiment of a product review.
In conditional generative modeling, these latent factors are given (Sohn et al., 2015; Mirza & Osindero, 2014; Ficler & Goldberg, 2017), or automatically inferred via observation of samples from the data distribution (Chen et al., 2017; 2016;
Higgins et al., 2017).
More recently, several studies have focused on learning unsupervised mappings between two data domains such as images (Taigman et al., 2016; Isola et al., 2017; Zhu et al., 2017), words or sentences from different languages (Conneau et al., 2017; Lample et al., 2018).
In this problem setting, the generative model is conditioned not only on the desired attribute values, but also on a initial input, which it must transform.
Generations should retain as many of the original input characteristics as possible, provided the attribute constraint is not violated.
This learning task is typically unsupervised because no example of an input and its corresponding output with the speciﬁed attribute is available during training.
The model only sees random examples and their attribute values.
The dominant approach to learn such a mapping in text is via an explicit constraint on disentanglement (Hu et al., 2017; Fu et al., 2017;
Shen et al., 2017): the learned representation should be invariant to the speciﬁed attribute, and retain only attribute-agnostic information about the “content”.
Changing the style of an input at test time then amounts to generating an output based on the disentangled latent representation computed from the input and the desired attributes.
Disentanglement is often achieved through an adversarial term in the training objective that aims at making the attribute value unrecoverable from the latent representation.
This paper aims to extend previous studies on “style transfer” along three axes.
(i)
First, we seek to gain a better understanding of what is necessary to make things work, and in particular, whether [Table] disentanglement is key, or even actually achieved by an adversarial loss in practice.
In Sec.
3.1 we provide strong empirical evidence that disentanglement is not necessary to enable control over the factors of variation, and that even a method using adversarial loss to disentangle (Fu et al., 2017) does not actually learn representations that are disentangled.
(ii) Second, we introduce a model which replaces the adversarial term with a back-translation (Sennrich et al., 2015a) objective which exposes the model to a pseudo-supervised setting, where the model’s outputs act as supervised training data for the ultimate task at hand.
The resulting model is similar to recently proposed methods for unsupervised machine translation (Lample et al., 2017a; 2018; Artetxe et al., 2018;
Zhang et al., 2018b), but with two major differences: (a) we use a pooling operator which is used to control the trade-off between style transfer and content preservation; and (b) we extend this model to support multiple attribute control.
(iii) Finally, in Sec.
4.1 we point out that current style transfer benchmarks based on collections of user reviews have severe limitations, as they only consider a single attribute control (sentiment), and very small sentences in isolation with noisy labels.
To address this issue, we propose a new set of benchmarks based on existing review datasets, which comprise full reviews, where multiple attributes are extracted from each review.
The contributions of this paper are thus: (1) a deeper understanding of the necessary components of style transfer through extensive experiments, resulting in (2) a generic and simple learning framework based on mixing a denoising auto-encoding loss with an online back-translation technique and a novel neural architecture combining a pooling operator and support for multiple attributes, and (3) a new, more challenging and realistic version of existing benchmarks which uses full reviews and multiple attributes per review, as well as a comparison of our approach w.r.t.
baselines using both new metrics and human evaluations.
We will open-source our code and release the new benchmark datasets used in this work, as well as our pre-trained classiﬁers and language models for reproducibility.
This will also enable fair empirical comparisons on automatic evaluation metrics in future work on this problem.
R ELATED W ORK
There is substantial literature on the task of unsupervised image translation.
While initial approaches required supervised data of the form (input, transformation, output) , e.g., different images of the same object rendered with different viewpoints or/and different lighting conditions (Hinton et al., 2011; Yang et al., 2015; Kulkarni et al., 2015), current techniques are capable of learning completely unsupervised domain mappings.
Given images from two different domains X and Y (where X could be the domain of paintings and Y the domain of realistic photographs), and the task is to learn two mappings F : X → Y and G : Y → X , without supervision, i.e., just based on images sampled from the two domains (Liu & Tuzel, 2016; Taigman et al., 2016; Isola et al., 2017).
For instance,
Zhu et al.
(2017) used a cycle consistency loss to enforce F ( G ( y ))
≈ y and G ( F ( x ))
≈ x .
This loss is minimized along with an adversarial loss on the generated outputs to constrain the model to generate realistic images.
In Fader Networks (Lample et al., 2017b), a discriminator is applied on the latent representation of an image autoencoder to remove the information about speciﬁc attributes.
The attribute values are instead given explicitly to the decoder at training time, and can be tuned at inference to generate different realistic versions of an input image with varying attribute values.
Different approaches have been proposed for textual data, mainly aiming at controlling the writing style of sentences.
Unfortunately, datasets of parallel sentences written in a different style are hard to come by.
Carlson et al.
(2017) collected a dataset of 33 English versions of the Bible written in different styles on which they trained a supervised style transfer model.
Li et al.
(2018) released a small crowdsourced subset of 1,000 Yelp reviews for evaluation purposes, where the sentiment had been swapped (between positive and negative ) while preserving the content.
Controlled text generation from unsupervised data is thus the focus of more and more research.
An theme that is common to most recent studies is that style transfer can be achieved by disentangling sentence representations in a shared latent space.
Most solutions use an adversarial approach to learn latent representations agnostic to the style of input sentences (Fu et al., 2017;
Hu et al., 2017; Shen et al., 2017; Zhang et al., 2018a;
Xu et al., 2018; John et al., 2018; Zhao et al., 2018).
A decoder is then fed with the latent representation along with attribute labels to generate a variation of the input sentence with different attributes.
Unfortunately, the discrete nature of the sentence generation process makes it difﬁcult to apply to text techniques such as cycle consistency or adversarial training.
For instance, the latter (Shen et al., 2017; dos Santos et al., 2018; Zhang et al., 2018c) requires methods such as REINFORCE (He et al., 2016) or approximating the output softmax layer with a tunable temperature (Hu et al., 2017;
Prabhumoye et al., 2018; Yang et al., 2018), all of which tend to be slow, unstable and hard to tune in practice.
Moreover, all these studies control a single attribute (e.g. swapping positive and negative sentiment).
The most relevant work to ours is Zhang et al.
(2018b), which also builds on recent advances in unsupervised machine translation.
Their approach ﬁrst consists of learning cross-domain word embeddings in order to build an initial phrase-table.
They use this phrase-table to bootstrap an iterative back-translation pipeline containing both phrase-based and neural machine translation systems.
Overall, their approach is signiﬁcantly more complicated than ours, which is end-to-end and does not require any pre-training.
Moreover, this iterative back-translation approach has been shown to be less effective than on-the-ﬂy back-translation which is end-to-end trainable (Lample et al., 2018).
C ONTROLLABLE T EXT R EWRITING
This section brieﬂy introduces notation, the task, and our empirical procedure for evaluating disentanglement before presenting our approach.
We consider a training set D
=
( x i , y i ) i ∈ [1 ,n ] of n sentences x i ∈ X paired with attribute values y i .
y ∈ Y is a set of m attribute values y
=
( y 1 , ..., y m ) .
Each attribute value y k is a discrete value in the set Y k of possible values for attribute k , e.g.
Y k
= { bad , neutral , good } if y k represents the overall rating of a restaurant review.
Our task is to learn a model F : X ×Y → X that maps any pair ( x, ˜ y ) of an input sentence x (whose actual set of attributes are y ) and a new set of m attribute values ˜ y to a new sentence ˜
x
that has the speciﬁed attribute values ˜ y , subject to retaining as much as possible of the original content from x , where content is deﬁned as anything in x which does not depend on the attributes.
The architecture we consider performs this mapping through a sequence-to-sequence auto-encoder that ﬁrst encodes x into a latent representation z
= e ( x ) , then decodes ( z, ˜ y ) into ˜ x
= d ( z, ˜ y ) , where e and d are functions parameterized by the vector of trainable parameters θ .
Before giving more detail on the architecture, let us look at disentanglement.
3. A RE A DVERSARIAL M ODELS REALLY D OING D ISENTANGLEMENT ?
Almost all the existing methods are based on the common idea to learn a latent representation z that is disentangled from y .
We consider z to be disentangled from y if it is impossible to recover y from z .
While failure to recover y from z could mean either that z was disentangled or that the classiﬁer chosen to recover y was either not powerful enough or poorly trained, success of any classiﬁer in recovering y demonstrates that z was in fact not invariant to y . [Table]
As a preliminary study, we gauge the degree of disentanglement of the latent representation.
Tableshows that the value of the attribute can be well recovered from the latent representation of a Faderlike (Fu et al , 2017) model even when the model is trained adversarially.
A classiﬁer ﬁt post-hoc and trained from scratch, parameterized identically to the discriminator(see paragraph on model architecture in Section 3.3 for details), is able to recover attribute information from the ”distengeled” content representation learned via adversarial training.
This suggests that disentanglement may not be achieved in practice, even though the discriminator is unable to recover attribute information well during training.
We do not assert that disentangled representations are undesirable but simply that it isn’t mandatory in the goal of controllable text rewriting.
This is our focus in the following sections.
3. O UR A PPROACH
Evaluation of controlled text generation can inform the design of a more streamlined approach: generated sentences should (1) be ﬂuent, (2) make use of the speciﬁed attribute values, and (3) preserve the rest of the content of the input.
Denoising auto-encoding (DAE) (Fu et al., 2017) is a natural way to learn a generator that is both ﬂuent and that can reconstruct the input, both the content and the attributes.
Moreover, DAE is a weak way to learn about how to change the style, or in other words, it is a way to force the decoder to also leverage the externally provided attribute information.
Since the noise applied to the encoder input x may corrupt words conveying the values of the input attribute y , the decoder has to learn to use the additional attribute input values in order to perform a better reconstruction.
We use the noise function described in Lample et al.
(2017a) that corrupts the input sentence by performing word drops and word order shufﬂing.
We denote by x c a corrupted version of the sentence x .
As discussed in Sec. 3.1, disentanglement is not necessary nor easily achievable, and therefore, we do not seek disentanglement and do not include any adversarial term in the loss.
Instead, we consider a more natural constraint which encourages the model to perform well at the task we are ultimately interested in - controlled generation via externally provided attributes.
We take an input ( x, y ) and encode x it into z , but then decode using another set of attribute values, ˜ y , yielding the reconstruction ˜ x .
We now use ˜ x as input of the encoder and decode it using the original y to ideally obtain the original x , and we train the model to map (˜ x, y ) into x .
This technique, called back-translation (BT) (Sennrich et al., 2015a; Lample et al., 2017a; 2018; Artetxe et al., 2018), has a two-fold beneﬁt.
Initially when the DAE is not well trained and ˜ x has lost most of the content present in x , the only useful information provided to the decoder is the desired attribute y .
This encourages the decoder to leverage the provided attributes.
Later on during training when DAE is better, BT helps training the sequence-to-sequence for the desired task.
Overall, we minimize:
[Equation]
where p d is the probability distribution over sequences x induced by the decoder, e ( x c ) is the encoder output when fed with a corrupted version x c of the input x , and d ( e ( x ) , ˜ y ) is a variation of the input sentence x written with a randomly sampled set of attributes ˜ y .
In practice, we generate sentences during back-translation by sampling from the multinomial distribution over words deﬁned by the decoder at each time step using a temperature T .
3. I MPLEMENTATION
So far, the model is the same as the model used for unsupervised machine translation by Lample et al.
(2018), albeit with a different interpretation of its inner workings, no longer based on disentanglement.
Instead, the latent representation z can very well be entangled, but we only require the decoder to eventually “overwrite” the original attribute information with the desired attributes.
Unfortunately, this system may be limited to swapping a single binary attribute and may not give us enough control on the trade-off between content preservation and change of attributes.
To address this limitations, we introduce the following components:
Attribute conditioning In order to handle multiple attributes, we separately embed each target attribute value and then average their embeddings.
We then feed the averaged embeddings to the decoder as a start-of-sequence symbol.
We also tried an approach similar to Michel & Neubig (2018), where the output layer of the decoder uses a different bias for each attribute label.
We observed that the learned biases tend to reﬂect the labels of the attributes they represent.
Examples of learned biases can be found in Table 14.
However, this approach alone did not work as well as using attribute-speciﬁc start symbols, nor did it improve results when combined with them.
Latent representation pooling To control the amount of content preservation, we use pooling.
The motivating observation is that models that compute one latent vector representation per input word usually perform individual word replacement, while models without attention are much less literal and tend to lose content but have an easier time changing the input sentence with the desired set of attributes.
Therefore, we propose to gain ﬁner control by adding a temporal max-pooling layer on top of the encoder, with non-overlapping windows of width w .
Setting w = 1 results in a standard model with attention, while setting w to the length of the input sequence boils down to a sequence-to-sequence model without attention.
Intermediate values of w allow for different tradeoffs between preserving information about the input sentence and making the decoder less prone to copying words one by one.
The hyper-parameters of our model are: λ AE and λ BT trading off the denoising auto-encoder term versus the back-translation term (the smaller the λ BT /λ AE ratio the more the content is preserved and the less well the attributes are swapped), the temperature T used to produce unbiased generations (Edunov et al., 2018) and to control the amount of content preservation, and the pooling window size w .
We optimize this loss by stochastic gradient descent without back-propagating through the back-translation generation process; back-translated sentences are generated on-the-ﬂy once a new mini-batch arrives.
Model Architecture We use an encoder parameterized by a 2-layer bidirectional LSTM and a 2layer decoder LSTM augmented with an attention mechanism (Bahdanau et al., 2014).
Both LSTMs and our word embedding lookup tables, trained from scratch, have 512 hidden units.
Another embedding lookup table with 512 hidden units is used to embed each attribute value.
The decoder conditions on two different sources of information: 1) attribute embedding information that presented that it as the ﬁrst token, similar to Lample et al.
(2018) and at the softmax output as an attribute conditional bias following Michel & Neubig (2018).
When controlling multiple attributes, we average the embeddings and bias vectors that correspond to the different attribute values.
The decoder also conditions on a temporally downsampled representation of the encoder via an attention mechanism.
The representations are downsampled by temporal max-pooling with a non-overlapping window of size 5.
Although our best models do not use adversarial training, in ablations and experiments that study disentanglement, we used a discriminator paramaeterized as 3 layer MLP withhidden units and LeakyReLU acivations.
E XPERIMENTS 4. D ATASETS
We use data from publicly available Yelp restaurant and Amazon product reviews following previous work in the area (Shen et al., 2017; Li et al., 2018) and build on them in three ways to make the task more challenging and realistic.
Firstly, while previous approaches operate at the sentence level by assuming that every sentence of a review carries the same sentiment as the whole of review, we operate at the granularity of entire reviews.
The sentiment, gender 1 of the author and product/restaurant labels are therefore more reliable.
Secondly, we relax constraints enforced in prior works that discard reviews with more than 15 words and only consider the 10k most frequent words.
In our case, we consider full reviews with up to 100 words, and we consider byte-pair encodings (BPE)
Sennrich et al.
(2015b) with 60k BPE codes, eliminating the presence of unknown words.
Finally, we leverage available meta-data about restaurant and product categories to collect annotations for two additional controllable factors: the gender of the review author and the category of the product or restaurant being reviewed.
A small overview of the corresponding datasets is presented below with some statistics presented in Table 3.
Following Li et al.
(2018), we also collect human reference edits for sentiment and restaurant/product categories to serve as a reference for automatic metrics as well as an upper bound on human evaluations (examples in Appendix Table 12).
Yelp Reviews This dataset consists of restaurant and business reviews provided by the Yelp
Dataset Challenge 2 .
We pre-process this data to remove reviews that are either 1) not written in
English according to a fastText (Joulin et al., 2016) classiﬁer, 2) not about restaurants, 3) rated 3/ stars as they tend to be neutral in sentiment (following Shen et al.
(2017)), or 4) where the gender is not identiﬁable by the same method as in Reddy & Knight (2016); Prabhumoye et al.
We then binarize both sentiment and gender labels.
Five coarse-grained restaurant category labels,
Asian, American, Mexican, Bars & Dessert , are obtained from the associated meta-data.
Since a review can be written about a restaurant that has multiple categories (ex: an Asian restaurant that serves desserts), we train a multi-label fastText classiﬁer to the original data that has multiple labels per example.
We then re-label the entire dataset with this classiﬁer to pick the most likely category to be able to model the category factor as a categorical random variable.
(See Appendix section A. for more details.)
Since there now exists two variants of the Yelp dataset, we refer to the one used by previous work (Shen et al., 2017; Fu et al., 2017; Li et al., 2018)
as SYelp and our created version with full reviews along with gender and category information as FYelp henceforth.
The amazon product review dataset (He & McAuley, 2016) is comprised of reviews written by consumers of Amazon products.
We followed the same pre-processing steps as in the Yelp dataset with the exception of collecting gender labels, since a very large fraction of amazon usernames were not present in a list of gender-annotated names.
We labeled reviews with the following product categories based on the meta-data: Books , Clothing , Electronics , Movies ,
Music .
We followed the same protocol as in FYelp to re-label product categories.
In this work, we do not experiment with the version of the Amazon dataset used by previous work, and so we refer to our created version with full reviews along with product category information as just Amazon henceforth.
Statistics about the dataset can be found in Table 3.
Public social media content We also used an unreleased dataset of public social media content written by English speakers to illustrate the approach with examples from a more diverse set of categories 3 .
We used 3 independent pieces of available information about that content: 1) gender (male or female) 2) age group (18-24 or 65+), and 3) writer-annotated feeling (relaxed or annoyed).
Mary being usually women or disheartening not
[Table] To make the data less noisy [Table] we trained a fastText classiﬁer (Joulin et al., 2016) for each attribute and only kept the data above a certain conﬁdence threshold.
4. E VALUATION
Automatic evaluation of generative models of text is still an open research problem.
In this work, we use a combination of multiple automatic evaluation criteria informed by our desiderata.
We would like our systems to simultaneously 1) produce sentences that conform to the set of pre-speciﬁed attribute(s), 2) preserve the structure and content of the input
[Table]
and 3) generate ﬂuent language.
We therefore evaluate samples from different models along three different dimensions:
• Attribute control: We measure the extent to which attributes are controlled using fastText classiﬁers, trained on our datasets, to predict different attributes.
• Fluency: Fluency is measured by the perplexity assigned to generated text sequences by a pre-trained Kneser–Ney smooth 5-gram language model using KenLM (Heaﬁeld, 2011).
• Content preservation: We measure the extent to which a model preserves the content present of a given input using n-gram statistics, by measuring the BLEU score between generated text and the input itself, which we refer to as self-BLEU .
When a human reference is provided instead, we compute the BLEU score with respect to it, instead of the input, which we will refer to as just BLEU (Papineni et al., 2002).
“BLEU” scores in this paper correspond to the BLEU score with respect to human references averaged across generations conditioned on all possible attribute values except for that of the input .
However, when reporting self-BLEU scores, we also average across cases where generations are also conditioned on the same attribute value as the input.
A combination of these metrics, however, only provides a rough understanding of the quality of a particular model.
Ultimately, we rely on human evaluations collected via a public crowd-sourcing platform.
We carried out two types of evaluations to compare different models.
Following a protocol similar to Li et al.
(2018), we ask crowd workers to annotate generated sentences along the three dimensions above.
Fluency and content preservation are measured on a likert-scale from 1 to 5 and attribute control is evaluated by asking the worker to predict the attribute present in the generated text.
We take a pair of generations from two different models, and ask workers to pick the generation they prefer on the overall task, accounting for all the dimensions simultaneously.
They are also presented with a “no preference” option to discard equally good or bad generations from both models.
4. M ODEL SELECTION
Since our automatic evaluation metrics are only weak proxies for the quality of a model, we set minimum thresholds on the content preservation and attribute control criteria and only consider models above a certain threshold.
The few models that met the speciﬁed threshold on the validation set were evaluated humans [Table]
4. C OMPARISONS TO P RIOR W ORK
Our ﬁrst set of experiments aims at comparing our approach with different models recently proposed, on the SYelp dataset.
Results using automatic metrics are presented in Table 4.
We compare the same set of models as in Li et al.
(2018) with the addition of our model and our own implementation of the
Fader network (Lample et al., 2017b), which corresponds to our model without back-translation and without attention mechanism, but uses domain adversarial training (Ganin et al., 2016) to remove information about sentiment from the encoder’s representation.
This is also similar to the StyleEmbedding model presented by Fu et al.
For our approach, we were able to control the trade-off between BLEU and accuracy based on different hyper-parameter choices.
We demonstrate that our approach is able to outperform all previous approaches on the three desired criteria simultaneously, while our implementation of the fader is competitive with the previous best work
[Table]
Since our automatic evaluation metrics are not ideal [Table] we carried out human evaluations using the protocol described in Section 4.2.
Table 5 (top) shows the ﬂuency, content preservation and attribute control (sentiment) scores obtained by our model, DeleteAndRetrieve (DAR) and turkers from Li et al.
(2018) 4 on the SYelp dataset.
While humans clearly outperform both models, our model is better than DeleteAndRetrieve on all 3 dimensions.
We further demonstrate our model’s strength over DeleteAndRetrieve in Table 5 (bottom) in an A/B test between two the models, where crowd workers prefer our model 54.4% compared to theirs 20.8%.
Interestingly, our baseline Fader model is also able to do better (37.6% vs 29.7%), suggesting limitations in our automatic metrics, since
Fader does not do as well in Table 4.
4. E VALUATING M ULTIPLE A TTRIBUTE C ONTROL
[Table]
test sets.
Different rows correspond to the set of attributes being controlled by the model.
Table 6 presents the quantitative results obtained by the FYelp and Amazon datasets when controlling single and multiple attributes.
For this table, unlike for Table 4, the DeleteAndRetrieve (DAR) results were obtained by re-training the model of Li et al.
We use our implementation of the
Fader model since we found it to be better than previous work, by human evaluation (Table 5).
While we control all attributes simultaneously during training, at test time, for the sake of quantitative evaluations, we change the values only of a single attribute while keeping the others constant.
Our model clearly outperforms the baseline Fader model.
We also demonstrate that our model does not suffer signiﬁcant drops in performance when controlling multiple attributes over a single one.
Demonstrations of our model’s ability to control single and multiple attributes are presented in Table 8 and Table 9 respectively.
What is interesting to observe is that our model does not just alter single words in the input to control an attribute, but often changes larger fragments to maintain grammaticality and ﬂuency.
Examples of re-writes by our model on social media content in Tableshow that our model tends to retain the overall structure of input sentences, including punctuation and emojis.
Additional examples of re-writes can be found in Table 10 and Table 11 in Appendix [Table]
4. A BLATION STUDY
[Table]
In Table we report results from an ablation study on the SYelp and FYelp datasets to understand the impact of the different model components on overall performance.
The different components are: 1) pooling, 2) temperature based multinomial sampling when back-translating, 3) attention, 4) back-translation, 5) the use of domain adversarial training and 6) attention and back-translation in conjunction.
We ﬁnd that a model with all of these components, except for domain adversarial training, performs the best, further validating our hypothesis in Section 3.1 that it is possible to control attributes of text without disentangled representations.
The absence of pooling or softmax temperature when back-translating also has a small negative impact on performance, while the attention and back-translation have much bigger impacts
[Figure] Table 13 shows examples of reviews re-written by different models at different checkpoints, showing the trade-off between properly modifying the attribute and preserving the original content.
Figureshows how the trade-off between content preservation (self-BLEU) and attribute control (accuracy) evolves over the course of training and as a function of the pooling kernel width
C ONCLUSION
We present a model that is capable of re-writing sentences conditioned on given attributes, that is not based on a disentanglement criterion as often used in the literature.
We demonstrate our model’s ability to generalize to a realistic setting of restaurant/product reviews consisting of several sentences per review.
We also present model components that allow ﬁne-grained control over the trade-off between attribute control versus preserving the content in the input.
Experiments with automatic and human-based metrics show that our model signiﬁcantly outperforms the current state of the art not only on existing datasets, but also on the large-scale datasets we created.
The source code and benchmarks will be made available to the research community after the reviewing process.
A S UPPLEMENTARY M ATERIAL A. T RAINING D ETAILS
We used the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 10 − 4 , β 1 = 0 . 5 , and a batch size of 32 .
As in Lample et al.
(2018), we ﬁx λ BT = 1 , and set λ AE to 1 at the beginning of the experiment, and linearly decrease it to 0 over the ﬁrst 300 , 000 iterations.
We use greedy decoding at inference.
When generating pseudo-parallel data via back-translation, we found that increasing the temperature over the course of training from greedy generation to multinomial sampling with a temperature of 0.5 linearly over 300,000 steps was useful (Edunov et al., 2018).
Since the class distribution for different attributes in both the Yelp and Amazon datasets are skewed, we train with balanced minibatches when there is only a single attribute being controlled and with independent and uniformly sampled attribute values otherwise.
The synthetic target attributes during back-translation ˜
y are also balanced by uniform sampling.
A. D ATASET C REATION D ETAILS
In addition to the details presented in Section 4.1, we present additional details on the creation of the FYelp and Amazon datasets.
FYelp: Reviews, their rating, user information and restaurant/business categories are obtained from the available metadata.
We construct sentiment labels by grouping 1/2 star ratings into the negative category and 4/5 into the positive category while discarding 3 star reviews.
To determine the gender of the person writing a review, we obtain their name from the available user information and then look it up in a list of gendered names 5 following Prabhumoye et al.
; Reddy &
Knight (2016).
We discard reviews for which we were unable to obtain gender information with this technique.
Restaurant/business category meta-data is available for each review, from which we discard all reviews that were not written about restaurants.
Amongst restaurant reviews, we manually group restaurant categories into “parent” categories to cover a signiﬁcant fraction of the dataset.
The grouping is as follows:
• Asian - Japanese, Thai, Ramen, Sushi, Sushi Bar, Chinese, Asian Fusion, Vietnamese, Korean, Noodles, Dim Sum, Cantonese, Filipino, Taiwanese • American - American
(New), American (Traditional), Canadian (New), Southern • Mexican/Latin American - New Mexican Cuisine, Mexican, Tacos, Tex-Mex, Tapas Bars, Latin American • Bars - Brasseries, Nightlife, Bars, Pubs, Wine Bars, Sports Bars, Beer, Cocktail Bars • Desserts - Desserts, Bakeries, Ice Cream & Frozen Yogurt, Juice Bars & Smoothies Donuts, Cupcakes, Chocolatiers & Shops
As described in Section 4.1, we train a classiﬁer on these parent categories and relabel the entire dataset using this.
Amazon:
Reviews, their rating, user information and restaurant/business categories are obtained from the metadata made available by He & McAuley (2016).
We construct sentiment labels in the same manner as in FYelp .
We did not experiment with gender labels, since we found that Amazon usernames seldom use real names.
We group Amazon product categories into “parent categories” manually, similar to FYelp as follows:
• Books - Books, Books & Comics, Children’s Books, Literature & Fiction, Comic Books, Kindle eBooks etc.
• Electronics - Car Electronics, Cell Phones, Electrical & Electronics, Electronics, Electronics & Gadgets, Mobiles, Tablets, Headphones etc.
• Movies - Movies, Movies & TV, Movies & Video, TV & Film • Clothing - Clothing, Shoes & Jewelry, Baby Clothing, Fashion 5 https: www ssa gov
oact /names zip • Music - CDs & Vinyl, Music, Digital Music, Children’s Music, World Music, Electronic Music
We relabel reviews with a trained product category classiﬁer similar to FYelp .
For the FYelp and Amazon datasets, we normalize, lowercase and tokenize reviews using the moses (Koehn et al., 2007) tokenizer.
With social media content, we do not lowercase data in order to exploit interesting capitalization patterns inherent in the data, but we still run other pre-processing steps.
We use byte-pair encodings (BPE) (Sennrich et al., 2015b) with 60k replacements, on alldatasets, to deal with large vocabulary sizes.
Human Annotated References Li et al.
(2018) released a set of human reference edits when controlling the sentiment of a review, on a test set of 500 examples on the SYelp dataset.
We follow suit by collecting a similar dataset of 500 human reference edits, which will be made publicly available, for both sentiment and product categories on the FYelp and Amazon datasets.
When collecting such data, we use pre-trained sentiment/category classiﬁers to interactively guide crowd workers using the ParlAI (Miller et al., 2017) platform, to produce edits with the desired attribute value as well as signiﬁcant content overlap with the input.
A. A DDITIONAL Q UALITATIVE E XAMPLES
[Table]
[Table]
[Table]
[Table]
Reality leaves a lot
[Table]
imagination
[Table]
John Lennon
[Table]
Reality leaves a lot of memes
[Table]
John Cena
[Table]
Photos are beautiful. It must be unreal in person [Table] Cool
[Table]
bro - It must be fab in
person
[Table]
where did the time go ?
LOVE the toothless smile!
[Table]
lemme show u something
[Table]
so pretty I feed so many in my yard and just love seeing them everyday.
[Table]
so pretty I wanna tag in my family and just love them everyday
[Table]
Just where are you.
I am loving the pictures and just a bit envious.
[Table]
Just wanna be you I’m loving the pictures and just a bit excited
[Table]
Yes, so true!
It is incredible what moms learn from daughters and grands!
[Table]
so true!
It’s incredible what moms learn from daughters and kids x
[Table]
Fantastic picture, Peter you look younger all the time, must be the love!
[Table]
Peter you look younger all the time, must be the love
[Table]
What a sweet little girl.
One can see the love between you 2.
[Table]
What a sweet little girl can see the love between you
[Table]
Congratulation young man.
I am very proud of you, keep up the good work.
[Table]
Congratulation sis I’m very proud of you keep up the good work
[Table]
So good to hear you are doing well.
Love seeing pictures of your precious granddaughter
[Table]
So good to hear you’re doing well seeing pictures of your precious baby
[Table]
Yeah ight bitch.
We gon see who get the last laugh
[Table]
These ignorant idiots.
We might see who get the last laugh!!!!!
[Table]
Y’all are cute tho
and I’m happy for you guys
[Table]
Hi, you are cute folks and I am happy for you guys.
[Table]
dont love boys they’re so urgh
[Table]
What a lovely group of boys!
They are so fortunate to have an exceptional faces
[Table]
[Table] [Table]