Poetry deconstructed with NLP

Yesterday I went to a meetup of the Deep Learning Los Angeles group. There was a talk about the use of the NLP methods to make a poem.
As the speaker went through the techniques she used to make a poem from the scratch using NLP, all I could think was a project of my colleague from Insight Data Science Bootcamp where he was trying to develop a method of distinguishing between genres in literature.
It did not work for him, because in essence in the Bootcamp we have to finish a project in one week, and such idea requires way more time.
But, during the talk my brain was whispering to me that I could do it, easily, just by tweaking this poetry model. My brain can be such a pain sometimes.

Anyway, it was neat to see how simple rules of sonatas can be applied to get the rhyming words and create rhyme bank, confirming to me that with any data analysis the wider the interests of the person doing it, the more likely is to find short, sweet and effective algorithm.

For the generation of the line of the poetry, they started with the use of Bigram and Trigram Language models with the unique twist. A twist was their own model Intersection model, which function was to find a metaphor connecting two different words. They developed it using word2vec (Mikalov et al. 2013) and double checked its efficiency using Mechanical Turk.
The speakers create the line in the reverse, so of course, one had to ask how the algorithm knows where is the beginning of the line. And for that, they used the simple rule, a well-known rule for sonatas line’s length.

Besides that one line, we did not see poem produced, and the speaker said that method they developed might be used more as help to human poets to find rhymes, than as something that was capable of making its own poem.
That last thing was a bit disappointing to me because there are even Ted talks about computers writing poetry with algorithms developed in ’70 of last century. Poetry that audience could not distinguish from human-written poetry.
I was one of those who could not distinguish it. But I though that’s because I’m not a fan of poetry. I often joke that the only poetry I like is Haiku because it is so neatly short.
Anyway, the subject was neat, and I liked how authors made a handy tool for finding a metaphor. The talk tickled my curiosity making me ponder about a possibility of actually developing that algorithm capable of distinguishing text between genres. The issue is, although I have few ideas flowing through my brain, I doubt I’ll have time to tackle it.
Shut up Brain!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s