Some hon. members: Oh, oh!

A while ago, someone said something on twitter and replied with “Some hon. members: Oh, oh!” For some reason (probably because I am a gigantic nerd, I thought this was hilarious and looked up what other interesting tidbits or convention were transcribed into Hansard.

If interjections give rise to a call for order by the Speaker, they are reported as “Some hon. members: Oh, oh!”
Hansard — Wikipedia

For my computational linguistics project I wanted to play around with Hansard as a corpus. I used the database, which has all the statements made in the House that are available online (so since 1993) and has some convenient metadata. So I proceeded to dump the statements in the database, categorized by stuff like party or whether it was the Speaker speaking. Each statement had some metadata indicating who spoke and has a ton of information about each Member of Parliament that’s scraped from PARLINFO.

While I was doing this, I remembered the “Some hon. members” stuff and wondered whether they had an id so I could dump all of those statements out. It turns out that statements by “Some hon. members” or “An hon. member” aren’t linked to a particular member or politician, even a placeholder one. That’s okay, since it was possible to grab all of that stuff with a query on the name instead of an indexed id.

Now I have all of these statements sitting around without context, so the obvious thing to do is to make a twitter bot.

How it actually works isn’t complicated at all. Everything just sits in a giant text file and a script pulls a line from the file at random once every hour. Since the vast majority of things that Some hon. members say are things like voting (yea or nay or agreed) or interjections (oh, oh or hear, hear), that’s what’ll show up most of the time.

I’ve also included things that An hon. member will say, so occasionally, there will be random heckling showing up. Because, you know, non sequiturs on twitter are hilarious. These are sometimes longer, so I made it randomly pull out a chunk of the statement, which has questionable results.

To be honest, I wanted to do something for Toronto City Council at first, which was why I asked around #TOpoli for something Hansard-like for council. Unfortunately, that doesn’t exist, so unfortunately, all of the amazing possibilities for council bots will go unrealized. On the other hand, there are a few more ideas I have for all of this Hansard stuff. And of course, there’s my actual project to hopefully look forward to as well.

Anyway, I’m glad people are enjoying it.