Introducing Eureka Invention Generator

I just submitted a little web app I’ve been working on this summer for Sunlight Labs’ Apps for America 2 programming challenge. The idea of the contest is to build an app around one of the datasets provided by our friendly US government on the new Data.gov website. My app is called Eureka and it generates inventions.

Eureka Invention Generator

The app is built around a Markov processor assignment I had last quarter in a programming languages course. Essentially the program uses Markov chains and a binary tree of n-grams to generate random text based on word frequencies of whatever source text you feed it. In effect, the generated text is babble in the language of whatever source document you input.

I had a lot of fun playing with the program last quarter. I’d give it the history of America as a text file and get to read about English settlers crossing the Delaware under siege by the Confederate army. Or noticing how randomly-generated text in the language of the Bible wasn’t really any easier to read than the real thing.

After hearing about the Apps for America 2 challenge, I spent a few weeks scoping out datasets on Data.gov and thinking about ways to use them. I zeroed in on the XML files of US patent application bibliographic data and eventually connected the dots back to the Markov processor assignment.

The contest entry page for Eureka can be viewed here. All source code is available on GitHub. This includes some shell and Python scripts to validate and parse the XML, a Ruby port of my Markov processor (originally in ML), and the website frontend of the app.

This post has 6 comments

  1. #1 aurelianNo Gravatar August 7, 2009

    awesome, really enjoyed my inventions. can you add permalinks or something so I can share the fun with my friends?

  2. #2 EvanNo Gravatar August 7, 2009

    At the moment, none of the inventions are stored, but I’ll keep your request in mind. Thanks!

  3. #3 SeanNo Gravatar August 7, 2009

    You should apply for a patent on this invention generator :)

  4. #4 Eric MillNo Gravatar August 8, 2009

    This is awesome, a great little creative entry to the contest. My main request is to have it generate a name for the invention, instead of just “Your invention”.

    Permalinks would be nice for particularly good ones. Maybe make it so you have to press a button to generate a permalink and store the existing one, so that you your database doesn’t fill up by visits alone.

    Incidentally, it’s not too late to add in things post-submission, with the caveat that you don’t know when it’s going to get judged, so make sure it stays working. If you’re worried about bugs, then just wait til the judging period is over.

  5. #5 EvanNo Gravatar August 8, 2009

    @Eric: I’ve definitely thought about both those things. I was initially unsure what to use as header text for the generate pages. I decided to use something generic because generating a title that was relevant to the invention text would be tricky.

    I like the permalink idea. I’ll take a look at it tomorrow when I get some free time. Also, I want to add some kind of “invention pending” text and animation after you click the generate button. Getting the Markov processor to work on a sizable sample of text in a reasonable amount of time was the main hurdle I faced when developing the app. I think I found a happy median, but the ~13 second delay with no feedback isn’t exactly ideal.

    Thanks for the feedback and advice! I really appreciate it.

  6. #6 Alex RozanskiNo Gravatar November 6, 2009

    Very nice! An interesting idea and well designed and implemented.

Write a Comment

*
To prove that you're human, please enter this code
Anti-Spam Image