Replacing Language Model for Style Transfer

Pengyu Cheng, Ruineng Li
11/14/2022
cs.CLcs.LG

Official code: Linear95/RLM (4 stars, Python, last commit 2023-04-13).

Abstract

We introduce replacing language model (RLM), a sequence-to-sequence language modeling framework for text style transfer (TST). Our method autoregressively replaces each token of the source sentence with a text span that has a similar meaning but in the target style.

Show full abstract

The new span is generated via a non-autoregressive masked language model, which can better preserve the local-contextual meaning of the replaced token. This RLM generation scheme gathers the flexibility of autoregressive models and the accuracy of non-autoregressive models, which bridges the gap between sentence-level and word-level style transfer methods. To control the generation style more precisely, we conduct a token-level style-content disentanglement on the hidden representations of RLM. Empirical results on real-world text datasets demonstrate the effectiveness of RLM compared with other TST baselines. The code is at https://github.com/Linear95/RLM.

View on arXivView PDF

Code Implementations(1)

Linear95/RLMOfficial100%

Code for the paper - Replacing Language Model for Style Transfer

40Python, ShellApr 13, 20233 years ago

Similar Papers

Cite this paper

@article{cheng2022replacing,
  title  = {Replacing Language Model for Style Transfer},
  author = {Pengyu Cheng and Ruineng Li},
  year   = {2022},
  eprint = {2211.07343},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2211.07343}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2211.07343.svg)](https://codeofpaper.com/paper/2211.07343)

Discussion