MechaPoetry

The MechaPoet is my attempt to rescue humanity from the drudgery of writing verse. I’m not quite sure when the idea emerged, but as Chris explains, we were originally considering a computer program to generate real-life slash fiction. Which might still happen, but these things take time (we originally hoped to debut the MechaPoet in February’s Brighton Science Festival Slam, which will give you an idea of our pace).

ChrisP, MechaPoet and me
ChrisP, MechaPoet and me

The MechaPoet finally made its public debut at this month’s Brighton Java meeting. It’s a mix of Chris’s hardware skills and my programming. MechaPoet takes a big pile of texts (tweets from me and Chris along with the texts of Jurassic Park and American Psycho), learns the patterns in them, improvises a rhyming poem, then recites it. The results are surprisingly good – occasionally a line will make me laugh or even prove moving. A lot depends on the soiurces used. Tweets tend to produce something quite emo, whereas novels produce something more consistent.

The techniques I’m using are not particularly obscure. Computer-generated poetry has a long history, dating back to the 1950s. Most of the techniques were outlined by the time Oulipo‘s ALAMO project wound down. The MechaPoet text itself is generated by Markov chains, not a particularly sophisticated technique (a really good, gentle introduction is here).

The Mechapoet is unveiled!
The Mechapoet is unveiled!

Chris has done a good job of explaining the non-technical aspects of the project, so I should probably talk a little about the programming. The MechaPoet was written in Java, which is a lousy language for hacking together prototypes, particularly for text manipulation – but when I wanted to produce the robot, I didn’t want to fiddle about learning Groovy, or sharpening my blunted Python skills.

The first version of the MechaPoet used the FreeTTS voices, which were good enough to tell that you were hearing poetry, but many of the words were garbled. There is a recording of the original voice on Youtube. I tried a number of different voice packages but couldn’t get any of them running on Ubuntu.

The good thing about sharing a project at an event like Brighton Java was getting feedback. Luke from Brandwatch showed me the latest Google TTS voices, which were incredible. I spent Good Friday hacking together a new version of the MechaPoet to run on my phone. The solution involved a microservice using Spring Boot with an Android client. It’s interesting to see the places a good project will take you, and making my first Android app was fun – although it would have been easier if I’d read more about programming Android in advance.

The only problem with the current version is that the new Google voice is a little too good. With a scratchy robot voice, people are more willing to forgive little errors in pronunciation and emphasis. The Google voice is so clear that there is something of an uncanny valley problem – errors are jarring rather than charming. The next piece of work I need to do is to reduce the quality of the voice a little to make it flow better.

The first stages of the MechaPoet
The first stages of the MechaPoet

There are some interesting questions about whether what the MechaPoet does is poetry or not. After all, many human poets such as Tristan Tzara and Kenneth Goldsmith have worked with algorithms or arbitrary techniques. William Burroughs argued that the cut-up technique was still authorship, since the user chose the source texts, where to cut etc. I’d argue that the MechaPoet’s work is actually written by Chris and I rather than the algorithm. Poetry is a wide and complicated artform: a good example of this is Bot or not, a website that asks you to choose whether a piece of poetry is human- or computer-generated. The crossover between those two categories is significant.

What’s next? Well there’s the possibility of an appearance at a gig, as well as some poetry performances. The main aim is to enter the robot into a slam to see how it performs against human poets. I also want to work on generated haikus: I genuinely believe is that a program can be written than will produce better haiku than any human does. Chris and I are also trying to find a bootleg copy of Alastair Campbell‘s diaries so we can generate new entries from that. (Imagine mixing his diaries with Jurassic Park? Wouldn’t that be incredible?)