Transcript
Page 1: [IEEE NAFIPS 2005 - 2005 Annual Meeting of the North American Fuzzy Information Processing Society - Detroit, MI, USA (26-28 June 2005)] NAFIPS 2005 - 2005 Annual Meeting of the North

NAFIPS 2005 - 2005 Annual Meeting of the North American Fuzzy Information Processing Society

Approximate Joke SimilarityJulia M. Taylor

Applied Artificial Intelligence LaboratoryUniversity of CincinnatiCincinnati, Ohio, USAtayloj8(email.uc.edu

Abstract - Some jokes are funnier than others. How toalgorithmically recognize the appropriate degree of funniness ofjokes is not clear. We propose to establish a funniness level of anew joke based on a set of central jokes that contain jokes thatare somewhat similar to the new one. Each joke of the central setcan be associated with some funniness value. Funniness of a newjoke can then be computed based on its similarity value with aknown joke and a funniness value of a known joke. Thesimilarity value of two jokes can be established from one ofhumor theories.

I. INTRODUCTION

Some jokes are funnier than others. To some degree,jokes often appear to be similar to each other. Sometimes,they are similar in how funny they are. This similarity isnecessarily imprecise as it depends on the vagaries of humanperception and our understanding of natural languageprocessing.

We suggest that it might be possible to prototypicallyrecognize the similarity of jokes using fuzzy measures. Itmight be possible to group jokes together so that a respondentwould consider them to be equally funny.

Knowing whether a person would like a joke at a giventime is almost an impossible task. However, it may be possibleto tell if a person would like a joke if it is known that thisperson likes jokes similar to this one. It has been asserted thatthe similarity of two jokes can be measured by applying aparticular humor theory. Our belief is that soft computingmay be able to supply a similarity metric as fuzzy logic has along tradition of dealing with linguistic variables [11].

Humor similarity metric is necessarily imprecise forseveral reasons: the imprecision of how funny a joke is, thedifficulty of determining how semantically similar any twonatural language utterances are, and the inherent ambiguity ofnatural language.

Algorithmic humor recognition is not easy. First, itrequires natural language understanding and world knowledge.Additionally, whether or not it is possible to study thehumorous aspect of a joke in isolation from its political orcultural implications is an open question [8]. Different peoplehave different sense of humor. This means, that the same jokemay be funny to some people and not funny to others. Lastly,the same joke may or may not be funny to the same persondepending on this person's mood.

Lawrence J. MazlackApplied Artificial Intelligence Laboratory

University ofCincinnatiCincinnati, Ohio, USA

[email protected]

The issue of whether people can be grouped according totheir taste in humor has been addressed by Goldberg [5].Goldberg's "Jester" is an online-joke recommending system',based on collaborative filtering. A user is given fifteen jokesto rate; after the rating is done, the system uses statisticaltechniques to recommend jokes based on the user's rating ofthe sample. It finds a "nearest neighbor" to the user's choices,and recommends the next joke from the list of the nearestneighbor. The program does not use any linguistic theories ofhumor, but does take into account a user's sense of humor. Asit turns out, "Jester" does not give accurate recommendations.It makes sense; since if there is a Person1 who likes jokes incategories JokeCategory1 and JokeCategory2, and anotherPerson2 who likes jokes in category JokeCategoryl, it does notimply that a Person2 likes jokes in JokeCategory2.

We are not interested in grouping people by their taste inhumor. Instead, we are interested in comparing jokes ratherthan comparing people's joke preferences.

II. HUMOR THEORIES

It is difficult to compare something without defining it.For the purposes of this paper, a joke is defined as a shorthumorous narrative where the funniness culminates in thefinal section [6]. A joke typically consists of a setup and apunchline. The setup is often the larger part of the joke thatprepares a reader's expectations. The punchline is an anomalyand breaks the expectation created by the setup.

According to Script-based Semantic Theory of Humor(SSTH) [7], there are two necessary and sufficient conditionsfor a text to be humorous:

* A text has to be compatible, fully or in part, withtwo different scripts.

* The two scripts with which the text is compatibleare opposite, and must overlap fully or partially.

A script is defined as "an enriched, structured chunk ofsemantic information, associated with word meaning andevoked by specific words" [7]. This definition of a script isnot enough for a computational implementation of jokerecognizer. It is enough to look at scripts as cognitivestructures for a human to understand how jokes work and howthey can be compared.

1 http:llshadow.ieor.berkeley.edu/humor/

0-7803-9187-X/05/$20.00O 2005 IEEE. 145

Page 2: [IEEE NAFIPS 2005 - 2005 Annual Meeting of the North American Fuzzy Information Processing Society - Detroit, MI, USA (26-28 June 2005)] NAFIPS 2005 - 2005 Annual Meeting of the North

For example, according to Script-based Semantic Theoryof Humor, Joke, is a joke because two scripts, Lover andPatient, oppose and overlap.

Joke,: 'Is the doctor at home?' the patient asked inhis bronchial whisper. 'No,' the doctor'syoung and pretty wife whispered in reply.'Come right in.'

III. GENERAL THEORY OF VERBAL HUMOR

The General Theory of Verbal Humor [1] is a linguistictheory of humor that makes it possible to compare jokes. Thetheory describes jokes in terms of six features or knowledgeresources [2]:

* Script Opposition (SO): deals with scriptopposition presented in SSTH.

* Logical Mechanism (LM): accounts for the way inwhich the two scripts in the joke are broughttogether.

* Situation (SI): the "props" of the joke, the textualmaterials evoked by the scripts of the joke that arenot necessarily funny.

* Target (TA): any individual or group from whomhumorous behavior is expected.

* Narrative Strategy (NS): The "genre" of the joke,such as riddle, 1-2-3 structure, question andanswer, etc, it is rhetorical structure of the text.

* Language (LA): The actual lexical, syntactic,phonological, etc., choices at the linguistic levelthat instantiate all the other choices. Language isresponsible for the position of the punchline.

From the point of view of the General Theory of VerbalHumor, each joke can be viewed as a 6-element vector,specifying the instantiation of each parameter [9]:

Joke: {Language, Situation, Narrative Strategy,Target, Script Opposition, Logical Mechanism}

The only element that is optional in a joke description isTarget. Any text, humorous or not, should have Situation,Narrative Str-ategy, and Language. Only in a joke ScriptOpposition and Logical Mechanism features must be present.

Script 0 position

Logical Mechanism

Situationt.. s~~~~Li

Target

Narrative Strategy

LaniguageFig. I Hierarchical organization of features (knowledge resources)

of a joke

Two jokes are different if at least one parameter of the sixabove is different in the two jokes. The difference betweentwo jokes is directly proportional to the number of differentfeatures.

The six features are positioned as a hierarchy. Thehierarchy is shown in Fig. 1. The position in a hierarchy playsan important role in determining how different two jokes are.In other words, if two jokes differ in one feature, thedifference would be greater if the feature was higher in thehierarchy, as shown in Fig. 2.

Most similar jokes

LA NS TA SI LM SOLeast similar jokes

Fig. 2 Predicted similarity of two jokes with one differentfeature. [9]

The position was experimentally tested by Ruch [9]. Theresult was that there is a linear increase in similarity betweenpairs of jokes selected along the features hierarchy, with theexception of Logical Mechanism. This means, putting LogicalMechanism aside, jokes that have all the parameters the sameexcept for Script Opposition, are less similar than those thathave all the parameters the same except for Situation. Jokesthat have all the parameters the same except for Situation areless similar than those that have all the parameters the sameexcept for Target. Jokes that have all the parameters the sameexcept for Target are less similar than those that have all theparameters the same except for Narrative Strategy. Jokes thathave all the parameters the same except for Narrative Strategyare less similar than those that have all the parameters thesame except for Language. In addition, the larger the numberof parameters that the jokes have in common, the more similarthey are.

A feature's position in the hierarchy not only effects thejoke's similarity, but also the choice of hierarchy parameters:Script Opposition limits the choice of Logical Mechanism;Logical Mechanism limits the choice of Situation; Situationlimits the choice of Target; Target limits the choice ofNarrative Strategy; and Narrative Strategy limits the choice ofLanguage. For example, Dumb/Smart Script Oppositionwould determine the choice or Target.

To illustrate joke similarity according to General Theoryof Verbal Humor, lets look at the following two jokes:

146

Page 3: [IEEE NAFIPS 2005 - 2005 Annual Meeting of the North American Fuzzy Information Processing Society - Detroit, MI, USA (26-28 June 2005)] NAFIPS 2005 - 2005 Annual Meeting of the North

Joke2: What do you call 5000 lawyers chained at thebottom of the ocean? A good start.

Joke3: What do you call 5000 politicians chained atthe bottom of the ocean? A good start.

Both jokes have the same: Script Opposition(Acceptable/Forbidden), Logical Mechanism (Faultyreasoning), Situation (Chained people at the bottom of theocean), Narrative Strategy (Question and Answer), andLanguage; but a different Target: in Joke2 Target is lawyers,but in Joke3 it is politicians. The conclusion from GeneralTheory of Verbal Humor is that both jokes are very similar asthey only differ in one parameter.

Let's look at another joke:

Joke4: Do you know what you call 5000 lawyerschained at the bottom of the ocean? You call ita good start.

Joke4 has the same parameters as Joke2 except forLanguage. The conclusion from General Theory of VerbalHumor is that Joke2 and Joke4 are very similar since they onlydiffer in one parameter. However, as Language comes afterTarget in the hierarchy, we can also conclude that Joke2 andJoke3 are less similar than Joke2 and Joke4. On the other hand,Joke3 and Joke4 have two different parameters, namely, Targetand Language. They have less similarity that Joke2 and Joke4or Joke2 and Joke3.

Consider another joke:

Joke5: How many lawyers does it take to change alight bulb? You won't find a lawyer who canchange a light bulb. Now, if you are lookingfor a lawyer to screw a light bulb...

Joke5 has the same Target as Joke2 and Joke4. But, theother 5 features are different. Therefore, Joke5 has very smallsimilarity value to Joke2 or to Joke4.

IV. JOKE COMPARISON

The General Theory of Verbal Humor provides a basis forjoke comparison. The comparison is likely to be non-metricand approximate. The Script-based Semantic Theory ofHumor provides capability to identify if a given text is a joke.Having these two theories working together, it is possible notonly to identify jokes. Once the joke is identified, to see howdifferent the new joke is from other known jokes in the text,using the six features or knowledge resources.

Suppose we have a set of known prototypically centraljokes. Central jokes can be defined as jokes that most peopleagree as funny. These jokes can be categorized according totheir features, and the results can be entered into a database.Then, any candidate text can be compared to the jokes in theset. It is likely that one of the jokes in the set will be moresimilar to a given candidate text than the others. For example,Joke5 has higher similarity to Joke2 than to Joke3 as Joke5 and

Joke3 share less features than Joke5 and Joke2, as illustrated inFig. 3.

Depending on the degree of similarity to one of thecentral jokes from the set, it may be possible to establish howfunny the candidate text is. This means that if Joke2 is in thecentral set, we can establish funniness of Joke3. Notice thatJoke5 will not get a high funniness value if it can only becompared to Joke2 or Joke4. Ideally, a central jokes set wouldcontain jokes covering many different subjects and situations,so Joke5 would have a better match.

Joke2 Joke3 Joke5

Script OppositionAcceptable/ Acceptable/ Servant!Forbidden Forbidden OperatorFaulty Faulty

Logical Mechanism . Garden pathreasoning reasoning

Chained Chained

Situation people at the people at the Changing a

bottom of the bottom of the light bulbocean ocean

Target Lawyers Politicians Lawyers

Question and Question and QuestionAnswer Answer and Answer

Language Language, Language, Pun

Fig. 3 Feature comparison of Joker Joke3 and Joke5

All jokes from the central joke set do not have to beequally funny. For example, Joke2 may not be as funny asJoke5. An approximate funniness value can be assigned toeach joke from the starting set when they are entered into thedatabase. Then, candidate jokes can be looked at not only interms of similarity to known jokes, but also in terms offunniness. This means that jokes that have none of the sixfeatures in common can still be compared based on thefunniness values.

It is possible to view any text as a 6-tuple. If the ScriptOpposition feature is absent, the text is not a joke. Regardlessof whether a text is a joke or not, it can be entered to thedatabase for the purpose of comparison with other texts orjokes. The funniness value of a non-joke is 0. It should benoted that the absence of Script Opposition may result in theabsence of a Logical Mechanism.

After both central jokes and regular texts are entered intothe database, other jokes or text can be compared to them. Itwould be possible to find degree of similarity of test text orjoke to central jokes or non-jokes from the database; however,the similarity will not tell whether the test is a text or a joke.

For example, Text, can be viewed in terms of six features,but it is difficult to say if it is a text (and not a joke) or if it is avery bad joke.

147

Page 4: [IEEE NAFIPS 2005 - 2005 Annual Meeting of the North American Fuzzy Information Processing Society - Detroit, MI, USA (26-28 June 2005)] NAFIPS 2005 - 2005 Annual Meeting of the North

Text,: What do you call 5000 lawyers chained at thebottom of the ocean? A tragedy at sea.

Let us compare Text1 to Joke2 (see Fig. 4). It has the sameSituation as Joke2: Chained lawyers at the bottom of theocean; same Target: Lawyers; same Narrative Strategy:Question and Answer; and same Language. But, there is noScript Opposition in Text1. There is also no obvious LogicalMechanism. This means that Text1 and Joke2 have only twodifferent features, but it still does not say whether Text, is ajoke or not.

Joke, Text,

Script Acceptable/ Forbidden NoneOpposition

Logicalichanism Faulty reasoning NoneMechaniism

Sit.iatioi Chained people at the Chained people at theSituationl

bottom of the ocean bottom of the ocean

Target Lawyers Lawyers

NarrativeStrategy

Question and Answer Question and Answer

Language Language, Language1

Fig.4 Feature comparison of Joke2 and Text,

V. FUZZY SETS

It may be easier to answer whether Text1 is a joke or anon-joke using fuzzy membership functions over the six jokefeatures. A membership function of the set of Jokes or the setof Non-jokes could be defined in terms of a number of sharedfeatures in two jokes, two non-jokes, or a joke and a non-joke.

Suppose Joke2 has the highest similarity to Text1 of allknown jokes in our database. If all features in the feature setwere independent, we could say that Text1 belongs to classJokes with membership of 0.66 as there are six features andJoke2 and Text1 have four features with the same value. Therule can be written such that if a jokeA and a candidate textBdiffer in n features, the candidate textB belongs to the classJokes with membership of (1-1/n). The range of n is from 0 to6 as each joke has 6 features. The degree of membershipdecreases with the number of different features.

On the other hand, if a non-jokec and textB have mfeatures in common and non-jokec has the highest similarity totextB from all known non-jokes then the candidate textBbelongs to class Non-Jokes with membership of (1-1/m). Therange of m is from 0 to 5, as non-jokes should not have ScriptOpposition.

However, the features are not independent: LogicalMechanism depends on Script Opposition, Situation dependson Logical Mechanism, etc. It may be possible to assignweights to features, such that the weight of Script Oppositionis the highest of the six weights, the weight of Logical

Mechanism is higher than the weight of Situation. The weightof Situation is higher than the weight of Target. The weight ofTarget is higher than the weight of Narrative Strategy. Theweight ofLanguage is the lowest.

We can then define a membership function of the set ofJoke as:

JokeSimilarity(ScriptOpposition)*weightI +JokeSimilarity(LogicalMechanism)*weight2 +JokeSimilarity(Situation)*weight3 +JokeSimilarity(Target)*weight4 +JokeSimilarity(NarrativeStrategy)*weights +JokeSimilarity(Language)*weight6

Similarly, a membership function of the set of Non-Jok-escan be defined as:

JokeSimilarity(LogicalMechanism)*weightI +NonJokeSimilarity(Situation)*weight2 +NonJokeSimilarity(Target)*weight3 +NonJokeSimilarity(NarrativeStrategy)*weight4 +NonJokeSimilarity(Language)*weights

A text that has a high degree of membership with a mostsimilar member of Non-Jokes set and a low degree ofmembership with a most similar member of Jokes set will beconsidered a non-joke. Similarly, a text that has a high degreeof membership with a most similar member of Jokes set and alow degree of membership of a most similar member of Non-Jokes set will be considered a joke.

Fuzzy sets can be used to find jokes with the highestsimilarity. Consider Joke6:

Joke6: How many politicians does it take to change alight bulb? Two. One to assure the publicthat everything possible is being done to solvethe problem, and one to screw the light bulbinto the water faucet.

Joke6 and Joke5 are light bulb jokes. Joke3 and Joke6 arejokes about politicians. Should Joke6 be grouped with Joke3 orJoke5? In other words, is Joke6 has higher similarity withJokel or Joke3?

Fig. 5 compares features of Joke 3, Joke5 and Joke 6 Asshown in Fig. 5, all three jokes have different ScriptOpposition, Logical Mechanism, and the same NarrativeStrategy. Joke5 and Joke6 have the same Situation, while Joke3and Joke6 have the same Target and Language.

A membership function can be defined on the number ofsimilar features of Joke6 and jokes that are in the set Jokes.Suppose, set Jokes has only two members: Joke3 and Joke5.Joke3 and Joke6 have three features in common: Target,Narrative Strategy and Language. Joke5 and Joke6 have twofeatures in common: Situation and Narrative Strategy. Thismeans that Joke3 has a higher degree of membership thanJoke5.

148

Page 5: [IEEE NAFIPS 2005 - 2005 Annual Meeting of the North American Fuzzy Information Processing Society - Detroit, MI, USA (26-28 June 2005)] NAFIPS 2005 - 2005 Annual Meeting of the North

Joke3 Joke5 Joke6

Acceptable/ Servant/ Dumb/Forbidden Operator Smart

Logical Mechaniism Faulty Garden path Vacuousreasoning reversal

Chained

Situation people at the Changing a Changing abottom of the light bulb light bulb

ocean

Target Politicians Lawyers Politicians

Question and Question and Question andAnswer Answer Answer

Language Language1 Pun Language,

Fig. 5 Feature comparison of Joke3, Joke5 and Joke6

The features do not have to be exactly the same for twojokes to be similar. For example, suppose the Target of Joke3is not "Politicians," but "People in politics" (see Fig. 6). Thenthe similarity of Target feature of Joke3 and Joke6 may bemeasured with fuzzy sets. The result of the fuzzy union ofJoke3 and Joke5 from Fig. 6 is Joke5. Note, that counting thenumber of matching features for Joke3, Joke5 and Joke6 in Fig.6 would result in both Joke3 and Joke5 being equally similar toJoke6.

Joke3 Joke5 Joke6

ScriptOpposinAcceptable/ Servant! Dumb!Forbidden Operator Smart

Logical Mechanism Faulty Garden path Vacuousreasoning reversal

Chained

Situationa people at the Changing a Changing abottom of the light bulb light bulb

ocean

People inTarget Politics Lawyers Politicians

Question and Question and Question andAnswer Answer Answer

Laniguage Language, Pun Language,

Fig. 6 Feature comparison of Joke3 (different target), Jokesand Joke6

It is likely that people that like jokeA will also like jokeB ifjokeA and jokeB are similar enough. This means that if aperson identifies several jokes that he/she likes, it may bepossible to find many other jokes that this person will likebased on the similarity measure. It also means that if weassign funniness values to jokes in the central set, we can

assign a prototypical funniness level to jokes that are similarto jokes in the central set, based on the similarity value and thefunniness of the prototype joke.

VI. SUMMARY AND CONCLUSION

Jokes often appear to be similar to each other.Sometimes, they are similar in how funny they are. Thissimilarity is necessarily imprecise as it depends on thevagaries of human perception and our understanding of naturallanguage processing. It might be possible to prototypicallyrecognize the similarity of jokes using fuzzy measures; and,group jokes together so that a respondent would consider themto be equally funny. In this paper we propose:

* To establish a funniness level of a new joke basedon a set of central jokes that contain jokes that aresomewhat similar to the new one.

* To recognize jokes based on similarity of acandidate joke with known jokes.

It has been asserted that the similarity of two jokes can bemeasured by applying a particular humor theory. Candidatejokes can be compared to a known set of jokes based on sixfeatures. Our belief is that soft computing may be able tosupply a similarity metric for jokes. A candidate text isconsidered a joke if there is high similarity between the textand at least one known joke.

REFERENCES[1] S. Attardo and V. Raskin "Script Theory Revis(it)ed: Joke Similarity

And Joke Representation Model," HUMOR: Internatio7tal Journial ofHumor Research, 4:3-4, 1991, pp. 293-347

[2] S. Attardo Linguistic Th7eories of Humor, Mouton de Gruyter, Berlin,1994

[3] S. Attardo Hunmorous Texts: A semanitic anid pragmatic analysis, MoutonDe Gruyter, Berlin, 2001

[4] S. Attardo, D. H. Attardo, P. Baltes and M. J. Petray "The LinearOrganization of Jokes: Statistical Analysis of Two Thousand Texts"HUMOR: Iiiternational Journ7al ofHumor Research, 7:1, 1994, pp. 27-54

[5] K. Goldberg, T. Roeder, D. Gupta and C. Perkins "Eigentaste: AConstant Time Collaborative Filtering Algorithm," InformnationRetrievalJournal, 2001, pp. 133-151

[6] R. Hetzron "On The Structure Of Punchlines," HUMOR: IilternationlalJournal ofHumor Research, 4:1, 1991, pp. 61-108

[7] V. Raskin The Semanztic Mechanisms Of Humour, Reidel, Dordrecht,The Netherlands, 1985

[8] G. D. Ritchie "Overview of Humour Research" Presentation at 4thInternational Summer School of Humour and Laughter, 2004

[9] W. Ruch, S. Attardo and V. Raskin "Towards An Empirical VerificationOf The General Theory Of Verbal Humor," HUMOR:InternationaUJournal ofHumor Research, 6:2, 1993, pp. 123-136

[10] W. Ruch, ed. The Sense of Humor: Explorations of a PersonalityChar-acteristic, Mouton de Gruyter, New York, 1998

[11] L. A. Zadeh, "The concept of a linguistic variable and its applications toapproximate reasoning-I," Information Sciences, vol. 8, 1975, pp. 199-249

149


Recommended