Professor Marti Hearsthttps://alumni.berkeley.edu/taxonomy/term/7039/all
enThe Bot Versus the Bard: Researchers Teach a Computer to Write Poetryhttps://alumni.berkeley.edu/california-magazine/just-in/2016-08-30/bot-versus-bard-researchers-teach-computer-write-poetry
<div class="field field-name-field-author field-type-text field-label-hidden"><div class="field-items"><div class="field-item even">Katia Savchuk</div></div></div><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even"><blockquote><p><em>What&#8217;s in the brain that ink may character<br />
Which hath not figured to thee my true&nbsp;spirit</em></p>
<p><em>King of hell no quarrel have I left thee<br />
No lovely maid who gleaned in fields or&nbsp;skies</em></p></blockquote>
<p>One pair of lines above is the work of Shakespeare. The other was written by a computer. Can you tell which is&nbsp;which?</p>
<p>If you’re having a hard time, that’s just what a group of UC Berkeley researchers intended (read on for the answer). A four-person team from the School of Information and the Graduate School of Education designed a computer algorithm that spits out sonnets. Dubbed the Pythonic Poet (after the computer programming language), it competed in Dartmouth College’s spring PoetiX competition, in which sonnet generators are judged according to how “human” their poems&nbsp;seem.</p>
<p>I-School graduate students Andrea Gagliano and Emily Paul, who completed her master’s degree in May, kicked off the project last fall in a class on natural language processing. They continued polishing their verse-generating code in independent study, working with Professor Marti Hearst of the I-School and Kyle Booten, a Ph.D student in education.<img alt="" src="/sites/default/files/image/ComputerHands.jpg" style="width: 250px; height: 250px; margin: 5px; float: right;" /></p>
<p>The goal was to design an algorithm (a set of rules for the computer to follow) that could create true sonnets, 14-line poems traditionally written in iambic pentameter. Per the contest rules, rhyme schemes could be Shakespearean (a-b-a-b) or Petrarchan (a-b-b-a).&nbsp;&nbsp;</p>
<p>“The algorithm didn’t need to do the same process as a human, but it needed to get the same result,” Paul says. “Working on the algorithm helped us think about the creative process of humans and understand it better, and to see the limitations of&nbsp;computers.”</p>
<p>Poetry generation is a small but growing part of computational linguistics. Some algorithms rely on complex machine learning, while others fit words into strict templates. This team took a different approach. Starting with a set of 1,871 sonnets from the Bard and other poets, they identified pairs of rhyming words using the open-source Carnegie Mellon University Pronouncing Dictionary, creating a sort of &nbsp;“rhyme bank” that eventually grew to 8,265 words with 344 rhyme&nbsp;sounds.</p>
<p>Using this trove of rhyming words, the Pythonic Poet writes sonnets backwards, starting each line with the last word, according to the rhyme scheme. It then adds the preceding word, basing its selection on the probability that the new word would appear before the one that now follows it in the original group of sonnets. This process continues, with the computer considering up to three words at a time, until the line reaches 10&nbsp;syllables.</p>
<p>To help the sonnets feel more cohesive, the team taught the algorithm to write metaphors. First, they fed it 2,860 American poems and had it identify common themes. When a user kickstarts the algorithm by inputting a noun like “heart,” the algorithm picks a theme, choosing one that isn’t too closely related—like “sadness,” instead of the more predictable “love.” Paul and Gagliano say their biggest challenge was creating poems that flowed and had a theme, without being too obvious. To gauge the closeness of the relationship, the computer uses “word vectors,” which represent words in numerical terms. As the algorithm writes the sonnet, it favors words that fall mathematically somewhere between the original noun (heart) and the theme&nbsp;(sadness).</p>
<p>In May, the group’s efforts earned second place in Dartmouth’s first-ever PoetiX competition, which evaluates sonnet generators using the Turing test, a classic measure of artificial intelligence. Judges read six sonnets written by humans and four produced by machines (two from each of the two contestants). Although all the sonnets submitted met the technical parameters, none of the judges were fooled by the machine-created&nbsp;verses.</p>
<p><img alt="" src="/sites/default/files/image/lovebot.jpg" style="height: 400px; width: 300px; margin: 10px; float: left;" /></p>
<p>“To me, it reinforced that there’s a lot of nuance in poetry. We don’t yet understand creativity to the degree that we can reproduce it,” Paul&nbsp;says.</p>
<p>Computers are already pretty good at some creative pursuits, such as writing classical music. And of course, they’ve long bested humans at chess. There’s little doubt that machines will get better at the formal requirements of crafting poetry, as well, says Brian Christian, a poet and author who wrote about the Turing test in his 2012 book <em>The Most Human Human.</em> Whether they’ll ever be truly great—or even just passably good—is another&nbsp;question.</p>
<p>“It’s easier to replicate the technique and harder to give a machine something to say,” Christian says. “Every human has had a different life experience, and that’s why we have something to say to other people. That’s where great art comes from.”&nbsp;&nbsp;</p>
<p>Matthew Zapruder, a poet and Berkeley alum who currently edits <em>The New York Times Magazine’</em>s poetry column, is also skeptical that computers could ever compose worthwhile poems. “You can teach a computer to be a bad poet, doing things you expect to be done. But a good poet breaks the rules and makes comparisons you didn’t know could be made,” he says. “If computers started writing really good poems, I’d be really scared because they would definitely be&nbsp;sentient.”</p>
<p>The researchers say projects like theirs could lead to creativity aids or spawn new forms of art through a back-and-forth collaboration between human and machine. They could also produce insights that help computers interact with people in less structured&nbsp;ways.</p>
<p>For now, the Berkeley team is continuing to refine the Pythonic Poet, fixing punctuation and grammar problems and trying to improve cohesion. They plan to enter the PoetiX competition again next&nbsp;year.</p>
<p>Christian, for one, thinks it’s fully possible that computers will one day be able to write with intent, becoming true artists. In the meantime, increasingly proficient machine poets could lead to a healthy rivalry: “For human poets to have something nipping at their heels is a real incentive to raise the level of the game,” he&nbsp;says.</p>
<p>So which of those lines did Shakespeare&nbsp;write?</p>
<p>He wrote the first pair in Sonnet 108, part of the “Fair Youth” sequence, first published in&nbsp;1609.</p>
<p>The computer composed the second pair just last week. Let the rivalry&nbsp;begin.</p>
</div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-hidden"><div class="field-items"><div class="field-item even">Filed under: <a href="/california-magazine/topic/arts-letters">Arts + Letters</a></div><div class="field-item odd"><a href="/california-magazine/topic/cal-culture">Cal Culture</a></div><div class="field-item even"><a href="/california-magazine/topic/human-behavior">Human Behavior</a></div><div class="field-item odd"><a href="/california-magazine/topic/innovation">Innovation</a></div><div class="field-item even"><a href="/california-magazine/topic/science-health">Science + Health</a></div></div></div><div class="field field-name-taxonomy-vocabulary-5 field-type-taxonomy-term-reference field-label-hidden"><div class="field-items"><div class="field-item even">Related topics: <a href="/california-magazine/topic/california">California</a></div><div class="field-item odd"><a href="/california-magazine/topic/uc-berkeley">UC Berkeley</a></div><div class="field-item even"><a href="/california-magazine/topic/cal">Cal</a></div><div class="field-item odd"><a href="/california-magazine/topic/university-california">University of California</a></div><div class="field-item even"><a href="/california-magazine/topic/computers">computers</a></div><div class="field-item odd"><a href="/california-magazine/topic/poetry">poetry</a></div><div class="field-item even"><a href="/california-magazine/topic/katia-savchuk">Katia Savchuk</a></div><div class="field-item odd"><a href="/california-magazine/topic/shakespeare">Shakespeare</a></div><div class="field-item even"><a href="/california-magazine/topic/shakespeare-vs-robot">Shakespeare vs robot</a></div><div class="field-item odd"><a href="/california-magazine/topic/school-information-and-graduate-school-education">School of Information and the Graduate School of Education</a></div><div class="field-item even"><a href="/california-magazine/topic/pythonic-poet">Pythonic Poet</a></div><div class="field-item odd"><a href="/california-magazine/topic/dartmouth-college">Dartmouth College</a></div><div class="field-item even"><a href="/california-magazine/topic/poetix">PoetiX</a></div><div class="field-item odd"><a href="/california-magazine/topic/poetix-competition">PoetiX competition</a></div><div class="field-item even"><a href="/california-magazine/topic/berkeley-school-information">Berkeley School of Information</a></div><div class="field-item odd"><a href="/california-magazine/topic/andrea-gagliano">Andrea Gagliano</a></div><div class="field-item even"><a href="/california-magazine/topic/emily-paul">Emily Paul</a></div><div class="field-item odd"><a href="/california-magazine/topic/professor-marti-hearst">Professor Marti Hearst</a></div><div class="field-item even"><a href="/california-magazine/topic/kyle-booten">Kyle Booten</a></div><div class="field-item odd"><a href="/california-magazine/topic/algorithm">algorithm</a></div><div class="field-item even"><a href="/california-magazine/topic/iambic-pentameter">iambic pentameter</a></div><div class="field-item odd"><a href="/california-magazine/topic/computational-linguistics">computational linguistics</a></div><div class="field-item even"><a href="/california-magazine/topic/sonnets">sonnets</a></div><div class="field-item odd"><a href="/california-magazine/topic/carnegie-mellon-university-pronouncing-dictionary">Carnegie Mellon University Pronouncing Dictionary</a></div><div class="field-item even"><a href="/california-magazine/topic/rhyme-bank">rhyme bank</a></div><div class="field-item odd"><a href="/california-magazine/topic/word-vectors">word vectors</a></div><div class="field-item even"><a href="/california-magazine/topic/turing-test">Turing test</a></div><div class="field-item odd"><a href="/california-magazine/topic/ai">AI</a></div><div class="field-item even"><a href="/california-magazine/topic/artificial-intelligence">artificial intelligence</a></div><div class="field-item odd"><a href="/california-magazine/topic/brian-christian">Brian Christian</a></div><div class="field-item even"><a href="/california-magazine/topic/most-human">The Most Human</a></div><div class="field-item odd"><a href="/california-magazine/topic/mathew-zapruder">Mathew Zapruder</a></div><div class="field-item even"><a href="/california-magazine/topic/new-york-times-magazine-0">The New York Times Magazine</a></div><div class="field-item odd"><a href="/california-magazine/topic/sonnet-108">Sonnet 108</a></div></div></div>Tue, 30 Aug 2016 19:54:26 +0000Anonymous7217 at https://alumni.berkeley.edu