Knock, Knock, AI: How Artificial Intelligence Learns to Write Jokes
A Robot Knocking a door to tell a Knock-Knock Joke

Knock, Knock, AI: How Artificial Intelligence Learns to Write Jokes

Imagine you are trying to build a program that can write "Knock-Knock" jokes. Now there are two ways you can do this, you can choose the classical Rule-based Programming approach or the unconventional AI approach. Let us look at both the approaches.

Rule-based Programming

In this approach, we have a template of the joke and we just have some variables, which fit in to complete the joke.

No alt text provided for this image
Rule Based Knock-Knock Joke Template

Now with a set of names and punchlines, allows it to generate "Knock, Knock" jokes. This program is limited though, as it is only capable of producing jokes based on the input we have given it. However, an AI approach offers a solution to this problem, as it can generate original jokes beyond the initial inputs given to it.

Training AI to write a Knock Knock Joke

We are going to look at a use case, an AI created by Janelle Shane mentioned in her book "You Look Like A Thing and I Love You" and it's journey of writing knock-knock jokes.


When employing an AI approach, the program must learn the rules of constructing "Knock, Knock" jokes on its own. At first, the generated jokes may appear nonsensical, as the AI lacks a basic understanding of the English language, yet it is tasked with creating jokes. The AI may produce something along the lines of "qasdnw,m sne?msod", having some concept of using a question mark once. The AI will gradually improve its guessing accuracy as it gains more experience. However, there is a limit to how much the AI can change its output, as we cannot afford to memorize every new piece of text it produces.

No alt text provided for this image
This is the initial version of the joke the AI makes

With each iteration, the AI adjusts its joke formula to enhance the accuracy of its guesses. It starts with basic concepts such as including a question mark and using vowels and apostrophes.

No alt text provided for this image
Now the joke contains apostrophes and commas

Then it may stumble upon the delightful discovery that the letter "o" is often followed by "ck" - a moment of pure gold. The perfect joke right now is

No alt text provided for this image
"ck" followed by "o"

Then it tweaks it a little bit and this comes out

No alt text provided for this image
A bit more better one
No alt text provided for this image
Continuation of previous joke

In a matter of minutes, the AI is able to make significant progress in its joke-writing formula. However, there is still some confusion when it comes to determining who is telling the joke to whom, leading to a longer period of adjustment for this aspect of the formula.

No alt text provided for this image
Who is telling the joke?

Soon it figures out the formula for the jokes, but no actual words.Sometimes it gets carries away with the length of punchline too.

No alt text provided for this image
Punchline becomes toooo long

Then it learns about the cow with no lips joke

No alt text provided for this image
The cow with no lips joke

According to AI this is comedy gold. Soooo

No alt text provided for this image
Another joke containing cow with no lips
No alt text provided for this image
continuation of previous joke

Eventually (maybe reluctantly), it tones down on the cow, but has the problem similar to that of two ppl telling knock-knock jokes on a bad phone connection

No alt text provided for this image
Two people telling knock knock jokes on a bad phone connection

At last, it figures out the structure and writes a partially plagiarised joke from the training data set

No alt text provided for this image
Partially plagiarised jokes
No alt text provided for this image
Partially plagiarised jokes

Then it produced an actual joke of it's own

No alt text provided for this image
An actual joke written by the AI


Soooooo

While the AI has made significant progress in generating "Knock, Knock" jokes, it still does not have a complete understanding of the nuances of the English language and puns. However, the freedom that AI possesses - the ability to experiment with a vast range of possible character combinations - enables it to come up with new and innovative joke ideas that may not have been possible through traditional rule-based programming methods. This approach is akin to the Infinite Monkey Theory, which suggests that a monkey randomly typing on a typewriter for an infinite amount of time will eventually produce the complete works of Shakespeare.


Reference

"You Look Like A Thing And I Love You" by Janelle Shane

要查看或添加评论,请登录

Anurag Pola的更多文章

社区洞察

其他会员也浏览了