09.1 communication

53
 Agents That Communicate Chris Bourne Chris Christen Bryan Hryciw

Upload: saravanan-pa

Post on 05-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 1/53

 Agents That CommunicateChris Bourne

Chris Christen

Bryan Hryciw

Page 2: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 2/53

OverviewCommunication as Action

Types of Communicating Agents

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing)

Definite Clause Grammar (DCG)

 Augmenting a Grammar

Semantic Interpretation Ambiguity and Disambiguity

 A Communicating Agent

Summary

Page 3: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 3/53

 IntroductionCommunication is the intentional exchange of informationbrought about by the production and perception of signs drawnfrom a shared system of conventional signs.

Most animals employ a fixed set of signs to represent messagesthat are important to their survival: food here, predator nearby,approach, withdraw, let’s mate. 

Humans, just as many other animals, use a limited number of signs to communicate (smiling, shaking hands)

Page 4: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 4/53

 IntroductionHumans are the only animal that has developed a complex,structured system of signs, known as language, that enables usto communicate most of what they know about the world.

 Although other animals such as chimpanzees and dolphins haveshown vocabularies of hundreds of symbols, humans are theonly species that can communicate an unbounded number of qualitatively different messages.

 Although there are other uniquely human attributes, such aswearing clothes and watching TV, Turing created his test basedon language because language is closely tied to thinking, in away these other attributes are not.

Page 5: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 5/53

Origins & Evolution of Language

Did humans develop the use of language because weare smart, or are we smart because we use language

well?

Jerrison, 1991: Human language stems from a need for bettercognitive maps of territory. Canines rely heavily on scentmarking and their sense of smell to determine where they areand what other animals have been there. Since primates do nothave such a highly developed sense of smell, they substitutedvocal sounds for scent marking.

Page 6: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 6/53

OverviewCommunication as Action 

Types of Communicating Agents

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing)

Definite Clause Grammar (DCG)

 Augmenting a Grammar

Semantic Interpretation

 Ambiguity and Disambiguity

 A Communicating Agent

Page 7: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 7/53

Communication as ActionSpeech Act: 

The action available to an agent to produce language

includes talking, typing, sign language, etc.Speaker - An agent that produces a speech act

Hearer - An agent that receives a speech act

Why would agents choose to perform a speech act? 

To be able to:

• Inform, Query, Answer, Request or Command, Promise, Acknowledge and Share

Page 8: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 8/53

Page 9: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 9/53

Communication as ActionMake the Hearer take some action:

Promise:

to do things or offer deals. Ex. I’ll shoot the wumpus if you let me share the gold.

Query: 

other agents about particular aspects of the world. Ex. Have you smelled the wumpus anywhere? 

Request or Command: other agents to perform actions. It can be seen as impolite tomake direct requests, so often an indirect speech act (a requestin the form of a statement or question) is used instead. Ex. I could use some help carrying this or Could you please help me carry this? 

Page 10: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 10/53

 Difficulties with CommunicationSpeaking:

When is a speech act called for?

Which speech act, out of all the possibilities is the right one?

Nondeterminism

Understanding: 

Given ambiguous inputs, what state of the world could havecreated these inputs?

Page 11: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 11/53

Fundamentals of LanguageFormal Languages: Languages that are inventedand are rigidly defined. A set of strings where each

string is a sequence of symbols taken from a finiteset called the terminal symbols.

Lisp, C++, first order logic, etc.

Natural Languages: Languages that humans useto talk to one another.

Chinese, Danish, English, etc. 

Page 12: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 12/53

Component Steps of CommunicationThree steps take place in the speaker:

Intention: S want H to believe P

Generation: S chooses words W

Synthesis: S utters the words W

Four steps take place in the hearer:

Perception: H perceives W1 (ideally, W = W1)

 Analysis: H infers that W1 has possible meanings P1, … , Pn Disambiguation: H infers that S intended to convey Pi (ideally,Pi = P)

Incorporation: H decides to believe Pi (or rejects it if it is outof line with what H already believes)

Page 13: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 13/53

 Models of CommunicationEncoded Message Model: 

Speaker encodes a proposition into words or signs. The hearerthen tries to decode this message to retrieve the original

proposition. The meaning in the speaker’s head, the message thatgets transmitted, and the interpretation that hearer arrives at areall the same, unless there is noise during communication, or anerror in encoding or decoding occurs.

Situated Language Model: 

Created because of limitations on the encoded message model.The meaning of the message depends on both the words, and thesituation.

Ex.  “Diamond” refers to one thing when the subject is jewelry,and a completely different meaning when the subject is baseball.

Page 14: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 14/53

OverviewCommunication as Action

Types of Communicating Agents 

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing)

Definite Clause Grammar (DCG)

 Augmenting a Grammar

Semantic Interpretation

 Ambiguity and Disambiguity

 A Communicating Agent

Page 15: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 15/53

Types of Communicating AgentsCommunicating using Tell and ask: 

 Agents share a common internal representation language

 Agents are capable of communicating without any external

language at all

Communicating using Formal Language: 

 Agents make no assumptions about each other’s internal

language Agents share a communication language that is a subset of English

Page 16: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 16/53

Tell and Ask Communication with Tell and Ask 

Percepts Actions Percepts Actions

Reasoning Reasoning

KB KB

Agent A  Agent B 

TELL(KBB , “P”) TELL(KBA , “P”) 

ASK(KBB , “Q”) TELL(KBB , “Pit (PA1)   At (PA1,[2,3], SA9)”) 

Page 17: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 17/53

Formal Language

Percepts Actions Percepts ActionsReasoning Reasoning

KB KB

Agent A  Agent B Language

Language

Page 18: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 18/53

OverviewCommunication as Action

Types of Communicating Agents

 A Formal Grammar for a Subset of English Syntactic Analysis (Parsing)

Definite Clause Grammar (DCG)

 Augmenting a Grammar

Semantic Interpretation

 Ambiguity and Disambiguity

 A Communicating Agent

Page 19: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 19/53

Formal Grammar for a Subset of EnglishLexicon: List of allowable vocabulary words.

Noun -> stench | breeze | glitter | nothing | wumpus | pit | pits | gold | east | …  

 Verb -> is | see | smell | shoot | feel | stinks | go | grab | carry | kill | turn | …  

 Adjective -> right | left | east | south | back | smelly | … 

 Adverb -> here | there | nearby | ahead | right | left | east | south | back | …  

Pronoun -> me | you | I | it | … 

Name -> John | Mary | Boston | Aristotle | …  Article -> the | a | an | … 

Preposition -> to | in | on | near | … Conjunction -> and | or | but | … 

Digit -> 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

Page 20: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 20/53

Formal Grammar for a Subset of English

NP -> Pronoun

-> Noun

-> Article Noun

-> Digit Digit

-> NP PP

-> NP RelClause

RelClause -> that VP

 VP -> Verb

-> VP NP

-> VP Adjective

-> VP PP

-> VP Adverb

PP -> Preposition NP

Grammar: 

S -> NP VPS -> S Conjunction S

Page 21: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 21/53

OverviewCommunication as Action

Types of Communicating Agents

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing) 

Definite Clause Grammar (DCG)

 Augmenting a Grammar

Semantic Interpretation

 Ambiguity and Disambiguity

 A Communicating Agent

Page 22: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 22/53

Parsing AlgorithmsThere are many algorithms for parsing

Top-down parsing

• Starting with an S and expanding accordingly

Bottom-up parsing

Combination of top-down and bottom-up

Dynamic programming techniques• Avoids inefficiencies of backtracking

Page 23: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 23/53

 Bottom-up Parse (example)

function BOTTOM-UP-PARSE(words, grammar ) returns a parse tree

forest words

loop do 

if LENGTH( forest ) = 1 and CATEGORY( forest [1]) = START(grammar ) then

return  forest [1]else 

i  choose from {1…LENGTH( forest )}

rule  choose from RULES(grammar)

n LENGTH(RULE-RHS(rule))

subsequence  SUBSEQUENCE( forest, i, i+n-1)

if MATCH(subsequence,RULE-RHS(rule)) then 

forest[i…i+n-1] [MAKE-NODE(RULE-LHS(rule) , subsequence)]

else fail

end 

 forest subsequence rule

The wumpus is dead Article wumpus is dead

 Article Noun is dead

 NP is dead

 NP Verb dead

 NP Verb Adjective 

 NP VP Adjective 

 NP VP 

S

Thewumpus

 Article Noun 

is

dead

Verb

VP Adjective

 NP VP

 Article    the  Noun   wumpus 

 NP    Article Noun 

Verb   is

 Adjective    dead 

VP   Verb

VP   Verb Adjective

S    NP VP

Page 24: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 24/53

OverviewCommunication as Action

Types of Communicating Agents

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing)

Definite Clause Grammar (DCG) 

 Augmenting a Grammar

Semantic Interpretation

 Ambiguity and Disambiguity

 A Communicating Agent

Page 25: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 25/53

 Definite Clause Grammer (DCG)Problems with Backus-Naur Form (BNF)

Need meaning

Context sensitive

Introduction of First Order Logic

BNF First Order Logic

S NP VP NP(s1) /\ VP(s2) S(Append(s1 ,s2))

 Noun   stench | …  (s=“stench” \  / …) Noun(s)

Page 26: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 26/53

 DCG NotationPositive:

Easy to describe grammars

Negative:

More verbose than BNF

3 Rules:•The notation X  Y Z … translate as Y(s1) /\ Z(s2)… X(Append(s1, s2,…). 

•The notation X  word   translates as X([“word ”]). 

•The notation X  Y | Z | … translates as Y’(s) \ / Z’(s) \ /… X(s), where Y’

is the translation into logic of the DCG expression Y.  

Page 27: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 27/53

 Extending the NotationNon-terminal symbols can be augmented

 A variable can appear on RHS

 An arbitrary logical test can appear on RHS

DCG First Order Logic

 Digit (sem)  sem { 0  sem 9 }

 Number (sem)   Digit (sem)

 Number (sem)   Number (sem1) Digit (sem2)

{sem = 10  sem1 + sem2} 

(s=[sem])   Digit (sem , s)

 Digit (sem , s)   Number (sem , s)

 Number (sem , s1) /\  Digit (sem , s2) /\ 

sem = 10  sem1 + sem2 

 Number (sem , Append (s1 , s2)

Page 28: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 28/53

OverviewCommunication as Action

Types of Communicating Agents

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing)

Definite Clause Grammar (DCG)

 Augmenting a Grammar 

Semantic Interpretation

 Ambiguity and Disambiguity

 A Communicating Agent

Page 29: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 29/53

OvergenerationSimple grammar can overgenerate

Ex: “Me smells a stench.”  

To fix we must understand

Cases of English

Nominative - subjective - “I”   Accusative - objective - “me”  

Page 30: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 30/53

 New Rules

Use of Augmentation

S NP(case) 

VP

PP

Pronoun(Subjective) Pronoun(Objective)  

 NP(subjective) VP | … Pronoun(case) | Noun | Article Noun

VP NP(Objective) | … 

Preposition NP(Objective) 

 I | you | he | she | … 

me | you | him | her | … 

Changes needed to handle subjective and objective cases

S

 NPs

 Npo

VPPP

Pronouns

Pronouno 

 NPs  VP | … 

Pronouns | Noun | Article Noun

Pronouno | Noun | Article Noun

VP NPo  | … Preposition NPo

 I | you | he | she | … 

me | you | him | her | … 

Page 31: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 31/53

Verb SubcategorizationNow have slight improvement

Must create a sub-categorization listVerb Subcats Example

give [NP , PP]

[NP , NP]

give the gold in 3,3 to me

give me the gold

smell [NP]

[Adjective][PP]

smell a wumpus

smell awfulsmell like a wumpus

is [Adjective]

[PP]

[NP]

Is smelly

is in 2 2

is a pit

believe [S] Believe the smelly wumpus in 2 2 is dead

Page 32: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 32/53

Parse TreeS

 NP

VP([])

VP([NP])

VP([NP,NP]) NP NP

Pronoun Pronoun Article NounVerb([NP,NP])

You give me the gold

Page 33: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 33/53

OverviewCommunication as Action

Types of Communicating Agents

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing)

Definite Clause Grammar (DCG)

 Augmenting a Grammar

Semantic Interpretation 

 Ambiguity and Disambiguity

 A Communicating Agent

Page 34: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 34/53

Semantic InterpretationSemantic Interpretation: Responsible for combiningmeanings compositionally to get a set of possible interpretations 

Formal Languages

Compositional Semantics: The semantics of any phrase is afunction of its subphrases

•  X + Y 

We can handle an infinite grammar with a finite set of rules

Natural Languages

 Appears to have a noncompositional semantics

• “The batter hit the ball”  

Semantic interpretation alone cannot be certain of the right interpretation of a phrase or sentence  

Page 35: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 35/53

Semantic InterpretationSemantics as DCG Augmentation

The same idea used to specify the semantics of numbersand digits can applied to the complete language of 

mathematics

 Exp(sem) – > Exp(sem1) Operator (op) Exp(sem2) {sem = Apply(op, sem1 , sem2)}

 Exp(sem) – > ( Exp(sem) )

 Exp(sem) – > Number (sem)

 Digit(sem) – > sem { 0 sem  9 }

 Number (sem) – > Digit (sem)

 Number (sem) – > Number (sem1) Digit (sem2) { sem = 10 × sem1 + sem2 }

Operator (sem) – > sem { sem +, – ,×,÷}} 

Page 36: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 36/53

The Semantics of E 1 Semantic structure is very different from syntactic structure.

We use an intermediate form called a quasi-logical form which uses a new construction which we will call a quantified

term.  “every agent” -> [" a Agent (a)]

“Every agent smells a wumpus” 

$ e (e  Perceive([" a Agent (a)], [$ w Wumpus(w)], Nose)   During( Now, e))

Page 37: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 37/53

Pragmatic InterpretationThrough semantic interpretation, an agent can perceive a stringof words and use a grammar to derive a set of possiblesemantic interpretations.

Now we address the problem of completing the interpretationby adding information about the current situation

Information which is noncompositional and context-dependant 

Page 38: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 38/53

Pragmatic InterpretationIndexicals: Phrases that refer directly to the current situation

 “I am in Boston today.”  

 Anaphora: Phrases referring to objects that have beenmentioned previously

 “John was hungry. He entered a restaurant.”  

 “After John proposed to Marsha, they found a preacher and gotmarried. For the honeymoon, they went to Hawaii.”  

Deciding which reference is the right one is a part of disambiguation. 

Page 39: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 39/53

OverviewCommunication as Action

Types of Communicating Agents

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing)

Definite Clause Grammar (DCG)

 Augmenting a Grammar

Semantic Interpretation

 Ambiguity and Disambiguity 

 A Communicating Agent

Page 40: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 40/53

 Ambiguity and DisambiguationThe biggest problem in communicative exchange isthat most utterances are ambiguous .

Squad helps dog bite victim.

Red-hot star to wed astronomer.

Helicopter powered by human flies.

Once-sagging cloth diaper industry saved by full dumps.

Page 41: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 41/53

 AmbiguityLexical Ambiguity

a word has more than one meaning 

Syntactic Ambiguity (Structural Ambiguity)more than one possible parse for the phrase 

Semantic Ambiguity

follows from lexical or syntactic ambiguity

Referential Ambiguitysemantic ambiguity caused by anaphoric expressions 

Page 42: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 42/53

 AmbiguityPragmatic Ambiguity

Speaker and hearer disagree on what the current situationis. 

Local Ambiguity

 A substring can be parsed several ways.

 Vagueness

Natural languages are also vague

• “It’s hot outside.”  

Page 43: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 43/53

 DisambiguationDisambiguation is a question of diagnosis.

Models of the world are used to provide possibleinterpretations of a speech act.

Models of the speaker

Models of the hearer

It is difficult to pick the right interpretation becausethere may be several right ones.

Page 44: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 44/53

 DisambiguationIn general, disambiguation requires the combinationof four models:

the world model

the mental model

the language model

the acoustic model

Natural language often uses deliberate ambiguity.

Most language understanding programs ignore thispossibility

Page 45: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 45/53

 DisambiguationContext free grammars do not provide a very usefullanguage model.

Probabilistic context-free grammars (PCFG’s) 

each rewrite rule has a probability associated with it

S – > NP VP (0.9)S – >  S Conjunction S (0.1)

Page 46: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 46/53

OverviewCommunication as Action

Types of Communicating Agents

 A Formal Grammar for a Subset of EnglishSyntactic Analysis (Parsing)

Definite Clause Grammar (DCG)

 Augmenting a Grammar

Semantic Interpretation

 Ambiguity and Disambiguity

 A Communicating Agent 

Page 47: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 47/53

 A Communicating Agent How does this all fit in to an agent that cancommunicate?

Start with the wumpus world robot slave.

Extend the grammar to accept commands

 “Go east”  

 “Go to 2 2”  

Identify the kind (i.e, command or statement) of speech as part of the quasi-logical form.

Page 48: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 48/53

 A Communicating Agent Rules for commands and statementsS(Command (rel( Hearer )) – > VP(rel)

S(Statement (rel(obj)) – > NP(obj) VP(rel)

Rules for acknowledgementsS( Acknowledge(sem)) – > Ack (sem)

 Ack (True) – > yes 

 Ack (True) – > OK  

 Ack (False) – > no 

Page 49: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 49/53

Summary Agents send signals to each other using a speech act.

 All animals use some conventional signs to communicate, buthumans use language in a more sophisticated way that enables

them to communicate much moreFormal language theory and phrase structure grammars areuseful tools for dealing with some aspects of natural language

Communication involves

three steps by the speaker

• intention, generation and synthesis

four steps by the hearer

• perception, analysis, disambiguation and incorporation

Page 50: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 50/53

SummaryThe encoded message model of communication says that aspeaker encodes a representation of a proposition intolanguage, and the hearer decodes the message to uncover the

propositionThe situated language model states that the meaning of amessage is a function of both the message and the situation inwhich it occurs.

 Augmenting a grammar allows us to handle many problems

Definite Clause Grammar (DCG) is an extension of BNF that allowsfor augmentations

There are many algorithms for parsing strings.

I.e. bottom up, top down, combination, and dynamic

Page 51: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 51/53

SummaryPragmatic interpretation takes the current situation intoaccount to determine the effect of an utterance in context

Disambiguation is the process of deciding which of thepossible interpretations is the one that the speaker intended toconvey. 

Page 52: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 52/53

The End 

Page 53: 09.1 Communication

7/31/2019 09.1 Communication

http://slidepdf.com/reader/full/091-communication 53/53

 BibliographyNorvig, Peter and Russell, Stuart, 1995. “ Artificial Intelligence A Modern Approach ”, Prentice-Hall Inc., Upper Saddle River, NewJersey.