opening computational door on knock knock jokes julia m. taylor & lawrence j. mazlack applied...

26
Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

Post on 21-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

Opening Computational Door on Knock Knock Jokes

Julia M. Taylor & Lawrence J. MazlackApplied Artificial Intelligence LaboratoryUniversity of Cincinnati

Page 2: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

2

Introduction

This is an initial investigation into computational humor recognition using wordplay

The programLearns statistical patterns of textRecognizes utterances similar in pronunciation to a

given wordDetermines if found utterances transform a text into a

joke

Page 3: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

3

Restricted Domain: Knock Knock JokesLine1: “Knock, Knock”

Line2: “Who’s there?”

Line3: any phrase

Line4: Line3 followed by “who?”

Line5: One or several sentences containing

Type1: Line3

Type2: A wordplay on Line3

Type3: A meaningful response to a wordplay of Line3 or Line4

Page 4: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

4

Restricted Domain: Knock Knock JokesType1: Line3

--Knock, Knock--Who’s there?--Water--Water who?--Water you doing tonight?

Type2: A wordplay on Line3

--Knock, Knock--Who’s there?--Ashley--Ashley who?--Actually, I don’t know.

Type3: A meaningful response to a wordplay of Line4--Knock, Knock--Who’s there?--Tank--Tank who?--You are welcome.

Page 5: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

5

Experimental Design

Training set: 66 Knock Knock jokesEnhance similarity table of lettersSelect N-gram training texts

66 texts containing wordplay from 66 training jokesTest set:

130 Knock Knock jokes 66 Non-jokes that have similar structure to Knock

Knock jokes

Page 6: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

6

Similarity Table

Contains combination of letters that sound similar

Based on similarity table of cross-referenced English consonant pairs

Modified by:o translating phonemes to letters

o adding vowels that are close in sound

o adding other combinations of letters that may be used to recognize wordplay

Segment of similarity table

Page 7: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

7

Training Corpus

Training texts were entered into N-gram databaseNurse: I need to get your weight today.Impatient patient: 3 hours and 45 minutes.Wordplay validation: bigram table

(I need 1) (need to 1) (to get 1) (get your 1) (your weight 1) (weight today 1) (today end-of-sentence 1)

Punchline validation: trigram table(I need to 1) (need to get 1) (to get your 1) (get your weight 1) (your weight today 1) (weight today end-of-sentence 1)

Page 8: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

8

How It Works

Step1: joke format validation

Step2: computational generation of sound-alike sequences

Step3: validations of a chosen sound-alike sequence

Step4: last sentence validation with sound-alike sequence

Page 9: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

9

Step 1: Joke Format ValidationLine1: “Knock, Knock”

Line2: “Who’s there?”

Line3: any phrase

Line4: Line3 followed by “who?”

Line5: One or several sentences containing Line3

–Knock, Knock–Who is there?–I, Felix–I, Felix who?–I, Felix-ited!

–Knock, Knock–Who is there?–I, Felix–I, Felix who?–I feel excited!

Page 10: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

10

Step 2: Generation of Wordplay Sequences

Repetitive letter replacements of Line3

Similarity used for letter replacements

Resulting utterances are ordered

according to their similarity with Line3

Utterances with highest similarity are

checked for decomposition into several

words

Segment of similarity table

Page 11: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

Step 2: Generation of

Wordplay Sequencesa e .23

a o .23

e a .23

e i .23

e o .23

i e .23

k sh .11

l r .56

r m .44

r re .23

t d .39

t th .32

t z .17

w m .44

w r .42

w wh .23

Page 12: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

Step 2: Generation of

Wordplay Sequencesa e .23

a o .23

e a .23

e i .23

e o .23

i e .23

k sh .11

l r .56

r m .44

r re .23

t d .39

t th .32

t z .17

w m .44

w r .42

w wh .23

Page 13: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

Step 2: Generation of

Wordplay Sequencesa e .23

a o .23

e a .23

e i .23

e o .23

i e .23

k sh .11

l r .56

r m .44

r re .23

t d .39

t th .32

t z .17

w m .44

w r .42

w wh .23

Page 14: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

Step 2: Generation of

Wordplay Sequencesa e .23

a o .23

e a .23

e i .23

e o .23

i e .23

k sh .11

l r .56

r m .44

r re .23

t d .39

t th .32

t z .17

w m .44

w r .42

w wh .23

Page 15: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

Step 2: Generation of

Wordplay Sequencesa e .23

a o .23

e a .23

e i .23

e o .23

i e .23

k sh .11

l r .56

r m .44

r re .23

t d .39

t th .32

t z .17

w m .44

w r .42

w wh .23

Page 16: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

16

Step 2: Generation of Wordplay Sequences

a e .23

a o .23

e a .23

e i .23

e o .23

i e .23

k sh .11

l r .56

r m .44

r re .23

t d .39

t th .32

t z .17

w m .44

w r .42

w wh .23

Page 17: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

17

Step 3: Wordplay Validation

one word?

if el exited

divide into pairs

each pair in bigram?

Step 4Step 2

if elel exited

NO YES

NO YES

Page 18: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

18

Step 2: Generation of Wordplay Sequences

a e .23

a o .23

e a .23

e i .23

e o .23

i e .23

k sh .11

l r .56

r m .44

r re .23

t d .39

t th .32

t z .17

w m .44

w r .42

w wh .23

Page 19: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

19

Step 3: Wordplay Validation

one word?

i feel excited

divide into pairs

each pair in bigram?

Step 4Step 2

I feelfeel excited

NO YES

NO YES

Page 20: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

20

Step 4: Last Sentence Validation with Wordplay Wordplay is meaningful

Could occur

In the beginning of last sentence

In the middle of last sentence

At the end of last sentence

Page 21: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

21

Step 4: Last Sentence Validation with Wordplay In the beginning of sentence:

i feel excited

One word?

(wordplay N-1, wordplay N, punch1) in trigram?

(wordplay N, punch1, punch2) in trigram?

Step 2 joke

NO YES

YES

YES

NO

NO

Step 2

Page 22: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

22

Step 4: Last Sentence Generation with Wordplay

In the beginning of sentence:

i feel excited

Is there sentence in the training text with wordplay?

YES

Step 2 joke

NO

Page 23: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

23

Knock Knock Joke Generation

--Knock, Knock--Who’s there?--Ammonia--Ammonia who?--Ammonia …

Ammonia = I’m only

--Knock, Knock--Who’s there?--Ammonia--Ammonia who?--Ammonia trying to be funny

Page 24: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

24

Results

66 training jokes 59 jokes were recognized 7 unrecognized, no wordplay found

66 non-jokes 62 correctly recognized as non-jokes 1 found wordplay that makes sense 3 incorrectly recognized as jokes

130 test jokes 8 jokes were not expected to be recognized 12 identified as jokes with expected wordplay 5 identified as jokes with unexpected wordplay 80 expected wordplays found

Page 25: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

25

Possible Enhancements

Improve last sentence validationIncreasing size of text used for N-gram trainingParserN-grams with stemming

Improve wordplay generatorUse of phoneme comparison

Use wider domainAll types of Knock Knock jokesOther types of wordplay jokes

Page 26: Opening Computational Door on Knock Knock Jokes Julia M. Taylor & Lawrence J. Mazlack Applied Artificial Intelligence Laboratory University of Cincinnati

26

Conclusion

Initial investigation into KK joke recognition using wordplay

The program was designed toRecognize wordplay in KK jokes 67%Recognize KK jokes containing wordplay 12%

Alternate result of this program KK joke generator