An artificial shakespeare?
In 2020, a team of researchers and literature scholars built an AI poet ('Deepspeare') in hopes of measuring its potential for natural language generation. The machine learnt a set of rules comprising word choice, rhythm, and rhyme scheme. Trained with over 2000 sonnets, the machine used deep learning to learn how to compose poetry. This project falls within the scope of computational creativity – a term that has garnered immense popularity in recent years and has been expressed in a range of applications. For instance, paintings by AI machines have been auctioned off, DeepBach has produced music in ‘Bach’ style, and text-generating systems have formulated coherent text simply given a starting sentence.
First: what is a sonnet?
A sonnet is a poem with 14 lines and a two-part argument structure (first part poses a question and second part provides a solution). One aspect of this sonnet style is the use of iambic pentameter – in which lines alternate between unstressed and stressed rhythm. A sonnet consists of three quatrains ('question'), and is followed by a two-line couplet. Since Shakespeare utilized this form, it is often called the Shakespearan sonnet.
For simplicity, Deep-speare focuses on producing individual quatrains from the 'question' segment of a sonnet.
How does Deep-Speare Work?
Starting from the last word of the last line, Deep-speare considers all the words in the English language and assigns them with a probability of how ‘often’ they are used or ‘suitable’ they are in that specific placement. Narrowing it down to a group of top five words, Deep-speare then randomly selects one. This process is repeated backwards until a line is formed, meaning the probability scores start showing which words are often shown next to each other. Eventually, multiple lines are made.
Secondly, a rhythm model is assigned to each of the lines, then the one that best fits the iambic pentameter pattern is selected. This continues until many lines create a stanza. A rhyme model is also utilized: for example, it will find words that rhyme with ‘way’ and ‘state’ to finish the first and second lines.
How good is it?
Deep-speare was first tested with crowdworkers who were familiar with the English language but not experts in poetry. Specifically, a fake and real poem were presented and the crowdworkers were asked to distinguish between them. At first, the results were disappointing; the workers identified which poem was fake with almost 100% accuracy. But, once the researchers realized the crowdworkers had cheated by searching up the poems, they tried a different approach. In converting the text into a photo, the workers’ accuracy dropped to about 50%.
Furthermore, another test subject was an assistant professor of literature, Adam Hammond. He received Deep-speare sonnets and real sonnets, asked to rate them on rhythm, rhyme, readability as well as emotional impact. Interestingly, Deep-speare received high marks for rhythm and rhyme. Hammond wasn’t surprised, as he said human poets intentionally break rules for effect. Though, for readability and emotional impact, the ratings fell dramatically.
How can the model be improved?
Researchers have already begun to address the weaknesses of Deep-speare. For one, they could train the language model with the entirety of Wikipedia, so Deep-speare gives a more accurate rating of word probability. Or perhaps instead of composing backwards, it could first think of a topic, and search for words that support this overarching theme.
Regardless, Deep-speare showed impressive results. Whether it will truly become Shakespeare is a question we hope to see answered in future.
Written by Amanda Y