Inspiration

In British politics, politicians stick to a pre-rehearsed script and parrot slogans - they're a bit too robotic. So we decided to make a couple of parody Twitter bots in time for the upcoming General Election.

What it does

Uses a recurrent neural network to generate tweets both of its own volition and in response to 'mentions'. It also occasionally likes, retweets and follows other users according to a probabilistic model.

How I built it

We implemented a Recurrent Neural Network in Tensorflow, and then trained it on data from Parliamentary debates, and election manifestos and speeches. We also built a class using the twitter API to use twitter like an actual user, and built a script to generate messages/responses and tweet them out. We then use a Google Cloud server to run that script every 5 minutes.

Challenges I ran into

Finding appropriate training data for the neural net, trying to generate coherent and relevant responses from that data, and running the python script repeatedly on a server.

Accomplishments that I'm proud of

Both Twitter bots are actually funny, and we've had to very quickly become familiar with the Twitter API, Tensorflow, and running python scripts on a server. The bots behaviour in terms of retweeting/following other users is exactly as we hoped it would be.

What I learned

How to train a recurrent neural network; how to use the Twitter API and make authorised requests using python scripts; how to run python scripts on a server.

What's next for Holmes of Commons (Twitter Bots)

We would like to continue to improve the training of the neural nets, to improve the relevance of its responses according to the content of tweets directed to it. Hopefully the accounts will start to engage with more users as the General Election continues

Built With

Share this project:

Updates