SlideShare une entreprise Scribd logo
1  sur  56
1
Computational Humor
Thomas Winters
PhD Student at KU Leuven & FWO Fellow
@thomas_wint
thomaswinters.be
Can a machine have a sense of humor?
2
One you brush and rake,
the other you rush and brake.
What is the difference between
leaves and a car?
3
We asked the Belgian prime minister
for comment, but he was too busy
stockpiling firewood.
Belgian prime minister says the next
five winters will be difficult due less
energy supply.
4
Can a machine have a
sense of humor?
5
Part 1: Humor is
intrinsically human
6
Every known
human civilisation
has some form of
humor
Caron, J.E.: From ethology to aesthetics: Evolution as a theoretical paradigm for research on laughter, humor, and other comic phenomena. Humor15(3), 245–281(2002)
7
Purpose of Humor = Sign of Intelligence?
huh?
aha!
that’s
funny
Brain rewards noticing
incongruities and
successfully resolving them
+ linguistic skills
+ hard to fake display of
personal values
= Evolutionary advantage!
h
8
How does humor work?
9
Incongruity-Resolution Theory
Based on: Ritchie, G. (1999). Developing the incongruity-resolution theory.
Obvious
Interpretation
Hidden
Interpretation
Two fish are in a tank.
Says one to the other:
“Do you know how to
drive this thing?”
Setup
Punchline
10
Human-focused definition!
Machine should not only spot
two mental images
Obvious
Interpretation
Hidden
Interpretation
But also that it is
not too hard or too easy for a human!
11
Computational humor can help understand humor
We do not fully know how humor works
Artificial Intelligence can shed a light!
Humour
12
Humor co-creation
Grammarly / copy.ai but for jokes
13
Humor = AI-complete?
~ as hard as making computers as “intelligent” as people
14
Part 2: Computers can
follow humor instructions
15
Templates, Schemas, Grammars
Hard-coding a sense of humor
16
JAPE: Templates & Schemas
What’s <CharacteristicNP>
and <Characteristic1> ?
A <Word1> <Word2>.
Noun Phrase
Word1 Word2
Homophone1
Characteristic1 CharacteristicNP
What’s green and
bounces?
A spring cabbage.
spring (season)
to bounce
spring (elastic body)
cabbage
green
spring cabbage
Binsted, K., & Ritchie, G. (1994). An implemented model of punning riddles
17
Unsupervised Analogy Generator
I like my <X> like
I like my <Y>:
<Z>
I like my coffee
like I like my war:
cold.
Petrović, S., & Matthews, D. (2013). Unsupervised joke generation from big data
cold
war
coffee
Z
Y
X
Maximise adjective
dissimilarity
Maximise co-occurrence Maximise co-occurrence
Maximise # definitions
Minimize commonness
18
Talk Generator
Generates nonsense PowerPoints about any given topic
for presenters to improvise on
Winters T., Mathewson K. (2019). Automatically Generating Engaging Presentation Slide Decks
Try it yourself: talkgenerator.com
19
Slide generator
20
Statistical text generators
Demo
1. Open your smartphone keyboard (e.g. in notes)
2. Press on any suggested autocomplete
word
3. Press 10-20 times on a random suggestion
4. You’ve just generated a sentence using an
AI trained to sound similar to you! (if you squint your
eyes)
Autocomplete counted how often you used
certain words after other words in previously
typed texts  Statistical model
I have been trying
to get hold of my
client since the
last few days
21
Professor & Ex-rector KU Leuven
22
Fully automated Twitterbot that imitates Rik Torfs
Trained on his tweets & columns
23
Markov chain generator
1. Count in Rik Torfs tweets & columns how often
a word follows the previous 2-4.
2. Start with two real starting words of Rik, and
take random next words
“gevolgd door”
4: een
2: zijn
1: iemand
1: acht
Beste,
24
Humor Detection
25
Early Humor Detector
• Designed humor features e.g. alliteration, antonym, adult slang...
• Used Naive Bayes & Support Vector Machines
• Task: One-liners vs news, neutral corpus & proverbs
Mihalcea, R., & Strapparava, C. (2005). Making computers laugh: Investigations in automatic humor recognition.
26
But is this a good dataset?
News & proverbs have completely different types
of words than jokes!
 Looking at word frequencies is often already “enough”!
Is this really humor detection?
27
Jokes are fragile!
Two fish are in a tank. Says one to the other:
“Do you know how to drive this thing?”
men bar
Generate non-jokes by replacing keywords from other jokes!
Word-based features won’t work anymore!
Winters T., Delobelle P. (2020). Dutch humor detection by generating negative examples. BNAIC/Benelearn2020
28
Examples of generated Dutch non-jokes
Het is groen en het is een mummie?
Kermit de Waterkant
Wat is het toppunt van principe?
1) Wachten totdat een Nederlander gaat twijfelen
2) Een Zuster met een autoladder
3) Een brandwacht brandmeester met een brandmeester
van 9 maanden
“Ober, kunt u die schrik uit mijn politieman halen? Want
ik eet liever alleen.”
"Mijn hond is heel vreselijk: Hij schreeuwt mij iedere zus
de broer.“
"Maar dat is toch niet zo heel vreselijk?“
"Jawel, want ik heb geen rapport!"
Wat staat er midden in het bos?
De kapper.
Er loopt een super vriendelijk blondje langs een armband.
Last er een toonbank: “zo, waargaan die mooie mannen
heen?” Blondje: “naar de barkeeper als er niets tussen
komt…”
Hoe heet de vrouw van Sinterklaas?
Keukentafel.
"Twee tanden zwemmen in de zee en ze zien een
stamgast op een stamgast. De ene raad zegt tegen de
andere raad: 'Hé kijk! Ons eten op een bord!'"
29
51%
60%
50%
94% 94%
47%
94% 94%
47%
99% 96%
89%
Jokes vs News Jokes vs Proverbs Jokes vs Generated Jokes
Binary classification of jokes versus texts from other domains
Naive Bayes LSTM CNN RobBERT
Much more challenging dataset!
More truthful humor detection?
Winters T., Delobelle P. (2020). Dutch humor detection by generating negative examples. BNAIC/Benelearn2020
30
Part 3: “Large language
models are all you need”
31
Transformer models
Large language models, pretrained on large corpora
Outperforming previous neural architectures
on most language tasks
GPT-3
Completes any textual prompt
BERT
Classifies any text sequence / token
Brown, Tom B., et al. "Language models are few-shot learners."
Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding
32
≈ autocomplete
on steroids
33
Getting dialogue out of GPT-3
Input
- Fellow ants, we have
great news. Our new ant
queen is born!
- Hello my loyal ants, I
promise I will rule our nest
with an iron claw!
- All hail our new ant queen!
——————
- I am the new ant queen, and I
will make our colony the
strongest in the world!
——————
- It's time for us to expand our
nest!
- Our nest is under attack!
“-” trick for getting it to generate dialogue
Outputs
34
Improbotics
A.L.Ex the robot plays improv
scenes with improv actors
“Listens” to scene and
formulates own responses
with GPT-3
Later in show: gains human
body. AI whispers through
ear piece what actor should
say.
End: everyone has ear piece
 Turing test!
35
Improbotics interface
Operator types what happens and selects responses
37
GPT-2 / GPT-3 joke examples
GPT-2 can mimic joke style, but usually very absurd
https://www.gwern.net/GPT-3
https://towardsdatascience.com/teaching-gpt-2-a-sense-of-humor-fine-tuning-large-transformer-models-on-a-single-gpu-in-pytorch-59e8cec40912
What did one plate say
to the other plate?
Dip me!
What did the chicken
say after he got hit by
a bus?
"I'm gonna be fine!"
A woman walks into the bar......she
says to the bartender "I want a
double entendre" and the
bartender says "No, we don't
serve that"
38
GPT-3 generated “jokes”
39
Reminiscent of how children write jokes
40
Text to image models: DALL-E, Stable Diffusion
Generates images from any given text
41
“trending on artstation, 4K” trick
42
43
44
Lexica: prompt zoekmachine
45
46
Zonder & Met Lexica “cyberpunk”
47
The art of prompt engineering
48
GPT-3 sucks at math ?
49
BUT: Let’s think step by step
50
Prompt engineering leaderboards
51
Humor prompt that allows “draft paper”
52
54
Explains it’s “thinking process”
55
Other examples
• In response to rising energy prices, an emergency conference has
been called. The conference will be held in a dark room to save on
energy costs. All attendees must bring their own energy drinks.
• Pope assigns 21 new cardinals. Dressing up is usually a cardinal sin,
but this pope is making an exception. The new cardinals will be
responsible for passing out holy water balloons.
• The James Webb-telescope has once again taken some spectacular
pictures of Jupiter. It's out of this world!
56
Can computers have a sense of humor?
Computers can
follow specific
humor instructions
Humor is
intrinsically human
Large language models
guide the revolution
57
but:
AI-complete problem!
Need to process two mental images
before fully understanding the joke
58
Thanks!
Slides: thomaswinters.be/talk/2022winterschool
• TalkGenerator: talkgenerator.com
• TorfsBot: twitter.com/TorfsBot
• GPT-3: openai.com/api
• Image generators:
• craiyon.ai
• huggingface.co/spaces/stabilityai/stable-diffusion
Thomas Winters
PhD Student at KU Leuven & FWO Fellow
@thomas_wint
thomaswinters.be

Contenu connexe

Similaire à Computational Humor: Can a machine have a sense of humor (December 2022)

Write Esse Descriptive Essay E. Online assignment writing service.
Write Esse Descriptive Essay E. Online assignment writing service.Write Esse Descriptive Essay E. Online assignment writing service.
Write Esse Descriptive Essay E. Online assignment writing service.Nicolle Dammann
 
Artificial Intelligence and Intuition
Artificial  Intelligence  and  IntuitionArtificial  Intelligence  and  Intuition
Artificial Intelligence and IntuitionViktor Dörfler
 
There will-come-soft-rains-mini-scheme
There will-come-soft-rains-mini-schemeThere will-come-soft-rains-mini-scheme
There will-come-soft-rains-mini-schemePato_Ch
 
Between Hermeneutics and Deceit: Keeping Natural Language Generation in Line
Between Hermeneutics and Deceit: Keeping Natural Language Generation in LineBetween Hermeneutics and Deceit: Keeping Natural Language Generation in Line
Between Hermeneutics and Deceit: Keeping Natural Language Generation in LineLeah Henrickson
 
Developmental Psychology Theoretical Approaches Essay
 Developmental Psychology Theoretical Approaches Essay Developmental Psychology Theoretical Approaches Essay
Developmental Psychology Theoretical Approaches EssayPatty Buckley
 
STEAM to Screen: Mathematics
STEAM to Screen: MathematicsSTEAM to Screen: Mathematics
STEAM to Screen: MathematicsKellyAnn Bonnell
 
How To Cite A Critical Essay Within A Book
How To Cite A Critical Essay Within A BookHow To Cite A Critical Essay Within A Book
How To Cite A Critical Essay Within A BookTrisha Anderson
 
Ap Spanish Literature Essay Examples
Ap Spanish Literature Essay ExamplesAp Spanish Literature Essay Examples
Ap Spanish Literature Essay ExamplesBrittney Thompson
 
An Interview with author Roland Hughes
An Interview with author Roland HughesAn Interview with author Roland Hughes
An Interview with author Roland HughesCindy Bauer
 
Artificial Intelligence for Undergrads
Artificial Intelligence for UndergradsArtificial Intelligence for Undergrads
Artificial Intelligence for UndergradsJose Berengueres
 
Ghost Paper Cut Outs Set Of 25 Ghost Die Cuts Paper
Ghost Paper Cut Outs Set Of 25 Ghost Die Cuts PaperGhost Paper Cut Outs Set Of 25 Ghost Die Cuts Paper
Ghost Paper Cut Outs Set Of 25 Ghost Die Cuts PaperAmanda Summers
 
Storytelling January 6 2010
Storytelling January 6 2010Storytelling January 6 2010
Storytelling January 6 2010Hanson Hosein
 
Writing A Claim Worksheet
Writing A Claim WorksheetWriting A Claim Worksheet
Writing A Claim WorksheetDaphne Smith
 
Valley Forge Would You Have Quit Essay No
Valley Forge Would You Have Quit Essay NoValley Forge Would You Have Quit Essay No
Valley Forge Would You Have Quit Essay NoCrystal Hall
 
Causes Northern Ireland Conflict Essay
Causes Northern Ireland Conflict EssayCauses Northern Ireland Conflict Essay
Causes Northern Ireland Conflict EssaySharon Lopez
 
AILongForSeminar.ppt
AILongForSeminar.pptAILongForSeminar.ppt
AILongForSeminar.pptKhanKhaja1
 

Similaire à Computational Humor: Can a machine have a sense of humor (December 2022) (20)

Write Esse Descriptive Essay E. Online assignment writing service.
Write Esse Descriptive Essay E. Online assignment writing service.Write Esse Descriptive Essay E. Online assignment writing service.
Write Esse Descriptive Essay E. Online assignment writing service.
 
Artificial Intelligence and Intuition
Artificial  Intelligence  and  IntuitionArtificial  Intelligence  and  Intuition
Artificial Intelligence and Intuition
 
There will-come-soft-rains-mini-scheme
There will-come-soft-rains-mini-schemeThere will-come-soft-rains-mini-scheme
There will-come-soft-rains-mini-scheme
 
Between Hermeneutics and Deceit: Keeping Natural Language Generation in Line
Between Hermeneutics and Deceit: Keeping Natural Language Generation in LineBetween Hermeneutics and Deceit: Keeping Natural Language Generation in Line
Between Hermeneutics and Deceit: Keeping Natural Language Generation in Line
 
Developmental Psychology Theoretical Approaches Essay
 Developmental Psychology Theoretical Approaches Essay Developmental Psychology Theoretical Approaches Essay
Developmental Psychology Theoretical Approaches Essay
 
STEAM to Screen: Mathematics
STEAM to Screen: MathematicsSTEAM to Screen: Mathematics
STEAM to Screen: Mathematics
 
How To Cite A Critical Essay Within A Book
How To Cite A Critical Essay Within A BookHow To Cite A Critical Essay Within A Book
How To Cite A Critical Essay Within A Book
 
Ai long forseminar
Ai long forseminarAi long forseminar
Ai long forseminar
 
theQuiz(3);
theQuiz(3);theQuiz(3);
theQuiz(3);
 
Ap Spanish Literature Essay Examples
Ap Spanish Literature Essay ExamplesAp Spanish Literature Essay Examples
Ap Spanish Literature Essay Examples
 
An Interview with author Roland Hughes
An Interview with author Roland HughesAn Interview with author Roland Hughes
An Interview with author Roland Hughes
 
Artificial Intelligence for Undergrads
Artificial Intelligence for UndergradsArtificial Intelligence for Undergrads
Artificial Intelligence for Undergrads
 
Ghost Paper Cut Outs Set Of 25 Ghost Die Cuts Paper
Ghost Paper Cut Outs Set Of 25 Ghost Die Cuts PaperGhost Paper Cut Outs Set Of 25 Ghost Die Cuts Paper
Ghost Paper Cut Outs Set Of 25 Ghost Die Cuts Paper
 
Storytelling January 6 2010
Storytelling January 6 2010Storytelling January 6 2010
Storytelling January 6 2010
 
Writing A Claim Worksheet
Writing A Claim WorksheetWriting A Claim Worksheet
Writing A Claim Worksheet
 
Valley Forge Would You Have Quit Essay No
Valley Forge Would You Have Quit Essay NoValley Forge Would You Have Quit Essay No
Valley Forge Would You Have Quit Essay No
 
Causes Northern Ireland Conflict Essay
Causes Northern Ireland Conflict EssayCauses Northern Ireland Conflict Essay
Causes Northern Ireland Conflict Essay
 
theQuiz(2);
theQuiz(2);theQuiz(2);
theQuiz(2);
 
Dli milano rl_parton_sep
Dli milano rl_parton_sepDli milano rl_parton_sep
Dli milano rl_parton_sep
 
AILongForSeminar.ppt
AILongForSeminar.pptAILongForSeminar.ppt
AILongForSeminar.ppt
 

Plus de Thomas Winters

Prompt engineering: De kunst van het leren communiceren met AI
Prompt engineering: De kunst van het leren communiceren met AIPrompt engineering: De kunst van het leren communiceren met AI
Prompt engineering: De kunst van het leren communiceren met AIThomas Winters
 
Wetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroidsWetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroidsThomas Winters
 
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...Thomas Winters
 
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)Thomas Winters
 
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)Thomas Winters
 
Pret met Creatieve Computers
Pret met Creatieve ComputersPret met Creatieve Computers
Pret met Creatieve ComputersThomas Winters
 
Hoe leer je computers humor?
Hoe leer je computers humor?Hoe leer je computers humor?
Hoe leer je computers humor?Thomas Winters
 
Hoe schrijven computers zelf tekst? (Kinderlezing)
Hoe schrijven computers zelf tekst? (Kinderlezing)Hoe schrijven computers zelf tekst? (Kinderlezing)
Hoe schrijven computers zelf tekst? (Kinderlezing)Thomas Winters
 
AI als creatieve partner
AI als creatieve partnerAI als creatieve partner
AI als creatieve partnerThomas Winters
 
De magie achter afbeeldingsgenerators
De magie achter afbeeldingsgeneratorsDe magie achter afbeeldingsgenerators
De magie achter afbeeldingsgeneratorsThomas Winters
 
How to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhDHow to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhDThomas Winters
 
How can AI be a creative partner for PR & marketing?
How can AI be a creative partner for PR & marketing?How can AI be a creative partner for PR & marketing?
How can AI be a creative partner for PR & marketing?Thomas Winters
 
Beter leren praten met Artificiële Intelligentie
Beter leren praten met Artificiële IntelligentieBeter leren praten met Artificiële Intelligentie
Beter leren praten met Artificiële IntelligentieThomas Winters
 
TorfsBotOrNot @ Nerdland Festival
TorfsBotOrNot @ Nerdland FestivalTorfsBotOrNot @ Nerdland Festival
TorfsBotOrNot @ Nerdland FestivalThomas Winters
 
Creative AI for Improv Theatre
Creative AI for Improv TheatreCreative AI for Improv Theatre
Creative AI for Improv TheatreThomas Winters
 
Humor Workshop: Hoe schrijf je satire? (KU Leugen)
Humor Workshop: Hoe schrijf je satire? (KU Leugen)Humor Workshop: Hoe schrijf je satire? (KU Leugen)
Humor Workshop: Hoe schrijf je satire? (KU Leugen)Thomas Winters
 
Survival of the Wittiest: Evolving Satire with Language Models
Survival of the Wittiest: Evolving Satire with Language ModelsSurvival of the Wittiest: Evolving Satire with Language Models
Survival of the Wittiest: Evolving Satire with Language ModelsThomas Winters
 
Discovering Textual Structures: Generative Grammar Induction using Template T...
Discovering Textual Structures: Generative Grammar Induction using Template T...Discovering Textual Structures: Generative Grammar Induction using Template T...
Discovering Textual Structures: Generative Grammar Induction using Template T...Thomas Winters
 
Modelling Mutually Interactive Fictional Character Conversational Agents
Modelling Mutually Interactive Fictional Character Conversational AgentsModelling Mutually Interactive Fictional Character Conversational Agents
Modelling Mutually Interactive Fictional Character Conversational AgentsThomas Winters
 
Generating Philosophical Statements using Interpolated Markov Models and Dyna...
Generating Philosophical Statements using Interpolated Markov Models and Dyna...Generating Philosophical Statements using Interpolated Markov Models and Dyna...
Generating Philosophical Statements using Interpolated Markov Models and Dyna...Thomas Winters
 

Plus de Thomas Winters (20)

Prompt engineering: De kunst van het leren communiceren met AI
Prompt engineering: De kunst van het leren communiceren met AIPrompt engineering: De kunst van het leren communiceren met AI
Prompt engineering: De kunst van het leren communiceren met AI
 
Wetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroidsWetenschapscommunicatie on steroids
Wetenschapscommunicatie on steroids
 
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
TorfsBot or Not? Evaluating User Perception on Imitative Text Generation (CLI...
 
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
Prompt engineering: de kunst van het leren communiceren met AI (Juni 2023)
 
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
Hoe werken tekstgenerators? (Special Guest in Lieven Scheire's AI voorstelling)
 
Pret met Creatieve Computers
Pret met Creatieve ComputersPret met Creatieve Computers
Pret met Creatieve Computers
 
Hoe leer je computers humor?
Hoe leer je computers humor?Hoe leer je computers humor?
Hoe leer je computers humor?
 
Hoe schrijven computers zelf tekst? (Kinderlezing)
Hoe schrijven computers zelf tekst? (Kinderlezing)Hoe schrijven computers zelf tekst? (Kinderlezing)
Hoe schrijven computers zelf tekst? (Kinderlezing)
 
AI als creatieve partner
AI als creatieve partnerAI als creatieve partner
AI als creatieve partner
 
De magie achter afbeeldingsgenerators
De magie achter afbeeldingsgeneratorsDe magie achter afbeeldingsgenerators
De magie achter afbeeldingsgenerators
 
How to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhDHow to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhD
 
How can AI be a creative partner for PR & marketing?
How can AI be a creative partner for PR & marketing?How can AI be a creative partner for PR & marketing?
How can AI be a creative partner for PR & marketing?
 
Beter leren praten met Artificiële Intelligentie
Beter leren praten met Artificiële IntelligentieBeter leren praten met Artificiële Intelligentie
Beter leren praten met Artificiële Intelligentie
 
TorfsBotOrNot @ Nerdland Festival
TorfsBotOrNot @ Nerdland FestivalTorfsBotOrNot @ Nerdland Festival
TorfsBotOrNot @ Nerdland Festival
 
Creative AI for Improv Theatre
Creative AI for Improv TheatreCreative AI for Improv Theatre
Creative AI for Improv Theatre
 
Humor Workshop: Hoe schrijf je satire? (KU Leugen)
Humor Workshop: Hoe schrijf je satire? (KU Leugen)Humor Workshop: Hoe schrijf je satire? (KU Leugen)
Humor Workshop: Hoe schrijf je satire? (KU Leugen)
 
Survival of the Wittiest: Evolving Satire with Language Models
Survival of the Wittiest: Evolving Satire with Language ModelsSurvival of the Wittiest: Evolving Satire with Language Models
Survival of the Wittiest: Evolving Satire with Language Models
 
Discovering Textual Structures: Generative Grammar Induction using Template T...
Discovering Textual Structures: Generative Grammar Induction using Template T...Discovering Textual Structures: Generative Grammar Induction using Template T...
Discovering Textual Structures: Generative Grammar Induction using Template T...
 
Modelling Mutually Interactive Fictional Character Conversational Agents
Modelling Mutually Interactive Fictional Character Conversational AgentsModelling Mutually Interactive Fictional Character Conversational Agents
Modelling Mutually Interactive Fictional Character Conversational Agents
 
Generating Philosophical Statements using Interpolated Markov Models and Dyna...
Generating Philosophical Statements using Interpolated Markov Models and Dyna...Generating Philosophical Statements using Interpolated Markov Models and Dyna...
Generating Philosophical Statements using Interpolated Markov Models and Dyna...
 

Dernier

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

Dernier (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Computational Humor: Can a machine have a sense of humor (December 2022)

  • 1. 1 Computational Humor Thomas Winters PhD Student at KU Leuven & FWO Fellow @thomas_wint thomaswinters.be Can a machine have a sense of humor?
  • 2. 2 One you brush and rake, the other you rush and brake. What is the difference between leaves and a car?
  • 3. 3 We asked the Belgian prime minister for comment, but he was too busy stockpiling firewood. Belgian prime minister says the next five winters will be difficult due less energy supply.
  • 4. 4 Can a machine have a sense of humor?
  • 5. 5 Part 1: Humor is intrinsically human
  • 6. 6 Every known human civilisation has some form of humor Caron, J.E.: From ethology to aesthetics: Evolution as a theoretical paradigm for research on laughter, humor, and other comic phenomena. Humor15(3), 245–281(2002)
  • 7. 7 Purpose of Humor = Sign of Intelligence? huh? aha! that’s funny Brain rewards noticing incongruities and successfully resolving them + linguistic skills + hard to fake display of personal values = Evolutionary advantage! h
  • 9. 9 Incongruity-Resolution Theory Based on: Ritchie, G. (1999). Developing the incongruity-resolution theory. Obvious Interpretation Hidden Interpretation Two fish are in a tank. Says one to the other: “Do you know how to drive this thing?” Setup Punchline
  • 10. 10 Human-focused definition! Machine should not only spot two mental images Obvious Interpretation Hidden Interpretation But also that it is not too hard or too easy for a human!
  • 11. 11 Computational humor can help understand humor We do not fully know how humor works Artificial Intelligence can shed a light! Humour
  • 12. 12 Humor co-creation Grammarly / copy.ai but for jokes
  • 13. 13 Humor = AI-complete? ~ as hard as making computers as “intelligent” as people
  • 14. 14 Part 2: Computers can follow humor instructions
  • 16. 16 JAPE: Templates & Schemas What’s <CharacteristicNP> and <Characteristic1> ? A <Word1> <Word2>. Noun Phrase Word1 Word2 Homophone1 Characteristic1 CharacteristicNP What’s green and bounces? A spring cabbage. spring (season) to bounce spring (elastic body) cabbage green spring cabbage Binsted, K., & Ritchie, G. (1994). An implemented model of punning riddles
  • 17. 17 Unsupervised Analogy Generator I like my <X> like I like my <Y>: <Z> I like my coffee like I like my war: cold. Petrović, S., & Matthews, D. (2013). Unsupervised joke generation from big data cold war coffee Z Y X Maximise adjective dissimilarity Maximise co-occurrence Maximise co-occurrence Maximise # definitions Minimize commonness
  • 18. 18 Talk Generator Generates nonsense PowerPoints about any given topic for presenters to improvise on Winters T., Mathewson K. (2019). Automatically Generating Engaging Presentation Slide Decks Try it yourself: talkgenerator.com
  • 20. 20 Statistical text generators Demo 1. Open your smartphone keyboard (e.g. in notes) 2. Press on any suggested autocomplete word 3. Press 10-20 times on a random suggestion 4. You’ve just generated a sentence using an AI trained to sound similar to you! (if you squint your eyes) Autocomplete counted how often you used certain words after other words in previously typed texts  Statistical model I have been trying to get hold of my client since the last few days
  • 22. 22 Fully automated Twitterbot that imitates Rik Torfs Trained on his tweets & columns
  • 23. 23 Markov chain generator 1. Count in Rik Torfs tweets & columns how often a word follows the previous 2-4. 2. Start with two real starting words of Rik, and take random next words “gevolgd door” 4: een 2: zijn 1: iemand 1: acht Beste,
  • 25. 25 Early Humor Detector • Designed humor features e.g. alliteration, antonym, adult slang... • Used Naive Bayes & Support Vector Machines • Task: One-liners vs news, neutral corpus & proverbs Mihalcea, R., & Strapparava, C. (2005). Making computers laugh: Investigations in automatic humor recognition.
  • 26. 26 But is this a good dataset? News & proverbs have completely different types of words than jokes!  Looking at word frequencies is often already “enough”! Is this really humor detection?
  • 27. 27 Jokes are fragile! Two fish are in a tank. Says one to the other: “Do you know how to drive this thing?” men bar Generate non-jokes by replacing keywords from other jokes! Word-based features won’t work anymore! Winters T., Delobelle P. (2020). Dutch humor detection by generating negative examples. BNAIC/Benelearn2020
  • 28. 28 Examples of generated Dutch non-jokes Het is groen en het is een mummie? Kermit de Waterkant Wat is het toppunt van principe? 1) Wachten totdat een Nederlander gaat twijfelen 2) Een Zuster met een autoladder 3) Een brandwacht brandmeester met een brandmeester van 9 maanden “Ober, kunt u die schrik uit mijn politieman halen? Want ik eet liever alleen.” "Mijn hond is heel vreselijk: Hij schreeuwt mij iedere zus de broer.“ "Maar dat is toch niet zo heel vreselijk?“ "Jawel, want ik heb geen rapport!" Wat staat er midden in het bos? De kapper. Er loopt een super vriendelijk blondje langs een armband. Last er een toonbank: “zo, waargaan die mooie mannen heen?” Blondje: “naar de barkeeper als er niets tussen komt…” Hoe heet de vrouw van Sinterklaas? Keukentafel. "Twee tanden zwemmen in de zee en ze zien een stamgast op een stamgast. De ene raad zegt tegen de andere raad: 'Hé kijk! Ons eten op een bord!'"
  • 29. 29 51% 60% 50% 94% 94% 47% 94% 94% 47% 99% 96% 89% Jokes vs News Jokes vs Proverbs Jokes vs Generated Jokes Binary classification of jokes versus texts from other domains Naive Bayes LSTM CNN RobBERT Much more challenging dataset! More truthful humor detection? Winters T., Delobelle P. (2020). Dutch humor detection by generating negative examples. BNAIC/Benelearn2020
  • 30. 30 Part 3: “Large language models are all you need”
  • 31. 31 Transformer models Large language models, pretrained on large corpora Outperforming previous neural architectures on most language tasks GPT-3 Completes any textual prompt BERT Classifies any text sequence / token Brown, Tom B., et al. "Language models are few-shot learners." Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding
  • 33. 33 Getting dialogue out of GPT-3 Input - Fellow ants, we have great news. Our new ant queen is born! - Hello my loyal ants, I promise I will rule our nest with an iron claw! - All hail our new ant queen! —————— - I am the new ant queen, and I will make our colony the strongest in the world! —————— - It's time for us to expand our nest! - Our nest is under attack! “-” trick for getting it to generate dialogue Outputs
  • 34. 34 Improbotics A.L.Ex the robot plays improv scenes with improv actors “Listens” to scene and formulates own responses with GPT-3 Later in show: gains human body. AI whispers through ear piece what actor should say. End: everyone has ear piece  Turing test!
  • 35. 35 Improbotics interface Operator types what happens and selects responses
  • 36. 37 GPT-2 / GPT-3 joke examples GPT-2 can mimic joke style, but usually very absurd https://www.gwern.net/GPT-3 https://towardsdatascience.com/teaching-gpt-2-a-sense-of-humor-fine-tuning-large-transformer-models-on-a-single-gpu-in-pytorch-59e8cec40912 What did one plate say to the other plate? Dip me! What did the chicken say after he got hit by a bus? "I'm gonna be fine!" A woman walks into the bar......she says to the bartender "I want a double entendre" and the bartender says "No, we don't serve that"
  • 38. 39 Reminiscent of how children write jokes
  • 39. 40 Text to image models: DALL-E, Stable Diffusion Generates images from any given text
  • 41. 42
  • 42. 43
  • 44. 45
  • 45. 46 Zonder & Met Lexica “cyberpunk”
  • 46. 47 The art of prompt engineering
  • 48. 49 BUT: Let’s think step by step
  • 50. 51 Humor prompt that allows “draft paper”
  • 51. 52
  • 53. 55 Other examples • In response to rising energy prices, an emergency conference has been called. The conference will be held in a dark room to save on energy costs. All attendees must bring their own energy drinks. • Pope assigns 21 new cardinals. Dressing up is usually a cardinal sin, but this pope is making an exception. The new cardinals will be responsible for passing out holy water balloons. • The James Webb-telescope has once again taken some spectacular pictures of Jupiter. It's out of this world!
  • 54. 56 Can computers have a sense of humor? Computers can follow specific humor instructions Humor is intrinsically human Large language models guide the revolution
  • 55. 57 but: AI-complete problem! Need to process two mental images before fully understanding the joke
  • 56. 58 Thanks! Slides: thomaswinters.be/talk/2022winterschool • TalkGenerator: talkgenerator.com • TorfsBot: twitter.com/TorfsBot • GPT-3: openai.com/api • Image generators: • craiyon.ai • huggingface.co/spaces/stabilityai/stable-diffusion Thomas Winters PhD Student at KU Leuven & FWO Fellow @thomas_wint thomaswinters.be

Notes de l'éditeur

  1. Haha and Aha are very similar
  2. Voor de mensen die Rik Torfs niet kennen: Professor Kerkelijk Recht Ex-rector KU Leuven Maarook: fervent Twitteraar Op Twitter sinds 2010 Speaks in algemeenheden en boutades “Vlaams Orakel” “Koning van de boutade”
  3. Wat heb jij gemaakt? Torfsbot Volautomatische Twitterbot Heeft leren tweeten zoals Rik Torfs door zijn tweets & columns te analyseren Simpel Markov model & kernwoorden vervanger Tweet 5x per dag en antwoordt op iedereen
  4. (DETAILS FOR NERDS) Markov modellen: kijk naar vorige paar woorden en neem willekeurig een statistisch mogelijk woord
  5. So for the foreseeable future, it seems like humans might have the last laugh. Thank you very much