Our team originally was working on something else, but Saturday at 6pm we discovered it was infeasible and disbanded. So I decided to work on something I'm interested in - neural nets - for the rest of the time. I didn't think I'd actually build something demo-able. I wanted to generate text that sounds like Obama's speeches, because I've seen way too many Trump themed hacks. I proceeded to build on top of it and @pseudoObamaBot was born.

What it does

It reads in some tweets by Trump and at random decides to tweet about it, the way that Obama might tweet about it.

How I built it

I trained a LSTM recurrent neural net with Obama speech transcripts I copied from a website (in total 1.5MB file). After training for 7 hours on my quad core i7 2.6Hz laptop, I generated a 2.5Mb file from the neural net and fed it to a marvok model. The marvok model also took "tags" to direct somewhat the text that was outputted. So I ran some Trump tweets through indico's keyboard API and fed those keywords with a high enough score as the input for the marvok model. This generated tweets.

Why I Used the Output of a Neural Net as input for another ML Model?

I wanted to see the markov model use completely machine generated text as an input. I thought it was interesting, and I got to learn about both models.

Challenges I ran into

  • the neural net took a long time to run, but in the end the output was pretty decent.
  • ObamaBot got banned from twitter, because at first I let it retweet everyone who has a tweet to "@DonaldTrump". So my bot's write permissions were denied.
  • Some of Trump's tweets made my bot a little crazy

Accomplishments that I'm proud of

First time using neural nets, markov model, and twitter, and made something work! (Although I've been reading on the theory behind neural nets / other ml stuff etc for a couple weeks)

What I learned

Start small. Start from what you're interested in :)

What's next for ObamaBot

  • Make ObamaBot into a facebook messenger application, so you can have a conversation with it.
  • Refine the training parameters and train further, the neural net sometimes still spells gibberish words

Built With

  • indico-api
  • marvok
  • python
  • recurrent-neural-net
  • twitterbot
Share this project: