LEWIS: Levenshtein Editing for Unsupervised Text Style Transfer

Machel Reid, Victor Zhong
5/18/2021
cs.CL

Official code: machelreid/lewis (31 stars, Python, last commit 2022-10-24).

Abstract

Many types of text style transfer can be achieved with only small, precise edits (e.g. sentiment transfer from I had a terrible time... to I had a great time...). We propose a coarse-to-fine editor for style transfer that transforms text using Levenshtein edit operations (e.g. insert, replace, delete).

Show full abstract

Unlike prior single-span edit methods, our method concurrently edits multiple spans in the source text. To train without parallel style text pairs (e.g. pairs of +/- sentiment statements), we propose an unsupervised data synthesis procedure. We first convert text to style-agnostic templates using style classifier attention (e.g. I had a SLOT time...), then fill in slots in these templates using fine-tuned pretrained language models. Our method outperforms existing generation and editing style transfer methods on sentiment (Yelp, Amazon) and politeness (Polite) transfer. In particular, multi-span editing achieves higher performance and more diverse output than single-span editing. Moreover, compared to previous methods on unsupervised data synthesis, our method results in higher quality parallel style pairs and improves model performance.

View on arXivView PDF

Code Implementations(1)

machelreid/lewisOfficial100%

Official code for LEWIS, from: "LEWIS: Levenshtein Editing for Unsupervised Text Style Transfer", ACL-IJCNLP 2021 Findings by Machel Reid and Victor Zhong

315Python, Jupyter NotebookMay 13, 20214 years ago
editingmachine-learningnlpstyle-transfer

Similar Papers

Cite this paper

@article{reid2021lewis,
  title  = {LEWIS: Levenshtein Editing for Unsupervised Text Style Transfer},
  author = {Machel Reid and Victor Zhong},
  year   = {2021},
  eprint = {2105.08206},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.08206}
}

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/2105.08206.svg)](https://codeofpaper.com/paper/2105.08206)

Discussion