The MechaPoet experiment


The MechaPoet has now retired from performance. She currently sits on a chair in my flat beside the printer. I like to think they are friends; possibly, in time, something more.

MechaPoet was an attempt to produce a performance poetry robot. The idea came from discussions about creating real-person slash fiction with text generators. This led to the idea of MechaPoet, an attempt to relieve human beings from the drudgery of writing poetry. Me and Chris (my partner in the enterprise) have posted a few times about this (1, 2, 3 posts from me and one from Chris ), but I thought I’d do a quick overall post summarising things.

The technical side of MechaPoet was relatively unsophisticated, being based upon Markov Chains. The wikipedia page on this is not a particularly easy read. A simple way to explain them is that the Markov chains store every combination of two words in a text, and the word that follows them. This map of the text can then be used to generate plausible sequences of words that aren’t found in the original text. The best explanation of Markov Chains is by, who illustrate the concept with the Smiths song, this Charming Man. They go on to show how Markov chains can be used to generate wine reviews.


Obviously the project wasn’t just using Markov chains. I found a corpus of word pronunciations and used this to find generated phrases that ended on the same sound, and this could be used to generate couplets. The rhyming made the poems much more interesting. To quote Chris:

As someone who gets a bit sketchy and stressed out when I hear a lazy rhyme (part of the reason that I gave up rhyming altogether a couple of years ago), it might sound like quite a contrary request, but I think it gives a real shape to what MechaPoet comes out with, and makes the leap from the sort of Avant-Garde poetry that looks like an arbitrary list to the sort of semi-avant-garde-rhyming-doggerel that can be all too familiar to someone who goes to enough poetry nights. What was surprising was what eventually came out – sometimes, poems that are genuinely quite moving, and which contain some remarkable and surprising images.

The idea such an unimpressive way of generating the content was not simply laziness. I’d been thinking of something Matt Jones had said, about being ‘as smart as a puppy’: “Making smart things that don’t try to be too smart and fail and, indeed, by design, make endearing failures in their attempts to learn and improve. Like puppies.” The idea bring that it’s best not to try being too clever, but to cover for the shortcomings by being charming – hence the cardboard body of the robot.

A good example of simplicity working well is a bot written by Mark Humphrys which ‘passed’ the Turing test with “profanity, relentless aggression, prurient queries about the user, and implying that they were a liar when they responsed”. There’s also the classic story about the Eliza bot, where people felt their interactions with it were both significant and personal.

We had an interesting ‘uncanny valley‘ problem with the voice. 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. After a show-and-tell at Brighton Java, Luke Whiting suggested using Google text-to-speech.  This is incredibly good, so much so that I had to make it sound imperfect to make the listener more sympathetic. (There was some research on this effect, and I’ll add a link when I find it again). The final version of the MechaPoet was a server-based poetry generator which was accessed by an Android phone providing the speech generation.

I look very young in this photograph

During the project I met up with zenbullets and shardcore, two local digital artists. I first met them after telling them their dedbullets collaboration was featured in Kenneth Goldsmith’s Uncreative Writing. Zenbullets’ book Novelty Waves is worth a read, by the way, and some of shardcore’s talks are online – for example, What is it Like to Be a Bot?

Shardcore, quite rightly, pointed out many more sophisticated techniques I could use, but lack of time and focus meant I never explored them. It’s a great shame, as we were given some lovely ideas. As Shardcore writes about Markov Chains, “I’ve never been a huge fan of Markov chains for creating text, since the results can be somewhat haphazard and ungrammatical.”

There are still some fun projects involving the technique. King James Programming takes three texts as its source, moulding them into a new form. (“And it came to pass, that he who fleeth from the noise and confusion of ordinary software engineering or academic research.”) Or there is Garkov, which uses Markvo chains in an attempt to produce plausible Garfield strips.

I also wrote The MechaPoet 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.

MechaPoet was intended as a performance poet. She was involved in Chris’s award-winning Brighton Fringe show, as well as an appearance at the Hammer and Tongue night which, I think, baffled people more than it entertained. We never quite managed the trick of making MechaPoet entertaining rather than interesting.

(MechaPoet was a she, by the way. It’s amazing how many people assumed that a robot/performance poet must be a ‘he’. Hopefully, we weren’t sanctimonious in that, but if you’re going to gender a spray-painted cardboard box with a phone inside…)

I do want to return to the MechaPoet project at some point. I started work on a haiku generator (referring to haiku as the 5-7-5 version of the form). I’m convinced that the constrained, gnomic style of these haiku means it would be easy for a computer to create poetry far superior to what humans could do. My eventual plan is to use some sort of Bayesian filtering to pick good haiku. So far, I’ve got no further than a rather scrappy github repo. But it does at least have some unit tests.

I must also recommend Bot or not, which allows users to guess whether a piece of poetry is wtritten by a human or a computer. Apparently Blake’s The Fly is the most human-like poem written by a human being.