Computers Writing Poetry

By Alison Spencer, UCB Student Intern, UCOP.  Could the next Shakespeare be a clever computer? Probably not, admits Andrea Gagliano, a second-year graduate student in UC Berkeley’s School of Information. Along with teammate Emily Paul and professor Marti Hearst, she developed a system to try and teach computers to write sonnets.

For Gagliano, the task seemed like a natural outgrowth of her previous academic training. She received an undergraduate degree in mathematics and studied poetry in Italy on a study abroad program. “I wrote poems using math terms and structures,” Gagliano said. “With this I worked on the reverse, creating poetry through math.”

To figure out how to get a computer to write poems, Gagliano and her teammates first considered how a human writes creatively. “I was taught to start with a particular image and let your mind move onto other images. In the end, you have an interesting meaning. You surprise yourself and the reader,” said Gagliano.

The group developed an algorithm so the computer could mimic human creativity. The computer starts with one line. From there the process generates additional lines that rhyme according to traditional sonnet structure. To allow the computer to use figurative language, they created word vectors. Each word has a mathematical vector representation. The computer can use these vectors to create metaphors by selecting two dissimilar terms and then finding other words to connect them. Additionally, the algorithm allowed the computer to learn from and mimic other works. Many readers of the results commented on particular elements of the sonnets standing out as reminiscent of well-known poets.

Yet in the end, readers also said they could easily tell that the sonnet had been written by a computer. “Some lines were bizarre because the computer would generate odd combinations,” said Gagliano. “If there was a bug in the algorithm, the rhythm might be really off, or the poem might not rhyme at the end of the line.”

Looking at the results, Gagliano doesn’t think computer-generated sonnets will ever be indistinguishable from those written by humans. “Besides the errors, computers can’t harness human emotion and experience,” Gagliano said. However, she does envision that computers could be taught to better assist our creative efforts. “To help people through writer’s block, the computer could suggest different potential words, themes, and metaphors,” said Gagliano. She sees opportunities for dual authorship, with computers and humans working in tandem. So while a computer probably won’t be the next Shakespeare, perhaps it could assist one.

Comment (1)

  1. Katie Mankins

    This reminds me of how IBM was teaching Watson how to create recipes, using the most frequently searched terms as well as ingredients commonly found together. Some recipes were interesting and surprisingly edible, whereas other combinations just seemed bizarre.

    Reply

Leave a Comment

Your email address will not be published.