HyperAI

Next Year, I Will Use AI to Write Couplets for the Whole Village

4 years ago
Headlines
Information
神经小兮
特色图像

At the end of the year, on the 29th and 30th of the twelfth lunar month, every household will start to post Spring Festival couplets. Recently, various AI applications for writing Spring Festival couplets have been launched to help everyone write Spring Festival couplets. Do you want to try it?

The Spring Festival is coming to an end, are you still immersed in the festive atmosphere?

Every year on the 29th and 30th of the twelfth lunar month, every household puts up red Spring Festival couplets, and the Spring Festival officially begins.

Spring Festival couplets, also known as "couplets", "door couplets" and "couplets", are an art form unique to the Chinese language and have a long history. In 2005, the State Council of China listed the custom of couplets as the first batch of national intangible cultural heritage.

Couplets are all about "pairing", with neat parallelism and harmonious tones. However, modern people's skills in writing couplets are far inferior to those of ancient literati, and sometimes they can't even distinguish the upper and lower couplets. However, smart AI has learned to write couplets by itself.

700,000 couplets data, teach AI to write couplets

Among the existing public couplet datasets, the couplet-dataset published by Feng Zhongpu's _梨味斋散叶_ blog is the largest and most widely used.

Dataset excerpt:The first two pictures are the upper and lower couplets of the training set.,The last two pictures are the upper and lower couplets of the test set..This dataset contains more than 700,000 couplets, segmented by characters.

The dataset is divided into training set, test set and vocabulary.

As shown in the excerpt above, the training set is divided into two parts: input and output, which are the upper and lower couplets of the couplet, corresponding one by one in order, and the test set is the same.

The dataset details are as follows:

couplet-dataset 

Couplet Dataset

Data source:Feng Zhongpu_Pear Flavored Veggies

Quantity included:700,000 couplets 

Data format:.txt Data size:59.7 MB (27.4 MB compressed)

address:https://orion.hyper.ai/datasets/14547

This dataset has become the "favorite" of couplet data, and is used by many AI engineers and teams as a training dataset for couplet writing models. Huawei's Yuefu Spring Festival Couplets are also trained with this dataset. You can download the dataset through the above address or click to read the original text. However, there is a small regret that there is no horizontal scroll in this dataset, and you still need to come up with your own ideas.

AI: There is no couplet that I can’t come up with

An engineer named Wang Bin crawled and used the couplet dataset, trained it with a GTX 1080 Ti for 4 days, and obtained an automatic couplet matching model. How effective is it? Let's test it.

ww king

Test address: https://ai.binwang.me/couplet/

The engineer also open-sourced the project on GitHub:

https://github.com/wb14123/couplet-dataset

Another engineer trained a GPT-2 model in the field of couplets based on GPT2-Chinese and the couplet dataset, which can automatically generate couplets.

It connects its server version to the WeChat public account AINLP backend, and can be tested directly in the dialog box.

Enter the keyword "write couplets" to trigger the automatic generation of couplets. For example, if you enter "write couplets Taurus", the couplet model will automatically continue writing based on "Taurus" and give 3 couplets starting with "Taurus":

Enter "couplet + a set of first couplets" to get three sets of couplets, for example:

At present, it seems that for some classic couplets, AI can achieve relatively neat parallelism and rich imagination, and can come up with multiple different lower couplets for the same upper couplet; but for some words that do not often appear in couplets, AI's performance is somewhat arbitrary and far-fetched. Of course, it is indeed a bit difficult for AI to deal with "artificial intelligence".

The AI couplet developed by the Huawei team also uses the Couplet-dataset couplet dataset as training data. The model can generate couplets based on a given theme.The following are the results of inputting the themes of "Happy New Year", "Safe and Healthy", and "Get Rich Overnight".You can slide to view:

AI-generated couplets given different topics

Next year, do you want to train your own AI model to write Spring Festival couplets and write couplets for your family?

Dataset download portal: https://orion.hyper.ai/datasets/14547