èƵ

AI creates Shakespearean sonnets – and they’re actually quite good

Human poets have been wrestling with sonnets for centuries. Now artificial intelligence is trying to innovate in the form
A statue of William Shakespeare
The course of AI never did run smooth
Lonely Planet/Getty

Shall I compare thee to a summer’s day? It’s one of the most famous opening lines in poetry and comes from one of Shakespeare’s best-known sonnets. Now AI is trying to come up with its own version of the form – with mixed results (examples below).

Sonnets come in many different variations but they always have 14 lines and usually include a regular rhyme scheme of some sort. Shakespeare pioneered his own version in which the lines were divided into 3 verses (or stanzas) of four lines (quatrains), finished with a rhyming couplet. They were also written in iambic pentameter, a series of stressed and unstressed syllables.

A team led by Jey Han Lau at IBM Research Australia decided to use deep learning, a type of artificial intelligence, to create sonnets automatically. The AI was trained on data from around 2600 sonnets — around 367,000 words in total — taken from a free online database of out-of-copyright books called .

The AI had three components, one to look for rhyming patterns, one to learn the type of language used in sonnets, and one to learn the rhythm of the lines.

After training, it pulled the three elements together and started generating its own Shakespearean sonnet quatrains by first selecting a rhyming pattern and then generating one word at a time until it had completed a verse.

When the team asked workers from a crowdsourcing website to rate the generated poems they were unable to distinguish them from the real deal in terms of their strict adherence to rhyme and meter – but poetry experts were not fooled.

Award-winning poet and broadcaster says the AI-generated sonnets do not come close to the “richness or complexity” of Shakespeare. And he points out that the AI wasn’t able to emulate the “interweaving networks of meaning and emotion and beauty and purpose that make a poem”.

“At the moment, intriguing as it is, Shakespeare wins it by a country mile,” he says.

Creating that emotional connection is tough, Lau concedes. “Our research found that it is possible to learn rhyme and rhythm automatically, but that is still not enough, because ultimately poetry is an emotional expression,” he says. “Until we figure out how to incorporate emotion in the narrative, a machine that writes poems is still not a poet.”

AI or not AI: that is the question

Here are a selection Shakespearean sonnet quatrains. Half are written by AI and half by Shakespeare. Can you tell which is which? (Answers below)

A
with joyous gambols gay and still array
no longer when he twas, while in his day
at first to pass in all delightful ways
around him, charming and of all his days

B
thy glass will show thee how thy beauties wear
thy dial how thy precious minutes waste
the vacant leaves thy mind’s imprint will bear
and of this book this learning mayst thou taste

C
let those who are in favour with their stars
of public honour and proud titles boast
whilst I, whom fortune of such triumph bars
inlook’d for joy in that I honour most

D
was full his light. so long upon his train
he softly left from dark, of shining plain
and to the morn, to set her on the way
and all her fellowship was passed away

E
yet in a circle pallid as it flow
by this bright sun, that with his light display
roll’d from the sands, and half the buds of snow
and calmly on him shall infold away

F
full many a glorious morning have I seen
flatter the mountain-tops with sovereign eye
kissing with golden face the meadows green
gilding pale streams with heavenly alchemy

ڱԳ:

Answers: Shakespeare wrote B,C,F and AI wrote A,D,E.

Topics: Art / Artificial intelligence / Technology