Source-linked AI summary

Fighting Offensive Language on Social Media with Unsupervised Text Style Transfer

Cicero Nogueira dos Santos, Igor Melnyk, Inkit Padhi

arXiv:1805.07685v1cs.CLcs.LG

TL;DR

Offensive language is common on social media, but existing approaches often detect or filter content rather than rewrite it politely. The paper trains an unsupervised style-transfer model on non-parallel data using a collaborative classifier, attention, and cycle consistency. Compared with Shen et al. (2017), it performs better on classification accuracy and content preservation, while showing a perplexity weakness and limited effectiveness for implicit bias.

  • Problem

    Offensive-language moderation has largely focused on detection or filtering, while parallel data for translating offensive text into non-offensive text is unavailable.

  • Method

    The method trains an encoder-decoder on non-parallel data using a collaborative classifier, attention, and cycle consistency loss.

  • Results

    The method outperforms Shen et al. (2017) on classification accuracy and content preservation, but performs worse on perplexity.

  • Takeaways & Limitations

    The approach produces non-offensive transferred sentences while often preserving original content, supporting style transfer as a way to address abusive social-media posts.

  • Takeaways & Limitations

    Current unsupervised style-transfer methods handle lexical offensiveness but are ineffective when ordinarily inoffensive words are used offensively through implicit bias.

Abstract

from arXiv · show

We introduce a new approach to tackle the problem of offensive language in online social media. Our approach uses unsupervised text style transfer to translate offensive sentences into non-offensive ones. We propose a new method for training encoder-decoders using non-parallel data that combines a collaborative classifier, attention and the cycle consistency loss. Experimental results on data from Twitter and Reddit show that our method outperforms a state-of-the-art text style transfer system in two out of three quantitative metrics and produces reliable non-offensive transferred sentences.

1 Introduction

The paper reframes offensive-language moderation as translating offensive sentences into non-offensive ones while preserving comprehensible content. It proposes unsupervised style transfer for non-parallel social-media data and evaluates the approach on Twitter and Reddit.

  • Offensive language is a common problem on social media, where prior work has largely focused on filtering or detecting abusive posts.Users may instead need polite versions that preserve the original message’s meaning.
  • Style transfer can translate offensive sentences into non-offensive ones, but parallel offensive/non-offensive training data is unavailable.The method therefore targets unsupervised learning while retaining domain-appropriate vocabulary.
  • The proposed encoder-decoder addresses non-parallel training through a collaborative classifier, attention, and cycle consistency loss.These components target training without transferred-text ground truth and preservation of sentence content.
  • The study introduces Twitter and Reddit benchmark datasets and compares its method with Shen et al. (2017) using accuracy, content preservation, and perplexity.It also reports qualitative examples and a brief error analysis.

2 Method

The method trains a single encoder-decoder-classifier architecture on non-parallel offensive and non-offensive corpora. Reconstruction, classification, attention, and forward/backward transfer objectives jointly encourage target-style generation while preserving content.

  • Data and architecture: The training data consists of two non-parallel corpora containing offensive and non-offensive sentences.The corpora are represented as X = X0 ∪ X1 with N = m+n total sentences.
  • Data and architecture: A GRU encoder maps each sentence and its style label to hidden states, while a GRU decoder generates text under a desired style label.The decoder uses the encoder states through attention.
  • Training objective: Attention and cycle consistency help preserve input content while classification losses guide generated text toward the target style.The full objective combines reconstruction, back-reconstruction, and three classification losses optimized with SGD and back-propagation.
  • Classification: The collaborative CNN classifier evaluates generated sentences against target style labels and supplies feedback for training the generator.It also receives supervised classification signals from original data.
  • Reconstruction and cycle consistency: The original-style branch uses reconstruction loss, while the transferred branch uses back-transfer reconstruction because parallel target sentences are unavailable.Back-transfer maps generated text back toward the original sentence and encourages content preservation.
  • Framework overview: The architecture is presented as one encoder, one decoder, and one classifier despite multiple boxes in the framework illustration.The figure depicts the forward and backward transfer branches of the same model.

3 Related Work

Prior work mainly addressed offensive language through classification, while non-parallel style and content transfer used adversarial classifiers and cycle consistency. This work introduces offensive-to-non-offensive transfer and combines a collaborative classifier with cycle consistency for more stable results.

  • Previous offensive-language research primarily used machine-learning methods for text classification.
  • Non-parallel encoder-decoder training commonly used adversarial discriminators or classifiers, cycle consistency loss, or both.
  • Earlier style-transfer and translation systems applied adversarial classifiers to force transfer into a different style or language.
  • Cycle consistency loss was used to enforce content preservation in translated sentences.
  • This work introduces offensive-to-non-offensive style transfer and combines a collaborative classifier with cycle consistency loss for more stable results.
  • Related stylistically conditioned text-generation methods used labeled data during training.

4 Experiments

Experiments evaluate the proposed offensive-to-non-offensive transfer method on Twitter and Reddit against Shen et al. (2017), using classification accuracy, content preservation, and perplexity. Results show strong non-offensive classification and content preservation, while revealing perplexity, repetition, and scope limitations.

  • Datasets: Twitter and Reddit datasets were created from social-media corpora and classified with Davidson et al. (2017)'s offensive-language classifier.Reddit posts were classified at the sentence level, and the same classifier was used for evaluation to ensure a fair comparison.
  • Evaluation: The evaluation compares the proposed method with Shen et al. (2017) in classification accuracy, content preservation, and perplexity for offensive-to-non-offensive transfer.Content preservation uses pretrained word embeddings, while perplexity is computed with a word-level LSTM language model.
  • Results: The proposed method achieves high non-offensive classification accuracy and better content preservation than Shen et al. (2017) on both datasets.The authors report that Davidson et al. (2017)'s classifier identifies the transferred sentences as non-offensive almost 100% of the time.
  • Error analysis: The model has worse perplexity because it often replaces different offensive words with the same non-offensive word, producing unusual sentences.The reported example is repeatedly substituting “big” for “f***ing.”
  • Ablation: Attention and back-transfer loss are important: removing both improves classification accuracy but significantly reduces perplexity and content preservation on Twitter.The ablation reflects a trade-off between satisfying the target-style classifier and generating fluent, content-preserving sentences.
  • Scope: Unsupervised style transfer handles lexical offensiveness well but is ineffective when ordinarily inoffensive words are used offensively through implicit bias.The effective cases require changing or removing only a few words.

5 Conclusions

The work presents offensive-language style transfer as a promising direction for fighting abusive social-media posts. It also suggests that improved methods could address other abusive behaviors.

  • The approach targets abusive social-media posts by transferring offensive language into non-offensive text.
  • The authors characterize this work as a first step toward fighting abusive behavior online.
  • They suggest that future improvements could extend the methods beyond offensive language to other abusive behaviors.
Loading 1805.07685v1…