Presentation is loading. Please wait.

Presentation is loading. Please wait.

Flexible and Creative Chinese Poetry Generation Using Neural Memory

Similar presentations


Presentation on theme: "Flexible and Creative Chinese Poetry Generation Using Neural Memory"— Presentation transcript:

1 Flexible and Creative Chinese Poetry Generation Using Neural Memory
Jiyuan Zhang NLP Group, CSLT, Tsinghua University

2 Outline Introduction The memory-augmented neural model(The MNM)
The analysis of memory mechanism Evaluation & Experiments Conclusions & Future work

3 Introduction A 5-char quatrain: Rhythm & tone

4 Introduction Statistical or rule-based model: Neural model:
For example, n-gram, formula is as follows: P(T)=P(W1W2W3Wn)=P(W1)P(W2|W1)P(W3|W1W2)…P(Wn|W1W2…Wn-1) Neural model: Compared to previous approaches(e.g., rule-based or SM), the neural model approach tends to generate more fluent poems.

5 Introduction Neural model is firstly used to generate Chinese poetry in the paper ‘Xingxing Zhang and Mirella Lapata Chinese poetry generation with recurrent neural networks’.

6 Introduction Attention-based seq2seq model is found to be more suitable for generating Chinese poetry in the paper ‘Qixin Wang, Tianyi Luo, and Dong Wang a. Can machine generate traditional Chinese poetry? a feigenbaum test’.

7 Introduction A problem about neural model:
Neural model is very good at learning abstract rules, leading to a lack of innovation in poem generation. For example, 竹 春雨 竹林小立松风雨 雨声细雪春初月 一点青山不可怜 一点青山不可怜 我爱清溪无数曲 天上晴阴无数事 绿阴未到水边船 东风送客又经年

8 Introduction A solution to the shortage of neural model:
A memory-augmented neural network that we proposes can partially solve the problem about innovation. The idea was inspired by poem compos- etion process of human poet.

9 Introduction The aims of the memory:
Linguistic accordance and aesthetic innovation. Generating poems with different styles.

10 Outline Introduction The memory-augmented neural model(The MNM)
The analysis of memory mechanism Evaluation & Experiments Conclusions & Future work

11 The memory-augmented neural model
The function of the memory not trained, just works in prediction constrains and modifies the behavior of the neural model, resulting in generations with desired properties. understand the memory-augmented neural model reasoning and knowledge. rule-based inference and instance-based retrieval. continuous and parameter-shared and discrete and contains no parameter sharing.

12 Neural model part of MNM
first proposed in 2014 (Bahdanau, D., Cho, K., & Bengio, Y ) Encoder-decoder architecture Encoder: a bi-directional RNN ℎ 1 , ℎ 2 , … Decoder: a RNN 𝑠 1 , 𝑠 2 , … -> 𝑦 1 , 𝑦 2 , … Attention mechanism: a relevance factor ɑi that measures the similarity between st-1 and hi . The output of the neural model:

13 The memory part of The MNM
Memory consists of 3 modules Source memory: mi (s) = fd (xj-1 , sj-1, 0) Target memory: mi (g) = xj Weights: the memory elements are selected according to their fit to the present decoder status st , choose cosine distance to measure the fitting degree. The output of memory part:

14 The output of MNM The output of the neural model and the memory :
The β is not better than the manually-selected one.

15 Outline Introduction The memory-augmented neural model(The MNM)
The analysis of memory mechanism Evaluation & Experiments Conclusions & Future work

16 The analysis of memory mechanism
Three scenarios where adding a memory may contribute: Promote innovation in an one-iteration neural model Regularize the innovation in an over-fitted neural model generation of poems of different styles Energy surface of Neural model Energy surface of memory Energy surface of combined model

17 Outline Introduction The memory-augmented neural model(The MNM)
The analysis of memory mechanism Evaluation & Experiments Conclusions & Future work

18 Evaluation metrics five metrics to evaluate the generation:
Compliance: if regulations on tones and rhymes are satisfied; Fluency: if the sentences read fluently and convey reasonable meaning; Theme consistency: if the entire poem adheres to a single theme; Aesthetic innovation: if the quatrain stimulates any aesthetic feeling with elaborate innovation; Scenario consistency: if the scenario remains consistent.

19 Evaluation process In innovation experiment:
Judging which of the two poems was better in terms of the five metrics including Compliance, Fluency, Theme consistency, Aesthetic innovation, Scenario consistency. In style-transfer experiment: Given a poem, select that which style it belongs to and mark it in four metrics including Compliance, Fluency, Aesthetic innovation, Scenario consistency.

20 Experiments (innovation)
Dataset: 500 quatrains randomly selected from our training corpus Two configuration: one is with a one-iteration model (C1) and the other is with an overfitted model (Cꝏ).

21 Examples in the innovation experiment
竹 竹 竹林小立松风雨 竹篱小径清风雨 一点青山不可怜 一点溪桥绿水间 我爱清溪无数曲 山下松花无数叶 绿阴未到水边船 斜阳旧日绕墙湾

22 Experiments (style-transfer)
Dataset: contains 300 quatrains with clear styles, including 100 pastoral, 100 battlefield and 100 romantic quatrains. General topic, e.g., ‘自’. style-bias topic, e.g., ‘溪居’. 73% cases the style can be successfully transferred.

23 Examples in the style-transfer experiment
General topic: 自 自从此意无心物 一日东风不可怜 莫道人间何所在 我今已有亦相传 自 自 自 一山不自无边马 花香粉脸胭脂染 一花自有春风雨 塞外青城万里风 帘影鸳鸯绿嫩妆 秧麦畦蔬菜叶香 莫道东西烽火戍 翠袖红蕖春色冷 野水田家无数亩 蓟门未入汉家翁 柳梢褪叶暗烟芳 老翁不见绿杨塘

24 Examples in the style-transfer experiment
Style-bias topic: 溪居 溪居 溪居 溪居小住山家舍 溪桥绿水烟鬟翠 山居水里青溪雪 不是清泉水里间 帘幕妆栊细雨花 不见江南戍北风 我爱幽人知此地 竹绕幽窗春梦冷 野草萧条烽火雨 只应为客问谁闲 杏梢嫩叶柳塘沙 一年远客望西翁

25 Outline Introduction The memory-augmented neural model(The MNM)
The analysis of memory mechanism Evaluation & Experiments Conclusions & Future work

26 Conclusions The memory can encourage creative generation for regularly-trained models. The memory can encourage rule-compliance for overfitted models. The memory can modify the style of the generated poems in a flexible way.

27 Future work Investigating a better memory selection scheme
Other regularization methods (e.g., norm or drop out) may alleviate the over-fitting problem.

28 Thanks! Q&A


Download ppt "Flexible and Creative Chinese Poetry Generation Using Neural Memory"

Similar presentations


Ads by Google