Pizza Clones

pizza

Here’s yet another Twitter bot: Pizza Clones. Every two hours it generates a joke in the form of “Every {NOUN} is a(n) {ADJECTIVE} {NOUN} when/if/as long as {SUBORDINATE-CLAUSE}.” Some sample output:

It’s an attempt to imitate and elaborate on the joke “Every pizza is a personal pizza if you try hard enough and believe in yourself.” That joke in particular is hard to attribute to one person (appearing on Twitter here as early as 2010, more recently here and here), but the general syntactic pattern is found in well-known bits by Mitch Hedberg (“every book is a children’s book if the kid can read”) and Demetri Martin (“every fight is a food fight when you’re a cannibal“).

The bot works by first searching Twitter for tweets containing a phrase in the format “this isn’t a(n) {ADJECTIVE} {NOUN}” and then using a Pattern search to identify and extract the ADJECTIVE and NOUN. It then searches Twitter for phrases that match the string “{NOUN} if” (and “{NOUN} unless”, “{NOUN} as long as”, etc.), and extracts the rest of the clause following the “if.” (There’s some more NLP behind the scenes to ensure that the “if” clause will fit the joke syntax.) Then it jams the NOUN, ADJECTIVE and subordinate clause into the format of the joke and tweets it out to the world. It does this every two hours. Links to the tweets from which the substance of the joke was extracted are included in the body of the tweet, for attribution purposes. The bot keeps a small database of previously used clauses to prevent it from repeating itself too frequently.

I’ll admit that this is a pretty obscure joke, but I’m really happy with the output. The noun—occurring both in the adjective/noun pair and adjacent to the “if” clause—gives the jokes a semantic anchor, but the fact that the text is grabbed from two different tweets (and two different contexts) keeps the jokes surprising and weird. I’m also pleased at how almost all of the tweets feel grammatical, given the limited degree of NLP involved in the procedure. Follow Pizza Clones on Twitter!

Reply