The Computer and Natural Language Speech acts Discourse structure - - PowerPoint PPT Presentation

the computer and natural language
SMART_READER_LITE
LIVE PREVIEW

The Computer and Natural Language Speech acts Discourse structure - - PowerPoint PPT Presentation

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue Basic facts Rules The Computer and Natural Language Speech acts Discourse structure (Ling 445/515) Early dialogue systems Turing test Topic 6: Dialogue


slide-1
SLIDE 1

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

The Computer and Natural Language (Ling 445/515)

Topic 6: Dialogue Systems

Markus Dickinson

  • Dept. of Linguistics, Indiana

Autumn 2007

1 / 64

slide-2
SLIDE 2

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

What are dialogue systems good for?

◮ We can book airline tickets over the phone without

dealing with error-prone humans.

◮ We can interact with our computer while keeping our

hands free.

◮ We can talk to a system that won’t have the same

predujices a human might (... depending on the programmer)

◮ When robots someday take over the world, we’ll be able

to understand their demands ;) Before we look at dialogue systems, though, we need to understand something about human dialogue

2 / 64

slide-3
SLIDE 3

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Human dialogue

How does dialogue, or discourse (= conversation), work? We will look at a few aspects of human-human interactions:

◮ Basic facts about dialogues ◮ Rules of conversation: Gricean maxims ◮ What utterances do: Speech acts ◮ Organization of conversation: Discourse structure

3 / 64

slide-4
SLIDE 4

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Basic facts about dialogues

Utterances

People do not necessarily speak in sentences

◮ Utterances: basic unit of conversation

◮ may span over several turns ◮ may have several utterances within one turn

AGENT: Yeah yeah the um let me see here we’ve got you on American flight nine thirty eight CUSTOMER: Yep. AGENT: leaving on the twentieth of June

  • ut of Orange County John Wayne

Airport at seven thirty p.m. CUSTOMER: Seven thirty. AGENT: and into uh San Fransisco at eight fifty seven.

4 / 64

slide-5
SLIDE 5

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Basic facts about dialogues

Taking turns

How humans communicate is relatively systematic

◮ Turn-taking: must know when it’s the right time to

contribute your turn

◮ Comes naturally to humans: overlaps and long pauses

are actually somewhat rare

◮ Adjacency pairs: two-part conversational structures

where turn-taking is usually quite clear

◮ question/answer: question is looking for an answer from

dialogue partner

◮ greeting/greeting ◮ request/grant ◮ etc. 5 / 64

slide-6
SLIDE 6

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Basic facts about dialogues

Common ground

Common ground: the set of things which both speakers believe to be true of the conversation.

◮ Part of classroom common ground is that we are at

Indiana in a linguistics class. Not part of the common ground is what I had for lunch.

◮ People assess what others know before making a new

contribution

◮ Starting a conversation about Greg would be confusing

because we have no Greg in our common ground

◮ Starting a conversation by saying I was just thinking

about an old friend of mine from Illinois named Greg is less confusing

6 / 64

slide-7
SLIDE 7

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Grounding

In order to establish common ground, speakers do various things:

◮ Backchannels = short utterance which indicates the

utterance was heard and that the speaker should continue. A: That’s a nice shirt. B: Mm-hmm.

◮ Acknowledgment of utterance: continued attention,

completing speaker’s utterance, and so on

◮ Asking clarifying questions

7 / 64

slide-8
SLIDE 8

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Rules of Conversation: Gricean Maxims

People often speak “indirectly,” but it’s very clear what they mean.

⇒ They obey what Grice (1975) referred to as the four

maxims (rules) or conversation

◮ All based on the cooperative principle = speakers are

both trying to contribute to the purposes of the conversation.

◮ We use these to infer what a speaker is really saying

8 / 64

slide-9
SLIDE 9

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Gricean maxim 1: Quantity

Quantity: Be exactly as informative as is required.

◮ Make your contribution as informative as is required (for

the current purposes of the exchange) A: How many pencils do you have? B: Two.

→ means exactly two (or would have said more)

◮ Do not make your contribution more informative than is

required. Violation: (passing by somebody on the way to class) A: How’s it going? B It’s complicated. Yesterday I was sick ...

9 / 64

slide-10
SLIDE 10

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Gricean maxim 2: Quality

Quality: Try to make your contribution one that is true.

◮ Do not say what you believe to be false ◮ Do not say that for which you lack adequate evidence

Violation: A: Do you know how to drive a stick-shift? B: Yes, I do. I’ve seen my dad do it many times.

10 / 64

slide-11
SLIDE 11

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Gricean maxim 3: Relevance

Relevance: Be relevant. A: Is Gail dating anyone these days? B: Well, she goes to Cleveland every weekend. We make an inference that Gail is dating somebody in Cleveland

◮ Otherwise, B’s statement doesn’t make much sense.

11 / 64

slide-12
SLIDE 12

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Gricean maxim 4: Manner

Manner: Be perspicuous (easy to understand).

◮ Avoid obscurity of expression

◮ In other words, avoid jargon when it’s not a part of the

common ground, e.g., words like prolixity

◮ Avoid ambiguity ◮ Be brief (avoid unnecessary prolixity)

◮ Similar to maxim of quantity, but think here of

long-winded conversations that provide the same amount of information as a shorter one

◮ Be orderly

12 / 64

slide-13
SLIDE 13

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Speech acts

So, what does each utterance do? How does it function?

◮ Utterances are often equated with actions (Austin

1962) For example, there are performative verbs; by saying them, you actually do what you say

◮ I (hereby) christen this ship The Swarthy. ◮ I pronounce you man and wife. ◮ I second that motion. ◮ I bet you five dollars the Hoosiers will win the NCAA

championship this year.

13 / 64

slide-14
SLIDE 14

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Kinds of speech acts

Searle (1975) lists several different actions utterances have:

◮ Assertives = assert that something is the case

e.g., suggest, boast, conclude

◮ Directives = commmand; attempt to get the listener to

do something

e.g., ask, order, request

◮ Commissives = commit to some future course of action

e.g., promise, plan, vow

◮ Expressives = express psychological state of the

speaker about some situation

e.g., thank, apologize, welcome

◮ Declarations = bring about a different state of the world

merely by saying them

e.g., the performatives we saw earlier

14 / 64

slide-15
SLIDE 15

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Indirect Speech Acts

Speech acts can be direct or indirect

◮ Direct: Form matches meaning.

A: Please take out the garbage. imperative structure & imperative meaning

◮ Indirect: The form and the meaning are different.

A: The garbage isn’t out yet. declarative structure but imperative/directive meaning A: Could you take out the garbage? interrogative structure but imperative/request meaning

⇒ How do we encode such distinctions in a computer?

15 / 64

slide-16
SLIDE 16

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

DAMSL

People have marked up text with different labels for speech acts. The Dialogue Act Markup in Several Layers (DAMSL) is a scheme of speech acts people use to annotate texts

◮ forward-looking functions: look for a response

◮ question, request, etc.

◮ backward-looking functions: provide a response

◮ answer, agreement, etc.

Note the resemblance to adjacency pairs.

16 / 64

slide-17
SLIDE 17

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Using DAMSL in a computer

Using the DAMSL scheme,

◮ People annotate a text, or a corpus ◮ People can train a system on it and attempt to mark a

new text with these labels.

◮ People can use the functions to tell a dialogue system

what to do next

◮ The system keeps track of the previous forward-looking

function to know how to respond.

◮ If a dialogue system needs an answer, it knows what

kind of forward-looking function to use to get the human to provide one

17 / 64

slide-18
SLIDE 18

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Discourse structure

But if a dialogue system wants to know what to do next, it needs more than forward and backward-looking functions Discourse, or dialogue, has some structure to it—not just a bunch of random, loosely-connected statements.

◮ Every discourse has a discourse purpose = a reason

for talking (Grosz and Sidner 1986)

◮ Purpose is clearer in task-based dialogues = speakers

are trying to achieve some goal together

e.g., giving directions or fixing a car

System goal: figure out the intentions of the speakers

18 / 64

slide-19
SLIDE 19

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Subdialogues

Within the overall dialogue, there are subdialogues

◮ In order to book a flight, you must ask me where I want

to go.

◮ I may have to correct you in a subdialogue

I said Columbus, not Columbia A dialogue system needs to keep track of these subdialogues in order to know what is appropriate to say:

◮ Imagine that in a converstaion we talk about your

summer plans (to Yellowstone), the state of Wyoming, and my aunt (in WY)

◮ If we’re now talking about my aunt, it is inappropriate for

you to suddenly say, “I should go to Holland this summer.”

19 / 64

slide-20
SLIDE 20

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Determining structure

◮ If we figure out the discourse structure automatically,

the computer can keep track of what’s going on.

◮ Know what topics are appropriate ◮ Better able to know what pronouns and definite noun

phrases (e.g., the dog) refer to.

◮ Determining structure is not always clear-cut, and

humans can disagree as to the correct structure.

20 / 64

slide-21
SLIDE 21

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

The Turing Test

Turning to what dialogue systems do, we’ll start with a quick discussion of how this fits into artificial intelligence The Turing Test, developed by Alan Turing, distinguishes between a human and a computer in dialogue.

◮ If I can tell I am interacting with a computer, it has failed

the Turing Test

◮ If I am convinced I am interacting with a human, yet it’s

a computer, then the program has passed the Turing Test. This is a very practical way of looking at artificial intelligence (and not without its debate)

21 / 64

slide-22
SLIDE 22

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

ELIZA

ELIZA was a computer program written by Joseph Weizenbaum in the mid-1960s

◮ Simulation of a (Rogerian) psychotherapist.

◮ Rogerian therapist asks questions and gives

backchannels more than providing advice

◮ User types questions, and ELIZA responds.

22 / 64

slide-23
SLIDE 23

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Example conversation

Taken from Weizenbaum’s 1966 paper: USER: Men are all alike. ELIZA: IN WHAT WAY? USER: They’re always bugging us about something

  • r other.

ELIZA: CAN YOU THINK OF A SPECIFIC EXAM- PLE? USER: Well, my boyfriend made me come here. ELIZA: YOUR BOYFRIEND MADE YOU COME HERE USER: He says I’m depressed much of the time. ELIZA: I AM SORRY TO HEAR YOU ARE DE- PRESSED USER: It’s true. I am unhappy ELIZA: DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UNHAPPY

23 / 64

slide-24
SLIDE 24

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Example conversation (cont.)

USER: I need some help, that much seems certain. ELIZA: WHAT WOULD IT MEAN TO YOU IF YOU GOT SOME HELP USER: Perhaps I could learn to get along with my mother. ELIZA: TELL ME MORE ABOUT YOUR FAMILY USER: My mother takes care of me. ELIZA: WHO ELSE IN YOUR FAMILY TAKES CARE OF YOU USER: My father. ELIZA: YOUR FATHER USER: You are like my father in some ways. ELIZA: WHAT RESEMBLANCE DO YOU SEE

24 / 64

slide-25
SLIDE 25

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Example conversation (cont.)

USER: You are not very aggressive but I think you don’t want me to notice that. ELIZA: WHAT MAKES YOU THINK I AM NOT VERY AGGRESSIVE USER: You don’t argue with me. ELIZA: WHY DO YOU THINK I DON’T ARGUE WITH YOU USER: You are afraid of me. ELIZA: DOES IT PLEASE YOU TO BELIEVE I AM AFRAID OF YOU USER: My father is afraid of everybody. ELIZA: WHAT ELSE COMES TO YOUR MIND WHEN YOU THINK OF YOUR FATHER USER: Bullies. ELIZA: DOES THAT HAVE ANYTHING TO DO WITH THE FACT THAT YOUR BOYFRIEND MADE YOU COME HERE

25 / 64

slide-26
SLIDE 26

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Properties of ELIZA

ELIZA seems to:

◮ show some understanding of English.

◮ WHAT RESEMBLANCE DO YOU SEE in response to

You are like my father in some ways.

◮ have some understanding of real-world problems.

◮ TELL ME MORE ABOUT YOUR FAMILY in response to

Perhaps I could learn to get along with my mother.

◮ keep track of (some of) the conversation

◮ DOES THAT HAVE ANYTHING TO DO WITH THE

FACT THAT YOUR BOYFRIEND MADE YOU COME HERE twelve lines after Well, my boyfriend made me come here.

26 / 64

slide-27
SLIDE 27

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Four types of responses

It turns out that ELIZA is very limited in what it/she can say

  • 1. A general question or statement

◮ DOES THAT TROUBLE YOU, BEWARE OF

ADDICTIONS, etc.

  • 2. A transformed version of the previous statement

USER: Well, my boyfriend made me come here. ELIZA: YOUR BOYFRIEND MADE YOU COME HERE

27 / 64

slide-28
SLIDE 28

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Four types of responses (cont.)

  • 3. A reponse relevant to the topic of the previous

statement USER: It’s true. I am unhappy ELIZA: DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UN- HAPPY

  • 4. A reproduction of an earlier statement

ELIZA: FIRST TELL ME WHY YOU HAVE COME HERE USER: To talk to a computer ELIZA: TO TALK TO A COMPUTER USER: Yes, to talk to a computer

28 / 64

slide-29
SLIDE 29

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

How ELIZA works

They are many different implementations of ELIZA out there, but they all work in the same general way:

  • 1. Transform input to change the point of view (I and you)
  • 2. Perform pattern recognition (pattern matching)
  • 3. Substitute keywords into canned phrases, or submit a

general canned phrase They can also more or less include some history of the conversation

29 / 64

slide-30
SLIDE 30

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

  • 1. Transform input

ELIZA has to be ready to give a response with the appropriate pronouns about itself or the user:

◮ you becomes I (and vice versa) ◮ my becomes your (and vice versa) ◮ adjustments are made for I to be turned into me → if a

sentence ends in I, change it to me.

◮ This doesn’t always work right:

USER: If I could explain to you I could explain any- thing to anyone ELIZA: IF YOU COULD EXPLAIN TO I YOU COULD EXPLAIN ANYTHING TO ANYONE

30 / 64

slide-31
SLIDE 31

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

  • 2. Pattern recognition

If a pattern matches the transformed input, choose one of those reponses. Otherwise choose a general purpose response.

◮ See want in user’s statement

→ respond with: BEWARE OF ADDICTIONS

◮ See need X in user’s statement

→ respond with: CAN YOU DO WITHOUT X

◮ user’s statement eliza is a very simple program

matches the template X is Y

◮ template = a specified pattern with slots to be filled in

If no template is matched, just say something like TELL ME MORE.

◮ For multiple matches, select one at random.

31 / 64

slide-32
SLIDE 32

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

  • 3. Canned phrases

Everything ELIZA says is some sort of canned phrase.

◮ ELIZA does not “build up” a sentence from words;

rather, it spits out a single phrase, perhaps composed

  • f a few patterns.

ELIZA will either give a complete canned phrase or a mixture of a canned phrase with something you said—e.g., TELL ME MORE ABOUT X

32 / 64

slide-33
SLIDE 33

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Why does ELIZA work so well?

ELIZA has fooled people before into thinking it was a human ... how?

◮ User assumptions/expectations: if you’re looking for a

Rogerian psychotherapist, you may find what you expected.

◮ In theory, pattern matching can match a lot of user

statements, given a large database of patterns.

◮ The way conversation works was taken into account

when creating ELIZA

◮ Respond with something related to the previous

statement; use some of the same vocab the other person did; etc.

33 / 64

slide-34
SLIDE 34

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

How can we tell that ELIZA isn’t a human?

A number of clues tell us that ELIZA is a computer:

◮ Lack of initiative ◮ Lack of knowledge

ELIZA knows nothing about the real world

◮ Lack of common sense ◮ Lack of true grammar/syntax = structure of sentences

◮ Say you peabrain to it and you might get ME

PEABRAIN back.

◮ Need two separate patterns for Computers worry me

very little. and I’m not worried much by computers.

◮ Doesn’t have (much of) a memory

Still, ELIZA also started a whole phenomenon of chatterbots

34 / 64

slide-35
SLIDE 35

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

PARRY

PARRY (Colby et al 1971)

◮ More verbal than ELIZA in some ways, i.e., talks for

longer durations

◮ keeps track of “global” emotional state

◮ when the anger variable is high, for example, PARRY

will choose from a set of “hostile” options.

“With Parry, Dr. Colby established that a computer chip could be programmed to imitate a paranoid schizophrenic.” http://www.edu-cyberpg.com/Linguistics/Parry.html

35 / 64

slide-36
SLIDE 36

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

SHRDLU

SHRDLU (Winograd 1972)

◮ simulated a robot who could manipulate toy blocks

(“The BLOCKS World”)

◮ Given input such as: Move the red block on top of the

smaller green one.

◮ SHRDLU would then hopefully move the red block as

indicated

◮ used an extensive English grammar ◮ used some logical representation of meaning

http://hci.stanford.edu/∼winograd/shrdlu/ p.s. Name comes from the fact that some keyboards used to represent the more frequent letters in English together: ETAOIN SHRDLU

36 / 64

slide-37
SLIDE 37

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

ALICE

ALICE is a more advanced chatterbot, which won the 2004 Loebner Prize

◮ Loebner Prize = instantiation of the Turing Test:

$100,000 for the first computer to pass the Turing Test (hasn’t happened yet)

◮ Each year, the most human-like computer wins $2000

You can chat with ALICE at: http://www.pandorabots.com/ pandora/talk?botid=f5d922d97e345aa1

37 / 64

slide-38
SLIDE 38

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

How ALICE works

See http://www.alicebot.org/anatomy.html

◮ ALICE also does pattern-matching like ELIZA

◮ The patterns are based on the idea that there are a few

very common queries to a computer, and these should be dealt with first

◮ Uses a form of case-based reasoning = select an

appropriate response from memory based on how similar the query is to something in memory

◮ ALICE stores units of knowledge, or categories, from

which to draw upon for a response

◮ ALICE also keeps track of the current topic, based on

what category it had to use for its last response

38 / 64

slide-39
SLIDE 39

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Making your own chatterbot

http://www.alicebot.org/aiml.html contains information on downloading ALICE and creating your own chatterbot

◮ Can define the personality of the bot ◮ Can define the exact knowledge base ◮ Can define new patterns and templates

But remember that in all that you are doing, it is still just a pattern-matcher!

39 / 64

slide-40
SLIDE 40

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

From Then Until Now

All of these chatterbots are just pattern-matchers, albeit of varying complexity

◮ There has been a push to add linguistic and real-world

knowledge to dialogue systems

◮ Which is why we spent so much time talking about how

real dialogue works

40 / 64

slide-41
SLIDE 41

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Modern dialogue systems

◮ Overview of a basic dialogue system: TRIPS system ◮ Dialogue manager: Finite-state machines ◮ Natural Language Understanding: Frame-based

systems

◮ Natural Language Generation ◮ A Relevant Task: Pronoun Resolution ◮ Obtaining Data: Spoken language corpora

41 / 64

slide-42
SLIDE 42

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Example dialogue system: TRIPS

TRIPS: extension of the earlier TRAINS system at the University of Rochester

◮ Human works with TRIPS in order to construct plans in

a crisis situation: a hurricane is approaching the island

  • f Pacifica, and the people must be evacuated.

◮ Features:

◮ Task is clear ◮ Quality of task is easily measured ◮ Can vary the complexity of the task

◮ Complex model of collaborative problem-solving

Other dialogue systems resemble TRIPS in their layout

42 / 64

slide-43
SLIDE 43

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Dialogue system set-up

Typically, a dialogue system has different modules = independent systems which interact with each other

  • 1. ASR system takes speech and gives it to Natural

Language Understanding (NLU) system

  • 2. The NLU system interprets the language and feeds that

to a Dialogue Manager

  • 3. The Dialogue Manager consults its internal databases

(Task Manager, maybe Flight Info database, etc.) and figures out what to do next

  • 4. The system’s response is given to the Natural Language

Generation system, which creates a real sentence

  • 5. And this real sentence is given to a TTS system

43 / 64

slide-44
SLIDE 44

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

TRIPS system

44 / 64

slide-45
SLIDE 45

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Dialogue manager

Dialogue manager, or discourse manager, controls the flow

  • f a conversation

◮ Decide whose turn it is ◮ Decide what items need attention ◮ Feed input and output to the linguistic systems.

One way to implement a dialogue manager is to use state transition networks

45 / 64

slide-46
SLIDE 46

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

State transition networks

Well-structured dialogue can be modeled with a state transition network. Works best when the user only has to answer questions, i.e., is very constrained

◮ State 1: I know nothing, so I need to ask for the user’s

name.

◮ If the user gives me a name, go to State 2 ◮ If the user does not give me a name, go back to State 1

◮ State 2: I know the user’s name, so I ask for the user’s

birthday.

◮ If a birthday is given, go to State 3. ◮ If a non-birthday is given, go to State 2. ◮ If the user claims their name was wrong, go back to

State 1.

46 / 64

slide-47
SLIDE 47

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Finite-state automata

A state transition network is basically just a finite-state automaton (FSA) = network of states and transitions between states.

◮ Move from state to state when conditions on the arcs

are met

◮ In this way, can model what course of action to take

when presented with an input There is a whole theory of FSAs, and it turns out that they are equivalent to regular expressions

47 / 64

slide-48
SLIDE 48

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Frame-based systems

Dialogue systems allowing more complexity can be modeled by using frames, or templates

BOOK-FLIGHT(Customer, Flight): DEPARTURE-DATE(Flight) = ? DEPARTURE-TIME(Flight) = ? PAYMENT-METHOD(Customer) = ? NUMBER-OF-REQUESTED-SEATS = ? NUMBER-OF-OPEN-SEATS(Flight) = ? ... Effect: FLIGHT-BOOKED(Customer, Flight) = Yes?/No?

◮ When a user says, I want to leave Dallas on March 3,

DEPARTURE-DATE & DEPARTURE-CITY get filled in

◮ Only when all of the template has been filled in is the

flight acutally booked

48 / 64

slide-49
SLIDE 49

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Semantic grammars

But how do we figure out what to put into the template? People often use semantic grammars → akin to context-free grammars, but they use semantic concepts SHOW

show me | i want | can i see DEPART-TIME

(after|around|before) HOUR| morning | afternoon | evening HOUR

  • ne|two|three|four|...|twelve (AMPM)

AMPM

am | pm FLIGHTS

(a) flight | flights ORIGIN

from CITY DESTINATION

to CITY CITY

Boston |San Francisco |...

49 / 64

slide-50
SLIDE 50

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Parsing difficulties

Confirmation and repair strategies

Aside from needing restricted input, parsing with a semantic grammar faces other challenges from spoken language

◮ The system has to account for ill-formed input and

possibly repairs that humans make. A: I’d like to take the D Train, um, no, the A Train.

◮ Sometimes the system will have to confirm what a user

said. EXPLICIT So you want to travel from Amster- dam to Utrecht? IMPLICIT When do you want to travel from Amsterdam to Utrecht?

50 / 64

slide-51
SLIDE 51

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Parsing difficulties

Inferring Intention

And, of course, there are Gricean-type inferences that we’d like a computer to make

◮ Convert an indirect speech act into something a

computer can use. A: Can you give me a list of flights from Atlanta?

◮ If the user asks if I’m capable of doing something, it

probably wants me to do that thing.

51 / 64

slide-52
SLIDE 52

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Natural Language Generation

Once the system has some information, it will want to give a response. The dialogue manager will tell the natural language generation (NLG) unit what needs to be said

◮ NLG could just use a template to respond:

◮ What time do you want to leave CITY-ORIG?

◮ Or the dialogue manager could build a semantic

representation, which is then fed into a sentence builder (which uses a grammar and so forth)

◮ Similar to generating MT sentences from a semantic

representation

52 / 64

slide-53
SLIDE 53

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Pronoun resolution

For both the NLU (input) and NLG (output) units, there is a need to understand how pronouns work Consider the difference in following system outputs: A1: Please say the start time. ... A1: Please say the duration. ... A1: Please say the subject. A2: First, tell me the date. ... A2: Next, I’ll need the time it starts. ... A2: Thanks ... Now, how long is it supposed to last? ...

53 / 64

slide-54
SLIDE 54

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Reference

We call what a word refers to its reference = using expressions to refer to things

◮ Indefinite noun phrases: new to the discourse, e.g. a

book, some books

◮ Definite noun phrases: something identifiable to the

listener, e.g. the book, those books

◮ Pronouns: replacement for a noun phrase, e.g. it, she,

etc. Getting the reference right will make the system sound more natural

54 / 64

slide-55
SLIDE 55

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Coreference

These different kinds of noun phrases can refer to the same thing, i.e., we have coreference (1) I saw a monkey yesterday. The dumb thing was wily, and it kept throwing things at me. a monkey, the dumb thing, and it all refer to the same real-world creature.

55 / 64

slide-56
SLIDE 56

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Preferences for Pronoun Reference

We know they all co-refer, but how can a computer tell? How does it go about solving the task of pronoun resolution?

◮ Syntactic and Semantic Constraints ◮ General Preferences/Heuristics

Task: find the previous noun phrase (NP) in the discourse which the current pronoun (or definite NP) refers to.

56 / 64

slide-57
SLIDE 57

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Syntactic and Semantic Constraints

◮ Number, gender, and person agreement: co-referents

must agree in all of these properties (2) a. John has a new car. It/*They is red. (number)

  • b. John has a new car. He (=John) is attractive.

(gender)

  • c. John and I have new cars. We/*They love

these cars. (person)

◮ Syntactic constraints: reflexives (himself, herself, ...)

generally refer to subject of sentence (3) John bought him/himself a new car.

57 / 64

slide-58
SLIDE 58

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Selectional restrictions

◮ Selectional restrictions: verbs pick out what kinds of

nouns they can have for subjects and objects.

◮ drive needs a human object and a drivable object.

(4) John parked his car in the garage. He had driven it around for a bit. Note that these restrictions can be extended: The White House said yesterday ...

58 / 64

slide-59
SLIDE 59

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

General Preferences

After filtering out unwanted referents due to agreement and so on, we use various heuristics to find the referent.

◮ Recency: pronoun refers to most recent possible NP

(5) John bought a cookie, and I bought a cake. Mary ate it.

◮ Subject over Object: prefer matching the pronoun to a

previous subject of a sentence over the sentence’s pronoun. (6) John hit Bill. Then I asked him to come with me.

59 / 64

slide-60
SLIDE 60

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

General Preferences (cont.)

◮ Repeated mention: if someone keeps getting

mentioned, they’re more likely to be the referent of a pronoun.

◮ Parallelism: Back-to-back sentences with similar

structures can help pick out the referent. (7) Jim went with Carl to the supermarket. And I went with him to the gas station.

60 / 64

slide-61
SLIDE 61

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Resolving Pronouns

So, we can combine all this knowledge into a system for resolving pronouns.

  • 1. Take all nouns in a sentence and make a list of possible

referents.

  • 2. Rank the nouns in terms of recency, frequency,

subjecthood, and so on.

  • 3. In the next sentence, try to match the pronoun with

something in that list, starting with the most probable.

  • 4. Rule out any “match” which violates agreement or other

syntactic and semantic constraints

61 / 64

slide-62
SLIDE 62

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Human-computer interaction

To figure out how a system should work, we look at human-computer interaction

◮ We look at corpora = large texts of collected data, often

annotated with linguistic properties A couple kinds of dialogue corpora:

◮ Natural dialogues = A record of two (or more) humans

speaking with one another, often about a task

◮ Wizard of Oz dialogues = A person talks to a

“computer”, which is actually a human (thus the WOZ analogy)

62 / 64

slide-63
SLIDE 63

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Natural dialogues

Pluses:

◮ Natural user tasks and needs ◮ Easy to set up and record

Minuses:

◮ These record human-human interactions, not

human-computer interactions

◮ People often speak differently to a computer, will often

adapt to the way a computer is talking to them.

63 / 64

slide-64
SLIDE 64

Computers and Language Topic 6: Dialogue Systems Introduction Human dialogue

Basic facts Rules Speech acts Discourse structure

Early dialogue systems

Turing test ELIZA Other chatterbots

Modern dialogue systems

TRIPS system Dialogue manager Frame-based systems Natural Language Generation Pronoun resolution Human-computer interaction

Wizard of Oz dialogues

“Computer” (wizard) is actually a human in disguise. Pluses:

◮ Provide insights on human-computer interaction (HCI)

without seting up a computer capable of HCI

◮ Allow freedom in the range of tasks you can cover

Minuses:

◮ Often an artificial task ◮ Can take a lot of computing resources to set up ◮ Need wizards who can type fast, accurately, and in a

rather stiff manner, if they are to emulate a computer

◮ May not get consistent behavior from the wizard across

different attempts

64 / 64