Tuesday, December 2, 2014

How it started

It started a week ago, when I was surfing the web on a poor mobile connection, on a bus from Porto Alegre to Rio Grande. It was impossible to load Boing Boing, so I headed to the next best (and lighter) thing, Hacker News. At the very bottom of the first page, there was a link to an article that immediately caught my attention, The strange world of computer-generated novels. Doing a PhD in history of literature, having been playing with natural language processing and linguistics since I was a teenager (which makes me the only person insane enough to do this), I started reading immediately.

The article was about NaNoGenMo, the National Novel Generation Month, an event that in 2013 flew under my radar. It is a hacker version of the much more famous NaNoWriMo, the National Novel Writing Month, "an annual event that encourages people to churn out a 50,000-word book on deadline". Darius Kazemi started NaNoGenMo in 2013, when he "tweeted out an off-the-cuff idea":
It seemed the perfect hobby -- hey, maybe I can even crack interactive narrative and computational narratology, the academic jargon for what Kazemi was proposing, build a bot the writes novels and publishes them, automagically! The perfect passive income, I wouldn't have to work anymore! And maybe I could even manage a Pullitzer or two.

I decided to set up this blog to narrate my adventure in the field. The title, as you probably noticed, is a snowclone, and indeed an old one: it's the 'got X?' formula that originated with a 1993 California Milk Board ad that ended with "got milk?". Snowclones, because most of what this computational narratology seems to be doing nowadays is substitutions like in snowclones.

And, in fact, I had a starting point. All programmers are lazy, and I had where to start from: a "generator of post-modernism" that I wrote back in 2008, my first attempt at JavaScript, essentially translating into Brazilian Portuguese and expanding the famous Postmodern Essay Generator (you can still find my work here -- it keeps amazing me, and it is a statement on the quality of academic writing in the humanities, how many people write me to say that they loved it).

The original code is a bit messy (I didn't want to spend time learning how to write a proper parser in JavaScript, and thus just went with dumb string replacements), and as a result of my idea of converting it into Python for this project it got even messier. But I have a bare-bones system that allows me to test how this kind of narration would work, while I develop a better language for the generative grammar and the so-needed parser. While it has its problems (like the possibility of getting into an infinite loop), the language of the Tzara engine, as I had called my dumb JavaScript replacements, already has some interesting features: named variables, declaration of constants, on-the-fly evaluation.

I had my engine but now, what should I ask the system to write? A detective novel? A Bildungsroman? An historical novel? Fantasy or science fiction? Comics?

No comments:

Post a Comment