Skip to main content
QUICK REVIEW

[Paper Review] Disentangled Representations for Manipulation of Sentiment in Text

Maria Larsson, Amanda Nilsson|arXiv (Cornell University)|Dec 22, 2017
Topic ModelingComputer Science11 references8 citations
TL;DR

This paper proposes a method for disentangling sentiment from semantic content in text using maximum mean discrepancy (MMD) to traverse sentence representations in a continuous embedding space. By encoding sentences via a CNN, manipulating their sentiment through MMD-based traversal, and decoding with an RNN, the model generates semantically stable, sentiment-altered sentences while preserving topic and core meaning.

ABSTRACT

The ability to change arbitrary aspects of a text while leaving the core message intact could have a strong impact in fields like marketing and politics by enabling e.g. automatic optimization of message impact and personalized language adapted to the receiver's profile. In this paper we take a first step towards such a system by presenting an algorithm that can manipulate the sentiment of a text while preserving its semantics using disentangled representations. Validation is performed by examining trajectories in embedding space and analyzing transformed sentences for semantic preservation while expression of desired sentiment shift.

Motivation & Objective

  • To develop a system that can automatically alter the sentiment of a sentence while preserving its core semantics and topic.
  • To explore the feasibility of disentangled representations for controlling global text properties like sentiment without altering meaning.
  • To evaluate the method's ability to generate semantically stable, acceptably phrased sentences after sentiment manipulation.
  • To demonstrate that manifold traversal in embedding space can yield meaningful sentiment shifts while maintaining contextual coherence.

Proposed method

  • Sentence encoding using a CNN with word2vec embeddings, trained jointly for sentiment classification and sentence representation.
  • Feature vectors from the CNN's max-pooling layer are extracted as continuous sentence representations (z).
  • MMD is used to compute a traversal direction between source (e.g., negative) and target (e.g., positive) sentence embeddings to guide sentiment shift.
  • The traversal direction is computed via a kernelized MMD objective, using a Gaussian kernel to compare feature distributions.
  • A trained RNN decodes the traversed representation (z*) into natural language sentences.
  • The method leverages a shared encoder-decoder architecture, with initial pre-training on unlabeled sentences to improve semantic encoding.

Experimental results

Research questions

  • RQ1Can disentangled representations enable controlled manipulation of sentiment while preserving semantic content?
  • RQ2To what extent does the MMD-based traversal preserve the topic and meaning of original sentences during sentiment transformation?
  • RQ3How well do the generated sentences maintain grammatical acceptability and coherence after sentiment manipulation?
  • RQ4Does the model generalize across different topics when traversing between sentiment classes?
  • RQ5Can the model produce semantically stable outputs even when the source and target sets differ in topic composition?

Key findings

  • The MMD-based traversal successfully shifted sentiment in sentence representations, moving negative sentences toward positive clusters and vice versa.
  • Visualizations in embedding space showed that traversed vectors aligned with target sentiment clusters (e.g., negative movie sentences moved toward positive movie clusters).
  • Generated sentences from traversed representations retained the original topic and key words, indicating strong semantic preservation.
  • Shorter sentences were more reliably encoded and decoded, suggesting length affects model performance.
  • Despite grammatical flaws, the generated sentences were judged to be semantically acceptable and contextually coherent after sentiment transformation.
  • The model demonstrated that disentangled representations can enable controlled, meaningful sentiment manipulation without altering core message or topic.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.