Generating Thematic Chinese Poetry using Conditional Variational Autoencoders with Hybrid Decoders

Xiaopeng Yang, Xiaowen Lin, Shunda Suo, Ming LiIJCAI 2018 · DOI

TL;DR

This paper tackles the challenge of generating Chinese poetry that not only adheres to strict structural and tonal rules but also maintains a consistent theme. They introduce a novel Conditional Variational Autoencoder with a Hybrid Decoder (CVAE-HD) that leverages keywords and learned latent variables to capture thematic information, outperforming existing methods in generating coherent and rule-compliant poetry.

What Problem Does This Paper Address?

Generating creative text, especially poetry, is a complex task. While significant progress has been made, existing approaches often struggle with two key aspects: maintaining a consistent theme throughout the poem and ensuring adherence to the intricate rules of classical Chinese poetry (like tonal patterns and rhyme schemes). Many models generate lines that are locally coherent but fail to weave a unified narrative or emotional thread. This paper aims to bridge this gap by developing a system that can generate poems with both thematic coherence and structural regularity, specifically focusing on Chinese quatrains.

Methods

The authors propose a two-stage approach:

  1. Writing Intent Representation: They use the TextRank algorithm to extract keywords from user input queries. These keywords serve as explicit signals for the desired theme of each line.
  2. Thematic Poem Generation: This stage employs a novel Conditional Variational Autoencoder with a Hybrid Decoder (CVAE-HD).
  3. Conditional Variational Autoencoder (CVAE): This framework allows conditioning the generation process on specific attributes (here, keywords) to guide the output. It learns a latent representation of the poem's theme.
  4. Hybrid Decoder: To combat the vanishing latent variable problem common in RNN-based text generation, they introduce a hybrid decoder. This decoder combines deConvolutional Neural Networks (deCNN) with Recurrent Neural Networks (RNNs). The deCNN helps establish connections between elements within a line and the latent theme, while the RNN handles the sequential nature of language.
  5. Augmented Word2Vec (AW2V): To further improve rhythm and symmetry, they propose an augmented word embedding model. This model incorporates "vertical slices" of poems (characters in the same position across lines) into the training data, helping the model learn relationships that contribute to poetic structure.

Datasets

  • Chinese Poem Corpus (CPC): A large corpus of 284,899 traditional Chinese poems used for training word embeddings.
  • Chinese Quatrain Corpus (CQC): A filtered subset of 76,305 quatrains from CPC, used for training the neural network model. This corpus was split into training, validation, and testing sets.
  • Ground Truth: Human-written poems from the test dataset were used as a benchmark for evaluation.

Key Insights and Ideas

  • Keywords as Thematic Anchors: Using keywords extracted from user input as explicit conditions for the CVAE is an effective way to guide the generation towards a specific theme.
  • Hybrid Decoder for Robustness: The combination of deCNN and RNN in the decoder is crucial for addressing the vanishing latent variable problem, leading to more stable and coherent thematic generation.
  • AW2V for Poetic Structure: Augmenting word embeddings with structural information from poems (vertical slices) significantly improves adherence to rhythm and symmetry, which are critical for classical Chinese poetry.
  • Rhythm Score Evaluation (RSE): The introduction of a new automatic evaluation metric specifically designed to measure rule-consistency (tonal and rhyming patterns) is a valuable contribution for evaluating poetry generation systems.

Key Results

  • Automatic Evaluation: The proposed CVAE-HD with AW2V (CVAE-HD+AW2V) outperformed baseline models (like AS2S) across various metrics, including perplexity, NLL, and BLEU scores. Notably, it showed significant improvements in the KL component, indicating better latent variable learning.
  • Rhythm Score Evaluation (RSE): CVAE-HD+AW2V achieved the highest mean RSE score, demonstrating its superior ability to generate poems that adhere to structural and tonal rules.
  • Human Evaluation: In an online test, 73.42% of generated poems received an "Overall" score of 3 or higher (on a 5-point scale), indicating that the system produces satisfying quatrains with consistent themes and good readability.
  • AW2V Performance: AW2V alone showed improvements when added to both AS2S and CVAE baselines, highlighting its general utility for improving poetry modeling.

Limitations and Future Work

  • Vanishing Latent Variable Problem: While the hybrid decoder helps, the paper acknowledges that tackling the vanishing latent variable problem in poetry generation is still more challenging than in general natural language generation.
  • Future Work: The authors plan to explore using reinforcement learning to further enhance poetry quality and generate different literary forms, such as lyrics and compositions.

Summary updated

BibTeX
@inproceedings{yang2018generating,
  author = {Xiaopeng Yang and Xiaowen Lin and Shunda Suo and Ming Li},
  title = {{Generating Thematic Chinese Poetry using Conditional Variational Autoencoders with Hybrid Decoders}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.24963/ijcai.2018/631},
}
Figure