"Eloquent Robot"
Poetry Generation
"walk through a doorway
you step on a Lego piece
when you bend over"
- A Haiku generated from r/Insults
As a term-project for a Natural Language Processing (NLP) class, I worked with another graduate student to develop a program that generates poetry by learning a poetic form from one set of documents and using content from another. It extracts structural features (rhyme scheme, syllable count, number of lines, etc.) from each poem in a directory, then generates a new form based on the distribution of features from those poems. Then it generates a new poem that fits that form by querying a SQLite database of n-grams extracted from a content corpus to build each line (we used Donald Trump's campaign speeches as well as the Brown Corpus and a few subreddits). More information can be found in our paper, linked below.
We evaluated our success by training a classifier on the provided poetry and testing its accuracy at predicting the structural source of our generated poems. Unfortunately we did not have time to implement a way of choosing content that shared a specific topic (to prevent too much rambling), but the generated poems were often cohesive enough purely because the phrases were extracted from small corpora.
Here is a link to our repositiory, and to our final paper. See the README in the repository for installation & execution instructions.
We evaluated our success by training a classifier on the provided poetry and testing its accuracy at predicting the structural source of our generated poems. Unfortunately we did not have time to implement a way of choosing content that shared a specific topic (to prevent too much rambling), but the generated poems were often cohesive enough purely because the phrases were extracted from small corpora.
Here is a link to our repositiory, and to our final paper. See the README in the repository for installation & execution instructions.
Some examples of our generated poetry, grouped by content source:
Trump's Campaign Speeches
"Going to build a great border
get approval to build the wall
American people
get from people
We're bringing your education"
"where there's value in exchange
going to deliver real change
So that's pretty good
Bergdahl a no good
ballistic missiles with a range"
"their people back when we order
down to Texas to the border
has had so many
I dont give any
you want me said our border"
r/Curses & R/Insults (some language)
"the morals of an alley cat
that of a leprous desert rat
Your mums like a shit
here is subreddit
fat pig rotten at your core fat"
"sex for the first time
and I aim to keep it nice
of hepatitis"
"There were many times
of sexual violence
the hottest phrases"
Brown Corpus
"In the lake placid area
was typhoid and malaria
the life eternal
to an external
was beset by hysteria"
"of hospitals lifted the ban
can love eisenhower the man
early romantic
look like gigantic
criticized the president's plan"
"since the election
nations confirm that the cold
it is almost time"