After a long hiatus, in-person hackathons are finally back! Although online hackathons are a passable replacement, I was excited to be returning to Cambridge to get on with some good old-fashioned hacking.
The Cambridge corn exchange in all its glory
This time around, the inspiration for our project hit as we were struggling to think of a project idea – difficulty thinking of ideas is a problem we all share, and where there’s a shared problem there’s also the potential for needless automation! Thus “Mockathon” was born, a system which would generate project ideas and full presentations, requiring only a simple questionnaire from the participant.
Implementing this project required us to glue together a fair few components. ZeroMQ works wonderfully for this sort of thing, providing APIs in a number of languages to make it as simple as possible to handle messaging between applications. We set up everything in separate Docker containers, using docker-compose to ensure containers had the correct volumes mounted and networks connected – everything gets spun up with a single command.
The user is presented with a series of Very Important Questions™ to figure out the type of project desired, the answers to which are fed to the next stage of the pipeline.
Please answer all of the questions honestly, or the questionnaire won’t work properly
The generator actually comes in two parts – the first of these is a “mad libs” style generator that takes the desired project area and technologies and generates a quick project heading and subheading based on a series of random word lists. It also generates nicknames for each of the team members. This code can be found here.
The second part is more interesting, taking the heading generated by the previous stage and feeding it into the GPT-2 language model, finetuned on a dataset of previous hackathon projects posted on Devpost. The resulting output was usually formatted in the format of a Devpost entry, allowing us to pull out the headings to generate the project slides in the next stage. In the event that it was not correctly formatted we simply ran the model again, rerolling until a correctly formatted output was generated.
We threw together a number of bogus charts to include with the presentations, as well as including free “corporate art style” graphics from unDraw. We used Pixabay to grab random background images for each project, as well as profile pictures for each user.
Generating groundbreaking new ideas using AI
It took a lot of coffee and not a lot of sleep to get this thing finished, but we somehow managed to pull through in time. Once things were up and running we started churning projects and presentations as fast as we could, just in case things fell over again before the end of the hackathon. Thankfully, everything kept working all the way through and we were able to show our project to the other hackers, and then later on present on stage!
The generated projects were all very funny, and we had great fun showing it to the other hackers and letting them generate their own projects using our code. You can check out a few PDFs of the presentations generated here!
The source code of the project is available here, and you can try out the questionnaire from the project here. This one won’t generate the presentations for you (running the model would cost me more than the joke would be worth) – if you want to generate your own top-tier project ideas/presentations, try hosting it yourself! The trained model hasn’t been included with the repo but it should be fairly straightforward to rerun the training yourself.
Overall this project was great fun, reminding me of the joys of making something silly for no particular purpose, just for the fun of it. I’m looking forward to making some more silly projects in the future, especially as in-person hackathons become commonplace again.