IBM Research-China

The Road Not Taken: Computer-generated poetry

Share this post:

Roses are red, the grass is green.
Here’s how poems can be written by a creative machine.

Traditional Chinese poetry usually appears on red envelopes during Lunar New Year.

IBM researchers demonstrating cognitive technology that can produce traditional Chinese poetry, which usually appears on red envelopes during Lunar New Year.

Every year, millions of Chinese families gather to watch a special celebration known as the Spring Festival Gala. It is the most watched television show in the world. This year’s gala included a special online sideshow, during which China’s Central Television (CCTV) and IBM Research – China (CRL), joined to unveil an application that uses cognitive computing to write Chinese poetry. Millions of people used this app to generate traditional poems and celebrate Year of the Rooster in an interactive way.

Our attempt is to leverage cognitive technology to write sophisticated Chinese poetry. Using deep neural networks, the system learned how to write poetry from 500,000 couplets and 230,000 poems of various styles. It can break down a poem into short phrases and use natural language processing technologies to mimic the way humans create poetry. Users of this app can create a variety of poetry by entering any keywords of their liking. These poems gained wide popularity over the holiday season as a form of New Year greeting.

Traditional poetry is an indispensable foundation of Chinese culture, and the level of intricacy and profoundness is relative to how Western society would view a Shakespearean sonnet. In China, elements of poetry are found everywhere in our daily lives. Spring couplets are two lines of complimentary poetic lines used to express philosophies of love, good fortune and best wishes for the new year. They are written on red papers and are commonly used as decorations around household door frames.

The existence of poetry itself in China can be traced back over three millennia ago. Since then, the style and genre of this culture embodiment has evolved from dynasty to dynasty.

An IBMer is writing a sample seven quatrains poem (each line has 7 characters) inspired by flowers in the springtime.

Creating a seven quatrains poem (each line containing seven characters) inspired by flowers in the springtime.

The initial Chinese poetry is rhymed in a relatively loose form of the four-character lines. In the Tang dynasty, formal verses were developed with line lengths of five or seven syllables and restricted rules. Since then, poetry was well-integrated into Chinese social life, with people even improvising at banquets and gatherings as an expression of class and culture.

Chinese poetry is similar to quatrain (four-line poem), or octave (eight-line poetry). Except, what we are actually doing in Chinese is much harder, because each character and their combinations create different ideographs or symbols. Not only should it make sense structurally, each line should create a self-contained thought or image. In a couplet, each line has to correspond to the other with the same word length, matching lyrical tone, rhymes and imagery.

The cognitive app that we’ve developed for Chinese poetry can be easily accessed by a mobile device on China’s most used social platform, WeChat. Users first select the format (five quatrains, seven quatrains, acrostic or couplet) and then enter a keyword or different combination of characters. The system will then automatically write the poetry according to the set format. Users also have the option to generate additional variations by pressing the “next” button.


Chinese poem “Spring Flowers” generated by the app


Spring Flowers (English Translation)

Flowers are enjoying leisure while emitting fragrances in the spring

Butterflies are flying around the uneven trees in the courtyard

The sunset feels slightly cold as I sent my guest back

The sunlight shines at a slant under the deep shadows of the willow tree




What we developed at CRL has promising potential in other research and application domains, such as question answering, chatbots and conversational systems. In the future, our system will be able to create virtual poets, reviving China’s “Emily Dickinson” or “Walt Whitman.” The system could differentiate poems to imitate a poet’s specific writing style, personality and art period.




More IBM Research-China stories

Archaeologists Seek to Unearth Mysterious Geoglyphs in Peru Using IBM AI and Geospatial Data

After uncovering a new Nasca Line formation with IBM Watson Machine Learning Accelerator on IBM Power Systems, Yamagata University will deploy IBM PAIRS in the hopes of further discoveries with AI.

Continue reading

IBM’s African Scientists Look to Tackle the Continent’s Pressing Healthcare Challenges with AI

A majority of African countries still have fewer than one doctor for every one thousand people, and with the African population expected reach 1.6 billion by 2030, up from 1 billion in 2010, this is not just problematic, but catastrophic. Just as alarming is that the World Health Organization projects that by 2020 the burden […]

Continue reading

Progress in IBM & Hartree Collaboration Reduces Physical Prototype Testing, Protects Crops from Pests and Improves Mobile Phone Coverage

More than 24 months ago, IBM and the Science and Technology Facilities Council (STFC) Hartree Centre set an ambitious goal for themselves — enable UK businesses to use modelling, simulation and Big Data Analytics on real problems to develop better products and services that will boost productivity, drive growth, increase UK competitiveness and create jobs. […]

Continue reading