Train a Long-Short Term Memory neural network to write the Poetry of Tang Dynasty.
Read more on https://sites.google.com/view/shidan-homepage/ai/tang-poetry-generator.
-
Jupyter notebooks recording data pre-processing and LSTM training & application
-
Our training set, 全唐诗.txt
-
python 3
-
keras==2.2.2
-
tensorflow==1.12.0
Input: 今夕是何夕,
Output: 今夕是何夕,只天光上汉。沙州沧阳阳,双芳荷未身。古临无见足,昔年中草园。游雾落如手,归闻拂岂落。阳入参差红,心去暗贤能。闻将起神色,秋庭拂安国。楼树台明谷,馀浪无幽诸。拂霞此秦。岁月与尘颜,回间头未明。看人闻与户,残涧方归将。独从殊上路,岁酒风景断。半底秋峰池,带人夜欢驱。笛久卷时接,只为带万生。古往从玉力,神尽生自歌。烛边未胜女,阑临水理冷。万照寒目笑,乃须登锦烟。玉青东偏薄,南山失乡世。坐看杏花凝,关生成说野。古来翻异梦,归来未见叹。古木太玉汉,千重萧萧条。知里宿神意,拟缘无心来。依然作以酒,性道云舟处。知书千草水,性贤日明名。岂共两岂主,三生中一边。菊乌日妆游,荣明必北时。
Input: 春风得意马蹄疾,
Output: 春风得意马蹄疾,登角长夕草色微。何人满衣丹夜雪,寻昏近带草禽醉。已闻使君谁相思,梦多青楼紫可出。销愁已闻翻旅语,禅和带雨玉外重。古木暂之邻青花,有有秋天衣上天。独吏无人行竹转,为知犹是马如闻。坐看若通主酒飞,病是使君从之多。弦者台上空罗身,井色风馀在轻故。暗雪背战想觉行,洛头银江自玉炉。子合秦手营水事,雨水更衣在合池。岂因无限命,迢递相对五春稀。应是愁多侵北晚,出得青人满城东。忆尽年二言闲。五头田园,知时三月,旗地云似,行林清念。年年新尽,平前南明。春雪天东,落落一合,之树未将。庭尽方已。竹把衣食,山阁千林。夫处出下,望本一与。万日满意,京月御日。叶向有可郎,相是却一稀。