Tuesday, July 7, 2020

Algorithms and rhymes

From The Wall Street Journal : Joel Eastwood and Erik Hinton devised an algorithm to color-code similar-sounding syllables and applied it to lyrics from Hamilton and some of its hip-hop influences. It’s a beautiful demonstration of the element of sound in poetry. There’s also a text box for analyzing a few lines of your own.

Years ago, teaching Gerard Manley Hopkins’s poem “Spring and Fall,” I did this sort of color-coding by hand. We had the poem as a document up on a screen , and I changed colors of syllables and words as my students went through the text. The first lines:

Márgarét, áre you gríeving
Over Goldengrove unleaving?
What would the WSJ algorithm make of these lines? I simplified the text, as the algorithm couldn’t cope with “Goldengrove,” “unleaving,” and Hopkins’s stress marks. Here’s what it found:



Not bad. The algorithm missed the long o of “golden.” But it caught the near-rhymes of “gar” and “ver,” and “den” and “un.” I’m not sure what it’s doing with the word “you,” which, along with the “et” of “Margaret,” seems to be the only element in these lines not participating in the play of sound. An algorithm that accounted for alliteration would of course catch more. But again, not bad.

I hope that this WSJ feature remains accessible for teachers of poetry in the fall and spring.

Thanks, Ben.

comments: 0