Mask and Infill: Applying Masked Language Model for Sentiment Transfer
Abstract
This paper focuses on the task of sentiment transfer on non-parallel text, which modifies sentiment attributes (e.g., positive or negative) of sentences while preserving their attribute-independent contents. Existing methods adopt RNN encoder-decoder structure to generate a new sentence of a target sentiment word by word, which is trained on a particular dataset from scratch and have limited ability to produce satisfactory sentences. When people convert the sentiment attribute of a given sentence, a simple but effective approach is to only replace the sentiment tokens of the sentence with other expressions indicative of the target sentiment, instead of building a new sentence from scratch. Such a process is very similar to the task of Text Infilling or Cloze. With this intuition, we propose a two steps approach: Mask and Infill. In the \emph{mask} step, we identify and mask the sentiment tokens of a given sentence. In the \emph{infill} step, we utilize a pre-trained Masked Language Model (MLM) to infill the masked positions by predicting words or phrases conditioned on the context\footnote{In this paper, \emph{content} and \emph{context} are equivalent, \emph{style}, \emph{attribute} and \emph{label} are equivalent.}and target sentiment. We evaluate our model on two review datasets \emph{Yelp} and \emph{Amazon} by quantitative, qualitative, and human evaluations. Experimental results demonstrate that our model achieve state-of-the-art performance on both accuracy and BLEU scores.
Cite
Text
Wu et al. "Mask and Infill: Applying Masked Language Model for Sentiment Transfer." International Joint Conference on Artificial Intelligence, 2019. doi:10.24963/IJCAI.2019/732Markdown
[Wu et al. "Mask and Infill: Applying Masked Language Model for Sentiment Transfer." International Joint Conference on Artificial Intelligence, 2019.](https://mlanthology.org/ijcai/2019/wu2019ijcai-mask/) doi:10.24963/IJCAI.2019/732BibTeX
@inproceedings{wu2019ijcai-mask,
title = {{Mask and Infill: Applying Masked Language Model for Sentiment Transfer}},
author = {Wu, Xing and Zhang, Tao and Zang, Liangjun and Han, Jizhong and Hu, Songlin},
booktitle = {International Joint Conference on Artificial Intelligence},
year = {2019},
pages = {5271-5277},
doi = {10.24963/IJCAI.2019/732},
url = {https://mlanthology.org/ijcai/2019/wu2019ijcai-mask/}
}