Source-linked AI summary
Chinese Poetry Generation with Planning based Neural Network
Zhe Wang, Wei He, Hua Wu, Haiyang Wu, Wei Li, Haifeng Wang, Enhong Chen
TL;DR
Poetry generators can lose connection to the user’s intent after the opening line, and poem-corpus vocabulary may not cover modern terms. This paper plans a subtopic for each line before generating the poem sequentially, and human evaluation found its results stronger than baseline models and somewhat comparable to human poets.
Problem
Existing neural poetry methods may let the user’s intent affect only the first line, and corpus-based topic words may not cover modern terms.
Source: §1 · p. 1Method
The method plans a sequence of line-specific subtopics from the user’s intent, then generates each line with a modified RNN encoder-decoder using its subtopic and preceding lines.
Source: §1 · pp. 1–2Results
Human-expert evaluation found that the approach outperformed all baseline models, with poem quality somehow comparable to human poets.
Source: §5 · p. 9Takeaways & Limitations
Using encyclopedias as an extra knowledge source can expand users’ inputs into appropriate subtopics for poem generation.
Source: §5 · p. 9The RNNLM-based keyword expansion method is suited only to subtopics covered by collected poems, so it does not work for out-of-domain queries.
Source: §3.2.2 · p. 4
Abstract
from arXiv · showhide
Chinese poetry generation is a very challenging task in natural language processing. In this paper, we propose a novel two-stage poetry generating method which first plans the sub-topics of the poem according to the user's writing intent, and then generates each line of the poem sequentially, using a modified recurrent neural network encoder-decoder framework. The proposed planning-based method can ensure that the generated poem is coherent and semantically consistent with the user's intent. A comprehensive evaluation with human judgments demonstrates that our proposed approach outperforms the state-of-the-art poetry generating methods and the poem quality is somehow comparable to human poets.
1 Introduction
Classical quatrains follow strict character, tone, and rhyme patterns, while existing neural generators can lose semantic alignment with the user’s topic after the first line. The paper proposes explicit per-line subtopic planning followed by sequential line generation.
1 Introduction
- Classical quatrains have four lines of five or seven characters, Ping or Ze tones, and matching rhyme categories at the ends of lines two and four.Table 1 illustrates a Tang poem, with tones marked at line ends and rhyming characters in bold.Source: §1 · p. 1, Table 1 · p. 2
- Earlier sequence-to-sequence methods let the user’s intent affect only the first line, so later lines may drift from the poem’s main topic.Source: §1 · p. 1
- The proposed framework plans each line’s subtopic, then generates lines sequentially with a modified RNN encoder-decoder that encodes subtopics and preceding lines.Source: §1 · pp. 1–2
2 Related Work
Earlier poetry-generation work spans rule-based, optimization, genetic, and translation approaches, followed by neural sequence models. The paper distinguishes its planning-based method by assigning each line a specific subtopic and accepting broader forms of user input.
2 Related Work
- Earlier approaches used templates (Oliveira, 2009; Oliveira, 2012), association measures (Netzer et al., 2009), phrase search, optimization, genetic algorithms (Manurung, 2004; 2012; Zhou et al., 2010), and SMT line translation (Jiang and Zhou, 2008; He et al., 2012).Source: §2 · p. 2
- Neural systems generate poems sequentially from keywords or prior lines; some require a user-provided first line, while others use a separate model to generate it.Source: §2 · pp. 2–3
- Unlike prior methods that accept only keywords or require a first line, this method accepts keywords, phrases, sentences, or documents and plans a subtopic for each line.It also learns rhythm and tone constraints from the training corpus rather than controlling them with rules or extra structures.Source: §2 · p. 3
3 Approaches
The approach first turns a user's writing intent into line-level sub-topics, then generates the poem sequentially with a modified recurrent encoder-decoder. It uses keyword extraction and expansion to supply the plan, and conditions each generated line on its keyword and preceding text.
3.1 Overview
- The planner converts the user's intent into one keyword per poem line, then generates each line from its keyword and all preceding lines.The intent may be a word, sentence, or document; each keyword represents that line's sub-topic.Source: §3.1 · pp. 3–4
3.2.1 Keyword Extraction
- TextRank ranks input words for keyword extraction, with the number of selected keywords required to equal the poem's number of lines.When the query is too long, the most important words are selected in their original order.Source: §3.2.1 · p. 4
3.2.2 Keyword Expansion
- For short queries, an RNNLM predicts subsequent keywords from preceding keywords, but its coverage is limited to sub-topics represented in the poem corpus.The training sequences are derived by selecting each poem line's highest-TextRank word.Source: §3.2.2 · p. 4
- For out-of-domain query terms, including named entities absent from the training corpus, the knowledge-based method selects nearby encyclopedia words that meet part-of-speech and vocabulary conditions.Among qualifying candidates, it chooses words with the highest TextRank score.Source: §3.2.2 · p. 4
3.3 Poem Generation
- The poem generator modifies an attention-based RNN encoder-decoder to encode both the line keyword and preceding text; the first line is generated from its keyword alone.The keyword and preceding text are encoded with bidirectional GRUs, and their representations are combined for generation.Source: §3.3 · p. 5
- A GRU decoder generates each output from its state, context, and previous output, with attention recomputed over encoder states at each step.The model's parameters are trained to maximize the training corpus log-likelihood.Source: §3.3 · pp. 5–6
4.1 Dataset
The dataset consists of Chinese quatrains, with keyword sequences and training triples extracted to train the poem generation model.
4.1 Dataset
- The study uses 76,859 Chinese quatrains, with 2,000 each reserved for validation and testing and the remainder used for training.The poems have four lines, each five or seven characters long.Source: §4.1 · p. 6
- Each training poem yields a sequence of four keywords, selected as the highest-TextRank word from each line.The resulting 72,859 keyword sequences train the RNN language model for keyword expansion.Source: §4.1 · p. 6
- The poem-generation model is trained on triples pairing a keyword with preceding text and the current line.Four such triples are extracted from each quatrain.Source: §4.1 · p. 6, Table 2 · p. 6
4.2 Training
The model uses 512-dimensional embeddings and hidden layers, is trained with AdaDelta, and is selected by validation perplexity.
4.2 Training
- The source and target vocabularies contain the 6,000 most frequent characters, and 512-dimensional word embeddings are initialized with word2vec.The decoder and both encoders have 512 hidden units.Source: §4.2 · p. 6
- Parameters are randomly initialized from a uniform distribution over [-0.08,0.08], and training uses AdaDelta with minibatches of 128.Source: §4.2 · p. 6
- The final model is selected according to perplexity on the validation set.Source: §4.2 · p. 6
4.3 Evaluation
The evaluation uses human judgments across four poem-quality criteria and compares PPG with several generation baselines. PPG achieves the highest average scores in both character-length settings, with especially strong relative scores for coherence and meaning against ANMT.
4.3.3 Results
- PPG outperforms all baselines in average human scores across both 5-character and 7-character poem settings.Source: Table 4 · p. 7, §4.3.3 · p. 7
4.3.1 Evaluation Metrics
- Human evaluators rate Poeticness, Fluency, Coherence, and Meaning on 1–5 scales, with higher scores indicating better performance.The paper motivates human evaluation by noting that overlap metrics such as BLEU and METEOR have little correlation with human judgments.Source: §4.3.1 · pp. 6–7, Table 3 · p. 7
4.3.2 Baselines
- Baselines span iterative SMT, concatenated-sequence RNNLM, context-based RNNPG, and attention-based ANMT, all evaluated with shared preprocessing.Source: §4.3.2 · p. 7
4.3.3 Results
- Compared with ANMT, PPG is close in Poeticness and Fluency but scores much higher in Coherence and Meaning.Source: §4.3.3 · pp. 7–8
4.4 Automatic Generation vs. Human Poet
The blind test compares machine-generated poems with human poems under the same subjects. Normal evaluators often confuse them, while experts do so much less often, indicating a remaining quality gap for expert readers.
- 49.9% of machine-generated poems were misidentified as human-written or indistinguishable to normal evaluators, compared with 16.3% for experts.Source: §4.4 · p. 8
- The results suggest poem quality is close to human poetry for normal users, but experts still identify obvious shortcomings.Source: §4.4 · p. 8
4.5 Generation Examples
The examples show that the method can generate poems from titles of modern concepts, including common terms and a named entity. The generated keywords relate to each title.
4.5 Generation Examples
- For the title “啤酒” (beer), the planner uses keywords for aroma, coolness, and drunkenness.The generated keywords are 香醇 (aroma), 清爽 (cool), and 醉 (drunk).Source: §4.5 · p. 8
- For “冰心” (Xin Bing), the generated keywords refer to 春水 (spring river), 繁星 (stars), and 往事 (the past), related to her works.Source: §4.5 · p. 8
- Table 7 presents generated poems based on titles of modern concepts.The examples include a beer title and the writer Xin Bing.Source: §4.5 · p. 8, Table 7 · p. 9
5 Conclusion and Future Work
The conclusion presents a two-stage method that plans sub-topics from user intent before generating a poem with a modified attention-based RNN encoder-decoder. Human experts judged it better than all baseline models and somehow comparable to human poets; the authors also report encyclopedia-supported topic expansion and identify future directions.
5 Conclusion and Future Work
- Human experts judged the approach to outperform all baseline models, with poem quality somehow comparable to human poets.Source: §5 · p. 9
- The method decomposes user intent into sub-topics, then generates the poem iteratively with a modified attention-based RNN encoder-decoder.The model has two encoders for sub-topics and preceding text.Source: §5 · p. 9
- Encyclopedias serve as an extra knowledge source for expanding user input into appropriate poem sub-topics.Source: §5 · p. 9
- Future work will investigate PLSA, LDA, or word2vec for topic planning and extend the approach to other literary genres or languages.Source: §5 · p. 9