2. Outline
Can machines dialogue?
• Test di Turing
• Expectation of strong Artificial Intelligence
• Components and issues of a dialogue system
Chatbots
• Overview of popular chatbots
• The illusion of Weizenbaum
• Technology of a chabot
An “intuitive/rational” chatbot as interface to I.R retrieval systems
• Rational Area
• Intuitive Area
• An application
4. Conversational Agents
A conversational agent is a computer program
that interacts with users turn by turn using natural
language;
Aim: to improve the usability of human-computer
interfaces
Issues: The effective use of language is
intertwined with our general cognitive abilities.
5. The Turing Test
Can machines think?
Alan Turing
“Computing
Machinery and
Intelligence” , 1950
7. Expectation of an artificial
intelligence system: HAL 9000
HAL (Heuristically programmed ALgorithmic
computer) is a sentient computer that controls the
systems of the Discovery spacecraft and interacts
with the ship's astronaut crew.
HAL is capable of advanced language-processing
behavior as speaking and understanding English,
and at a crucial moment in the plot, even reading
lips!
8. Components of a Spoken Conversationa
Agent
Automatic
Speech
Recognition
component
(ASR)
Natural
Language
Understanding
component
(NLU)
)Text-To-
Speech
synthesis
component
(TTS)
Natural
Language
Generation
component
(NLG)
)
Dialogue
Manager
9. HAL, open the pod bay doors
I'm sorry, Dave. I'm afraid I can't do that.
I’m I do, sorry that afraid Dave I’m can’t.
what is a `pod bay door’?
Natural Language
Understanding
where you get that idea, Hal?
REQUEST:
HAL, open the pod bay door.
STATEMENT:
HAL, the pod bay door is open.
INFORMATIONQUESTION:
HAL,is the pod bay door open?
I’m sorry , I’m afraid
10. Natural Language Ambiguity
Consider the spoken sentence:
I made her duck
I cooked waterfowl for her.
I cooked waterfowl belonging to her.
I created the (plaster?) duck she owns.
I caused her to quickly lower her head or body.
I waved my magic wand and turned her into
undifferentiated waterfowl.
12. Chatbot
A simple conversational agent based on a pattern
matching dialogue mechanism.
Main applications: e-learning platforms, research
engines, web-site navigation.
From ELIZA (Joseph Weizenbaum1966) to SIRI
(APPLE 2010)
13. 13
From Eliza (Joseph Weizenbaum1966) …
ELIZA was an early natural language processing
system capable of carrying on a limited form of
conversation with a user.
Consider the following session with a version of
ELIZA that imitated the responses of a
psychotherapist.
User1: You are like my father in some ways.
ELIZA1: WHAT RESEMBLANCE DO YOU SEE
User2: You are not very aggressive but I think you don’t want me to notice that.
ELIZA2: WHAT MAKES YOU THINK I AM NOT AGGRESSIVE
User3: You don’t argue with me.
ELIZA3: WHY DO YOU THINK I DON’T ARGUE WITH YOU
User4: You are afraid of me.
ELIZA4: DOES IT PLEASE YOU TO BELIEVE I AM AFRAID OF YOU
15. “The Weizenbaum illusion”
“I was startled to see how quickly and how very
deeply people conversing with DOCTOR became
emotionally involved with the computer and how
unequivocally they anthropomorphized it.”
J. Weizenbaum, Computer Power and Human
Reason, 1976
Human cognition is geared toward finding
patterns… and we hear coherent language use
where there are only snippets of canned text.
16. Alice Chatbot
An Example of AIML Category
<category>
<pattern> WHO ARE YOU</pattern>
<template> I’m a chat robot. My
knowledge base is composed of
question-answer modules, (categories)
structured with the Artificial Intelligence
Mark-up Language (AIML)
</template>
</category>
?
I’m a chat robot. My knowledge base is
composed of question-answer modules,
(categories) structured with the Artificial
Intelligence Mark-up Language (AIML)
18. Default Categories
<category>
<pattern> * LOVE * </pattern>
<template>
<random>
<li>Aren't we all looking for love?</li>
<li>And what kind of love are we
looking for
today?</li>
</random>
</template>
19. Recursive Categories:
synonimy, symbolic reduction, divide and
conquer
<category>
<pattern>BYE BYE </pattern>
<template>
<srai> GOODBYE </srai>
</template>
</category>
<category>
<pattern> DO YOU KNOW WHAT IS *
</pattern>
<template> <srai>WHAT IS <star/> </srai>
</template>
</category>
<category>
<pattern>GOODBYE </pattern>
<template> Goodbye,
user!</template>
</category>
…
20. <That> </That>
User: Tell me something
Chat-bot: Do you like movies?
User: Yes
Chat-bot: What is your favourite movie?
<category>
<pattern> TELL ME SOMETHING
</pattern>
<template> Do you like movies?
</template>
</category>
<category>
<pattern> YES </pattern>
<that> DO YOU LIKE MOVIES <that>
<template> What is your favourite movie?
</template>
</category>
22. Chatbot Limitations
The dialogue mechaninsm is too rigid;
The language understanding capability is very
limited;
The chatbot knowledge base is expensive and
boring to create
24. Goals
To simplify the
knowledge base
design process:
• extending the chatbot knowledge base with other
information repositories;
• generalizing as much as possible the AIML
categories;
• train automatically the chatbot knowledge base.
To enhance the
answering
mechanism:
• providing the chatbot of reasoning capabilities;
• allowing the chatbot to perform a “semantic analysis”
of the questions
26. Rational – Intuitive chatbots
Integration of two approaches for knowledge
representation:
Symbolic: Knowledge formalization by means of
semantic networks;
Sub-symbolic: Data driven creation of semantic
spaces in which it is possible to represent and
compare natural language elements.
28. • Cyc is a large, multi-contextual, common sense knowledge
base
and inference engine
• The knowledge base is composed of concepts, logic
assertions, common sense rules and heuristics for the
reasoning about quotidian life objects and events “(currently
~200,000 terms each with several assertions; over 1,000,000
rules )
•Assertions sharing some features are associated together in
inherited clusters called “microtheories”.
Symbolic Approach
29. What’s in Cyc?
A Knowledge Base (KB) consisting of terms
Dog, DogFood, Doghouse, SnoopDoggyDogg
Assertions that relate these terms.
Ground Assertions:
(isa MyDogSharkey BelgianSheepdog)
(genls BelgianSheepdog Dog)
Rules, which derive assertions from Ground
Assertions:
(isa THING COL ) +
(genls COL SUPERCOL) --->
(isa THING SUPERCOL)
30. Predicates and Functions
Predicates are truth-functional relations which can be evaluated
according to facts in the KB and used to make sentences that
are true or false
Usually Lowercase
(objectHasColor BrownDog Brown)
(memberStatusOfOrganization Norway NATO FoundingMember)
Functions take arguments to denote Non-Atomic Terms (NATs),
expressions that represent things
Usually Uppercase
(FruitFn AppleTree) denotes an apple
(BorderBetweenFn Sweden Norway) denotes the border between
Sweden and Norway.
31. Sub-symbolic Approach
•“Sub-Symbolic” representation of natural language
elements in a vector space.
•The natural language elements are related each other
on the strength of the proximity of their corresponding
vectors in the space.
Meanings are locations in a semantic space, and
semantic similarity is proximity between the
locations (Sahlgren, 2006)
You shall know a word by the company it keeps
(Firth, 1957).
32. Sub-symbolic Approach
•Semantic spaces can be automatically induced from
data by using LSA;
•LSA is capable to “simulate” human evocative
capabilities
y
x
z
Conceptual
Space
Text Docs “The orthonormal axis of the induced
space represent “primitive concepts”
35. CYD: Alice ProgramD + CYC
AIML/SUBL
Translator
Query Engine
CYD
CYC New AIML tags allowing the chatbot to:
•translate a natural language term into a Cyc
constant (cycterm);
•execute a query into the Cyc KB
(cycsystem);
•assert or delete a Cyc formula into or from a
Cyc microtheory (cycassert and cycretract);
•verify the value of a Cyc statement and in
consequence give an answer (cyccondition );
•execute a Cyc statement and return a
random answer (cycrandom)
36. An example of interaction in the M.A.G.A. project
<category>
<pattern> I NEED INFORMATION ABOUT THE ARTIFACT * </pattern>
<template> It belongs to
<cycsystem>(cyc-query '(# $CreatedDuring <star/> ?X)) </cycsystem>,
it has been found at
<cycsystem>(cyc-query '(#$ComingFrom <star/>?X))
</cycsystem>
and represents
<cycsystem>(cyc-query '(#$Representing <star/>?X))
</cycsystem>
</template>
</category>
I need information
about the artifact
Pan Head
It belongs to the
Roman age, it has
been found at Ribera
and represents Pan
divinity
39. Intuitive vs Traditional Chatbot
39/42
Do you knoow C
plus plus
language?
C plus plus is the
object oriented
extension of the C
programming
language.
Can you speak any
other languages?
42. New AIML tags allowing the chatbot
to interact with the semantic space
LsaCompetence: it changes the distance threshold used to
consider “similar” two vectors in the semantic space;
LsaQuery: it encodes the user's request in the semantic space
obtaining the nearest concepts and returning only those whose
distance is below a known threshold set with the lsacompetence
tag;
LsaRandomQuery: it runs a LsaQuery query and it returns a
random result between the available ones;
LsaRelated: it obtains the nearest concepts of the input one
returning only those whose distance is below a known threshold
set with the <lsacompetence> tag;
LsaRandomRelated: it runs a LsaRelated query and it returns a
random result between the available ones.
46. Actually it recognizes this kind of sentence:
FORMAL/Definition:
WHAT+ IS +ENTITY
WHAT = {which|what|who}
IS={about|be|be meaning of|be definition of|be sense
of|mean|appear}
ENTITY= {SUBSTANCE}|{PRODUCT}|
{PROCESS}|{TASK}|{AGENT}
-SRAI: reduction of user queries to AIML pattern
<pattern>
FORM-DEFINITION …
</pattern>
50. Enhanced AIML KB
Ultimat
e
Default
Ontology and
LSA Default
Categories
Clasic Default
Atomic
E-SRAI
User Question
Ontology
CYD
AIML
Bootstrap
Automatically
generated
Defined by the
Botmaster
Run Time
Modules
Offline
Module
LSA
Run Time
Module
51. FRASI project: An example of interaction
<category>
<pattern>Form Definition *</pattern>
<template>
<think><set name
=”prodotto"><star/></set></think>
<cycsystem>(fi-ask
'(#$comment <cycterm><star
index="1"/></cycterm> ?X) #$LatteMt)
</cycsystem>
Vuoi conoscere i produttori principali? Se si
scrivi la parola Marche
</template>
</category>
<category>
<pattern>MARCHE</pattern>
<template> I produttori che commercializzano il
<get
name=”prodotto"/> sono i seguenti:
<cycsystem>(fi-ask
'(#$thereExists ?Y
(#$and (#$isa ?Y
<cycterm> <get name=”prodotto"/></cycterm>)
(#$prodottoDa ?Y ?X)))#$LatteMt)
</cycsystem>
</template>
</category>
Cosa puoi
dirmi del
Latte Intero?
Latte non
assoggettato al
processo di
riduzione dei …
Vuoi conoscere I
produttori principali?
Se si scrivi la parola
Marche
52. FRASI project: An inference example
<category>
<pattern>uk Vorrei provare il latte *</pattern>
<template>
Sto verificando se questo prodotto è sconsigliato per il
tuo profilo, il risultato è:
<cycsystem>(new-cyc-query
'(#$prodottoSconsigliato <cycterm><star/></cycterm>
<cycterm> <get name="utente"/> </cycterm>)#
$BaseKB '(:INFERENCE-MODE :SHALLOW ))
</cycsystem>
</template>
</category>
Inference Rule
(implies
(and
(soffreDi ?X IntolleranzaAlLattosio)
(haParte ?Y Lattosio))
(prodottoSconsigliato ?Y ?X))
Vorrei
provare il
latte
PremiumBlu
Sto verificando se questo
prodotto è sconsigliato per il tuo
profilo, il risultato è: Prodotto
Sconsigliato
54. Conclusion
Overview of conversational agents: history,
expectations and issues;
Popularity of simple, rule-based conversational
agents;
Introduction of a rational-intuitive chatbot
architecture.