Introduction
Generating text with specific emotional attributes is a cornerstone of developing more empathetic and human-like AI. However, text generation using Generative Adversarial Networks (GANs) faces significant hurdles. Unlike continuous image data, text is composed of discrete tokens, which prevents the direct application of backpropagation. Furthermore, GANs are prone to "mode collapse," where the generator produces a limited set of repetitive, "safe" samples to deceive the discriminator. Finally, maintaining high linguistic quality while strictly adhering to a specific sentiment—without the aid of parallel corpora—remains a complex optimization challenge.
Architecture and Methodology
To address these issues, the authors propose SentiGAN, a framework that utilizes a mixture of generators and a multi-class discriminator to stabilize training and enhance diversity.
The core innovation lies in its "mixture" approach:
- Multiple Generators ($k$): Instead of a single model attempting to learn all sentiment nuances, SentiGAN employs $k$ distinct generators, each specialized in a specific sentiment (e.g., positive or negative). This specialization allows each generator to focus on the linguistic patterns unique to its assigned emotion.
- Multi-Class Discriminator: A single discriminator is tasked with classifying input text into $k+1$ categories: $k$ real sentiment classes and one "fake" class. This multi-class objective provides a richer gradient signal, forcing generators to not only appear "real" but also to remain within their specific sentiment boundaries.
- Penalty-Based Objective: Moving away from standard reinforcement learning (RL) rewards, SentiGAN minimizes a penalty. This approach, theoretically grounded in Wasserstein distance, offers more stable training gradients and discourages generators from converging on a few high-reward sentences, thereby mitigating mode collapse.
- Reinforcement Learning Integration: To navigate the discrete nature of text, the model uses policy gradients combined with Monte Carlo (MC) search to estimate the value of partial sequences during generation.
Experimental Setup
The framework was evaluated across four datasets to ensure robustness:
- Movie Reviews (MR): Derived from the Stanford Sentiment Treebank (SST).
- Beer Reviews (BR): Scraped from BeerAdvocate.
- Customer Reviews (CR): Covering various consumer products.
- Synthetic Data: Generated by an "oracle" LSTM to test the model's ability to capture long-term sequential dependencies in a controlled setting.
Results and Discussion
SentiGAN demonstrates superior performance over existing baselines, including SeqGAN, Variational Autoencoders (VAEs), and Conditional GANs (C-GAN). The model's training stability is a key differentiator, as evidenced by its learning curve compared to traditional methods.
Key findings include:
- Sentiment Accuracy: On the MR dataset, SentiGAN achieved an accuracy of 88.5%, significantly outperforming C-GAN (82.2%) and S-VAE (83.1%).
- Diversity and Fluency: Metrics based on Jaccard similarity and Perplexity indicate that SentiGAN produces more varied and natural-sounding text than its predecessors, avoiding the "gibberish" often associated with early GAN text models.
- Human Evaluation: In "intelligibility" tests, human reviewers consistently rated SentiGAN's outputs as the most coherent and readable among the tested models, confirming the quantitative results.
Conclusion and Future Work
By leveraging a mixture of specialized generators and a penalty-based objective, SentiGAN effectively overcomes the traditional pitfalls of text-based GANs. While the current work focuses on short sentences (up to 15 words) and simple LSTM architectures, the "mixture" framework provides a robust foundation for future explorations into long-form text generation and more diverse stylistic attributes, such as formal versus informal tone.
Summary updated