One of my favourite TV shows is NBC’s The Office. A fan favourite, and on TV for many years, this show never fails to make me laugh, even after I watch the series for the 9th time.
With a bit of free time on my hands, I decided to mess around with some AI Chatbots. Using the ChatterBot python library, some transcript data from the office episodes, and a few APIs, I spent a Sunday afternoon with a little bit of machine learning and a whole lot of fun.
After installing and setting up the ChatterBot library, I needed to get some data to train it. Using some transcripts of the office episodes I found on the internet, I wrote a short script to clean the data and store each new line as an array in JSON.
I then left it to train for a little while, and when I returned from lunch with friends, I had a fully functioning chat bot. The next thing to do was to connect it to some social media.
Once I confirmed it was working, I let it do it’s magic for an afternoon, checking on it occasionally, and stepping in when things got out of control.
A few people messaged me that afternoon and the bot responded. Here are a few highlights (blue is me / the bot, and names have been altered). I only trained it on the first two seasons, but I’ve got plans to include all soon.
Roy Is My Mom
He Just Wants To Be Alone