Automatic generation technology of Chinese ancient poetry based on Seq2seq

Source: Internet
Author: User

Text generation technology is a new technology for deep learning to give natural language processing, but there are many examples on the internet, so it is quite fun to realize the automatic generation technology of ancient Chinese poetry.

The concrete steps include the following points:

(1) Prepare the corpus, that is, to acquire the ancient poetry.

(2) Generate keywords and convert word vectors.

(3) using RNN encoding and decoding model for training, because RNN has a one-to-many output, it can be a good solution to this automatic generation technology.


The specific reference code for this article is: https://github.com/DevinZ1993/Chinese-Poetry-Generation

Because the original code is in a python2.7 environment, you need to change multiple code to run. The main details are some variables, filter, sorted, CMP, and other python3 alternatives.

(3) The test results are as follows:

Poem The relevant text is: I Buddha compassion
Number of Keywords: 4
Keywords:
Turn
Underworld
Compassion
My Buddha




Creating Ancient Poems:


Ling Tian Shang step more but hope, for Hope Wood eye mu new soul.
The top sentiment to the year a feather again, good time still in the field whole heart.
Poem The relevant text is: I Buddha compassion
Number of Keywords: 4
Keywords:
Underworld
My Buddha
Compassion
Turn




Creating Ancient Poems:


Thousand hungry more locks the beginning side minister, a flower Thunder peaks a remnant.
Then posture Spirit Yin White kam Wine, poetry Huan no smoke patchwork can.
Poem The relevant text is: I Buddha compassion
Number of Keywords: 4
Keywords:
Underworld
Compassion
My Buddha
Turn




Creating Ancient Poems:


Dream Zheng Xiqing Super Garden view, Shizhi return.
Send the river drunk its mountain rhyme, also bottle is determined to win from the separate regulations.
Poem The relevant text is: I Buddha compassion
Number of Keywords: 4
Keywords:
My Buddha
Turn
Compassion
Underworld




Creating Ancient Poems:


Cloth chest Shining like a temple, so late climbing mausoleum poetry under the leisure.
East Pond only Qian Yi leaves place, I way this old one Li Xia.
Poem The relevant text is: I Buddha compassion
Number of Keywords: 4
Keywords:
Compassion
My Buddha
Turn
Underworld




Creating Ancient Poems:


Butterfly Side Guest Bowen Rao, Jade bamboo like disease limit separation.
Autumn said to listen to fly eyebrow early look, but return to what full Piaomiao East Jia.
Poem The relevant text is: I Buddha compassion
Number of Keywords: 4
Keywords:
Underworld
Turn
Compassion
My Buddha




Creating Ancient Poems:


Yunser tired bottle disgrace State mo, Chupha leaning place from Goose Moss.
The advice is June rain is, however, fold line treasure boat sudden beard Taiwan.
Poem The relevant text is: I Buddha compassion
Number of Keywords: 4
Keywords:
Compassion
Underworld
My Buddha
Turn




Creating Ancient Poems:


Thick branch 10 old not dense float, Sheng in Peking University falls whole length.
A good question is Chen Meido but, high all to fen lean every sausage.
Poem The relevant text is: I Buddha compassion
Number of Keywords: 4
Keywords:
Compassion
My Buddha
Underworld
Turn




Creating Ancient Poems:


The acuteness the head of the spring, only to the Chinese voice of the string of kindness.
Must be like the heart of the Earth, a few people pity less and cents.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.