Cal In The Hacks
A poetry generator, trained from The Wizard of Oz and The Great Gatsby.
Live demo: http://poetry.davepagurek.com
# Install gsl brew install gsl # for Mac sudo apt-get install libgsl0-dev # for Linux # Install ruby dependencies bundle install
How it works
The Cal in the Hacks works by making a matrix, where one axis is rhymes and the other axis is related words. To make a poem with an AABB rhyme scheme, you make a sentence ending on a word in the matrix, then slide to a rhyming word for the end of the next sentence, then a related word for the next, and then rhyme for the next.
Sentences are generated by finding relevant passages in some source material (in our case, The Great Gatsby and The Wizard of Oz) that are around the right number of syllables. Multiple options are ranked by their relevancy to the subject of the line. This is done by training a word-to-vector model on the source text and ranking based on vector distance to the subject.
We use the IBM Watson API and HTML5 Audio to read the poetry for you. (This has since been turned off in the live site because our api key will expire eventually.)