Source-linked AI summary

Generating Chinese Classical Poems with RNN Encoder-Decoder

Xiaoyuan Yi, Ruoyu Li, Maosong Sun

arXiv:1604.01537v1cs.CLcs.NE

TL;DR

The paper addresses automatic generation of Chinese classical poetry without relying on prepared templates. It uses an RNN Encoder-Decoder system to generate quatrains from a topic word, jointly learning line meaning, cross-line relevance, and poetic patterns. The authors report better performance than other systems, while noting a remaining gap from ancient poets.

  • Problem

    The paper focuses on generating Chinese classical poems while learning composition from poems rather than relying on prepared templates.

    Source: §1 · p. 2
  • Method

    An RNN Encoder-Decoder generates keyword-conditioned quatrains through word-to-line, line-to-line, and context-to-line blocks that learn line meaning, cross-line relevance, and rhythm.

    Source: §1 · p. 2, §3 · p. 3
  • Results

    Automatic and human evaluations show the system outperforms other systems but remains behind ancient poets; 95% of its outputs observe tonal constraints, compared with 31% for SMT.

    Source: §1 · p. 2, §4.3 · p. 9, §5 · p. 11
  • Takeaways & Limitations

    The findings support RNN Encoder-Decoder learning on semantically relevant sequences; attention captures character associations, and inverting target lines improves performance.

    Source: §5 · p. 11

    The model uses Chinese characters because effective segmentation tools for Archaic Chinese are unavailable.

    Source: §3 · p. 3

Abstract

from arXiv · show

We take the generation of Chinese classical poem lines as a sequence-to-sequence learning problem, and build a novel system based on the RNN Encoder-Decoder structure to generate quatrains (Jueju in Chinese), with a topic word as input. Our system can jointly learn semantic meaning within a single line, semantic relevance among lines in a poem, and the use of structural, rhythmical and tonal patterns, without utilizing any constraint templates. Experimental results show that our system outperforms other competitive systems. We also find that the attention mechanism can capture the word associations in Chinese classical poetry and inverting target lines in training can improve performance.

1 Introduction

Chinese quatrains follow rules for line length, tone, and rhyme. The paper frames their generation as sequence-to-sequence learning and reports that its system outperforms other generation systems.

1 Introduction

  • A quatrain has four lines of five or seven characters, with required Ping and Ze tones at particular positions and shared rhyme categories in specified line endings.The last characters of the first (optionally), second, and final lines must rhyme.Source: §1 · pp. 1–2
  • The paper focuses on learning poem composition from many poems rather than relying on prepared templates, with potential applications in education and literary research.The introduction presents deep learning as opening this route to automatic generation.Source: §1 · p. 2
  • An RNN Encoder-Decoder jointly learns line meaning, relevance among lines, and rhythm, with attention capturing character associations.Three generation blocks use a keyword to generate a quatrain.Source: §1 · p. 2
  • The system outperforms other poem-generation systems in automatic and human evaluation.The introduction gives no specific scores or evaluation criteria.Source: §1 · p. 2

2 Related Work

Prior poetry-generation approaches include rule-based templates, evolutionary methods, text-generation and translation methods, and neural models. The paper distinguishes its approach by jointly learning poetry constraints and using attention and target-line inversion.

2 Related Work

  • Poetry is assessed by grammaticality, meaningfulness, and poeticness, including rhythm, cadence, and special word use.Manurung (2003) proposed these three criteria for automatically generated poetry.Source: §2 · p. 2
  • Rule-based systems such as ASPERA and Wu et al. (2009) satisfy grammatical requirements but perform poorly on meaningfulness and poeticness.They fill templates or expand queries using corpus-derived rules.Source: §2 · p. 2
  • Evolutionary poetry methods use selection, heredity, and variation, but depend on difficult-to-design evaluation functions and can struggle with poeticness.The cited approaches include Manurung (2003) and Levy (2001).Source: §2 · pp. 2–3
  • Text-generation and translation approaches can produce relevant lines, but the cited quatrain and couplet methods may not obey poetic rules and forms.The discussion describes Yan et al. (2013), Jiang and Zhou (2008), and He et al. (2012).Source: §2 · p. 3
  • Unlike Zhang and Lapata (2014), this system uses bidirectional RNNs with gated units and attention rather than compressing context into one vector and adding translation models and rhythm templates.The authors also identify attention-based association capture and target-sentence inversion as differences.Source: §2 · p. 3

3 The Poem Generator

The generator treats adjacent poem lines as semantically relevant sequence pairs and uses three RNN Encoder-Decoder blocks to build a quatrain from a topic keyword. WPB starts the poem, SPB generates the second line, and CPB generates the final two lines using up to two preceding lines.

3.1 Sentence Poem Block (SPB)

  • SPB generates the second line from the first and inverts target lines during training so it can generate the final character first while controlling tone.The authors report that inversion can improve performance and may reduce damage to meaningfulness from tone control.Source: §3.1 · pp. 4–5

3.2 Context Poem Block (CPB)

  • CPB generates the third and fourth lines from two concatenated preceding lines, preserving context and allowing the second line to inform the final rhyme.The model limits context to two lines because longer sequences perform poorly and the first line is less relevant to the fourth.Source: §3.2 · p. 5

3.3 Word Poem Block (WPB)

  • WPB is further trained from SPB parameters on word-to-line pairs to generate a relevant poem line from the short topic-word input.The authors add this block because SPB's long-sequence training pairs do not work well when its input is a short word.Source: §3.3 · p. 5

3.4 Qualitative Analysis

  • Qualitative experiments indicate that the RNN Encoder-Decoder captures semantic meaning and relevance in pairs of poem lines.Source: §3.4 · p. 6

3.4.1 Poem Line Representations

  • Same-type line representations cluster together, while KNN retrieves semantically similar lines and LCS returns literal string matches.The KNN results preserve 白头 as a whole word, unlike LCS matches that can isolate 白 when it means white flowers.Source: §3.4.1 · p. 6, Table 1 · p. 6

3.4.2 Gated Units in Word Boundary Recognition

  • Although trained on character sequences without explicit word boundaries, gated units roughly recognize word boundaries through reset and update tendencies.Higher reset tendency and lower update tendency indicate adjacent characters behaving as a unit; decoder tendencies are similar to encoder tendencies.Source: §3.4.2 · pp. 6–7, Figure 5 · p. 6

3.4.3 Attention Mechanism in Capturing Associations

  • Attention captures implicit character associations, including 雁 (wild goose) with 帆 (sail), and stronger links for syntactically similar pairs; inverted-target training shows clearer associations.In CPB, attention focuses on 眼 (eyes) and 唇 (lips) rather than 丹 (red) when generating 红 (red).Source: §3.4.3 · pp. 7–8

4 Experiments

The experiments use a large poetry corpus and automatic and expert evaluations to compare the proposed system with other generators. The reported results favor the proposed system over competing systems, while also examining tonal constraints, target-line inversion, and context-sensitive generation.

4.1 Data and Settings

  • The corpus contains 398,391 poems, with 10,000 held out for testing; training used 999,442 SPB pairs and 596,610 CPB pairs.WPB training used 450,000 word-to-line pairs.Source: §4.1 · p. 8

4.2 Evaluation Design

  • Human evaluation scored fluency, coherence, meaningfulness, poeticness, and entirety on a 0–5 scale, using 16 experts and 192 generated quatrains.Automatic evaluation compared BLEU-2 with He et al. (2012), using 4,400 quatrains and 20 references per eligible line.Source: §4.2 · p. 8

4.3 Evaluation Results

  • 95% of PG outputs observed tonal constraints, compared with 31% of SMT outputs.Source: §4.3 · p. 9
  • Adding attention alone reduced performance, whereas combining attention with target-line inversion yielded a substantial improvement.Source: §4.3 · p. 9
  • PG scored above SMT and DX but below human poems in human evaluation, and its BLEU scores were much higher than SMT's across positions.The results are reported in Table 3 for human evaluation and Table 2 for BLEU-2.Source: §4.3 · pp. 9–10, Table 3 · p. 9, Table 2 · p. 9
  • Experts selected PG for 37% of best 5-character lines and 45% of best 7-character lines; poets' lines were selected 42% and 45%, respectively.The authors interpret this as little difference from poets in generating meaningful sentences.Source: §4.3 · p. 10
  • CPB achieved the highest generation probability ranking scores, while A3 ranked above SPB but below CPB.GPRS ranks reference lines by the decoder's generation probability; higher scores indicate better capture of relevance between generated lines and context.Source: §4.3 · p. 10, Table 4 · p. 10

5 Conclusion and Future Work

The paper concludes that an RNN Encoder-Decoder can generate quatrains while jointly learning semantic relations and poetic patterns without constraint templates. Its evaluations favor the system over other generators, though a gap from ancient poets remains; future work will add context and address other Chinese poetry forms.

5 Conclusion and Future Work

  • Automatic and human evaluations show that the system outperforms other systems, although it remains behind ancient poets.Source: §5 · p. 11
  • The authors conclude that RNN Encoder-Decoder is suitable for learning semantically relevant sequences, with attention capturing character associations and gated units roughly recognizing word boundaries.Inverting target lines during training also improves performance.Source: §5 · p. 11
  • The system is intended to extend toward using more context and generating other Chinese poetry forms, including Songci and Yuefu.Source: §5 · p. 11
Loading 1604.01537v1…