i can parse you: grammars for dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf ·...

33
I Can Parse You: Grammars for Dialogs Martin Hirzel, Louis Mandel, Avraham Shinnar, Jérôme Siméon, Mandana Vaziri IBM Research, Yorktown Heights, NY, USA 9 May 2017, SNAPL 2017 Conference

Upload: others

Post on 03-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

I Can Parse You:Grammars for Dialogs

Martin Hirzel, Louis Mandel, Avraham Shinnar, Jérôme Siméon, Mandana Vaziri

IBM Research, Yorktown Heights, NY, USA

9 May 2017, SNAPL 2017 Conference

Page 2: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular Bot, Hello!

Hello, Human! I am a chat-bot that talks aboutchat-bots. What can I do for you?

I Can Parse You:Grammars for Dialogs

Martin Hirzel, Louis Mandel, Avraham Shinnar, Jérôme Siméon, Mandana Vaziri

IBM Research, Yorktown Heights, NY, USA

9 May 2017, SNAPL 2017 Conference

Page 3: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular Bot, that’s great!Can you just give my talk for me?

I am sorry, I don’t understand.Please rephrase.

C

H Circular Bot, Hello!

Hello, Human! I am a chat-bot that talks aboutchat-bots. What can I do for you?

I Can Parse You:Grammars for Dialogs

Martin Hirzel, Louis Mandel, Avraham Shinnar, Jérôme Siméon, Mandana Vaziri

IBM Research, Yorktown Heights, NY, USA

9 May 2017, SNAPL 2017 Conference

Page 4: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular Bot, what can you do?

I can:• Answer common questions about chat bots• Order pizza

C

H Circular Bot, that’s great!Can you just give my talk for me?

I am sorry, I don’t understand.Please rephrase.

C

H Circular Bot, Hello!

Hello, Human! I am a chat-bot that talks aboutchat-bots. What can I do for you?

IBM Research, Yorktown Heights, NY, USA

9 May 2017, SNAPL 2017 Conference

Page 5: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular Bot, what’s a chat bot?

We chat bots are computer programs that canhave a natural-language dialog with a human.We’re also known as conversational agents.

C

H Circular Bot, what can you do?

I can:• Answer common questions about chat bots• Order pizza

C

H Circular Bot, that’s great!Can you just give my talk for me?

I am sorry, I don’t understand.Please rephrase.

C Hello, Human! I am a chat-bot that talks aboutchat-bots. What can I do for you?

Page 6: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular Bot, what do chat bots do?

We have lots of use-cases, includingquestion answering, controlling devices,customer service, and ordering pizzas.

C

H Circular Bot, what’s a chat bot?

We chat bots are computer programs that canhave a natural-language dialog with a human.We’re also known as conversational agents.

C

H Circular Bot, what can you do?

I can:• Answer common questions about chat bots• Order pizza

C I am sorry, I don’t understand.Please rephrase.

Page 7: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C We augment human cognition.

C

H Circular Bot, what do chat bots do?

We have lots of use-cases, includingquestion answering, controlling devices,customer service, and ordering pizzas.

C

H Circular Bot, what’s a chat bot?

We chat bots are computer programs that canhave a natural-language dialog with a human.We’re also known as conversational agents.

C

H Circular Bot, what can you do?

I can:• Answer common questions about chat bots• Order pizza

Please rephrase.

Page 8: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular Bot, what does that mean?

I am sorry, I don’t understand.Would you like a pizza now, human?

C We augment human cognition.

C

H Circular Bot, what do chat bots do?

We have lots of use-cases, includingquestion answering, controlling devices,customer service, and ordering pizzas.

C

H Circular Bot, what’s a chat bot?

We chat bots are computer programs that canhave a natural-language dialog with a human.We’re also known as conversational agents.

• Answer common questions about chat bots• Order pizza

Page 9: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H I suppose.

Toppings?

C

H Circular Bot, what does that mean?

I am sorry, I don’t understand.Would you like a pizza now, human?

C We augment human cognition.

C

H Circular Bot, what do chat bots do?

We have lots of use-cases, includingquestion answering, controlling devices,customer service, and ordering pizzas.

C

H Circular Bot, what’s a chat bot?

We chat bots are computer programs that canhave a natural-language dialog with a human.We’re also known as conversational agents.

Page 10: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H A small chicken and mushrooms pizzaon a thin crust.

Chicken and mushrooms. What kind of crust?

C

H I suppose.

Toppings?

C

H Circular Bot, what does that mean?

I am sorry, I don’t understand.Would you like a pizza now, human?

C We augment human cognition.

C

H Circular Bot, what do chat bots do?

We have lots of use-cases, includingquestion answering, controlling devices,customer service, and ordering pizzas.

Page 11: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H I just told you, a small pizza with a thin crust.

Thin crust. What size?

C

H A small chicken and mushrooms pizzaon a thin crust.

Chicken and mushrooms. What kind of crust?

C

H I suppose.

Toppings?

C

H Circular Bot, what does that mean?

I am sorry, I don’t understand.Would you like a pizza now, human?

C We augment human cognition.

question answering, controlling devices,customer service, and ordering pizzas.

Page 12: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Small size.

I am sorry, I don’t understand.Choices are individual-size, medium, or large.What size?

C

H I just told you, a small pizza with a thin crust.

Thin crust. What size?

C

H A small chicken and mushrooms pizzaon a thin crust.

Chicken and mushrooms. What kind of crust?

C

H I suppose.

Toppings?

C I am sorry, I don’t understand.Would you like a pizza now, human?

Page 13: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Individual-size.

So that’s an individual-size chicken andmushrooms pizza on a thin crust, correct?

C

H Small size.

I am sorry, I don’t understand.Choices are individual-size, medium, or large.What size?

C

H I just told you, a small pizza with a thin crust.

Thin crust. What size?

C

H A small chicken and mushrooms pizzaon a thin crust.

Chicken and mushrooms. What kind of crust?

C Toppings?

Page 14: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Yes.

Would you like to add some blue cheeseat no additional cost?

C

H Individual-size.

So that’s an individual-size chicken andmushrooms pizza on a thin crust, correct?

C

H Small size.

I am sorry, I don’t understand.Choices are individual-size, medium, or large.What size?

C

H I just told you, a small pizza with a thin crust.

Thin crust. What size?

C Chicken and mushrooms. What kind of crust?

Page 15: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H No! I don’t like blue cheese.

Okay, adding blue cheese.

C

H Yes.

Would you like to add some blue cheeseat no additional cost?

C

H Individual-size.

So that’s an individual-size chicken andmushrooms pizza on a thin crust, correct?

C

H Small size.

I am sorry, I don’t understand.Choices are individual-size, medium, or large.What size?

C Thin crust. What size?

Page 16: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H No, you idiot!

No insults please. I’m limited to my programming.

C

H No! I don’t like blue cheese.

Okay, adding blue cheese.

C

H Yes.

Would you like to add some blue cheeseat no additional cost?

C

H Individual-size.

So that’s an individual-size chicken andmushrooms pizza on a thin crust, correct?

C I am sorry, I don’t understand.Choices are individual-size, medium, or large.What size?

Page 17: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular bot, why do consumers want chat-bots?

(Source: http://www.businessinsider.com/amazon-joins-the-chatbot-conversation-2016-12)

Consumers who said “yes” to being contactedvia a chat-bot gave the following reasons:

Resolve problems more quickly

No need for separate app

Keep a record of the interaction

53%

45%

36%

C

H No, you idiot!

No insults please. I’m limited to my programming.

C

H No! I don’t like blue cheese.

Okay, adding blue cheese.

Page 18: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular bot, why do service providers wantchat bots?

Service providers use chat bots to:• Increase customer satisfaction• Reduce the need for live agents• Be flexible about features

C

H Circular bot, why do consumers want chat-bots?

(Source: http://www.businessinsider.com/amazon-joins-the-chatbot-conversation-2016-12)

Consumers who said “yes” to being contactedvia a chat-bot gave the following reasons:

Resolve problems more quickly

No need for separate app

Keep a record of the interaction

53%

45%

36%

Page 19: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Circular bot, do chat bots really increasecustomer satisfaction?

I refuse to incriminate myself.How about you give a normal talk for a bit?

C

H Circular bot, why do service providers wantchat bots?

Service providers use chat bots to:• Increase customer satisfaction• Reduce the need for live agents• Be flexible about features

(Source: http://www.businessinsider.com/amazon-joins-the-chatbot-conversation-2016-12)

No need for separate app

Keep a record of the interaction

45%

36%

Page 20: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Who creates chat bots?

Low-code

developer

Subject

matter expert

Full stack

developer

Data

scientist

C

H Circular bot, do chat bots really increasecustomer satisfaction?

I refuse to incriminate myself.How about you give a normal talk for a bit?

C Service providers use chat bots to:• Increase customer satisfaction• Reduce the need for live agents• Be flexible about features

Page 21: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Typical chat bot architecture

Automated Speech Recognition (ASR)

Natural Language Understanding (NLU)

Dialog Controller

Text to Speech(TTS)

Natural Language Generation (NLG)

H Who creates chat bots?

Low-code

developer

Subject

matter expert

Full stack

developer

Data

scientist

Page 22: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Programming languages for the dialog controller

H Typical chat bot architecture

Automated Speech Recognition (ASR)

Natural Language Understanding (NLU)

Dialog Controller

Text to Speech(TTS)

Natural Language Generation (NLG)

Low-code

developer

Subject

matter expert

Full stack

developer

Data

scientist

Page 23: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

Finite automata, e.g.:

prompt /print “What size?”;read input

start

filled /$size = @size

not @size

@size

not understood /print “I am sorry, I don’t understand.”

not @sizeand not #help

help /print “Choices are individual-size, medium, or large.”

εε@size #help

H Programming languages for the dialog controller

H Typical chat bot architecture

Automated Speech Recognition (ASR)

Natural Language Understanding (NLU)

Dialog Controller

Text to Speech(TTS)

Natural Language Generation (NLG)

Page 24: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

Frames, e.g.:

Slot Input Prompt Help text

$size @size = enum { individual size, medium, large }

What size?

Choices are individual-size, medium, or large.

$crust @crust = enum {thin / New York style, thick / Chicago style }

What crust?

Choices are thin or thick.

$toppings Need a sub-dialog for collecting list here ...

What toppings?

You can pick zero or more of R

Finite automata, e.g.:

prompt /print “What size?”;read input

start

filled /$size = @size

not @size

@size

not understood /print “I am sorry, I don’t understand.”

not @sizeand not #help

help /print “Choices are individual-size, medium, or large.”

εε@size #help

H Programming languages for the dialog controller

Page 25: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Chat bots should be coherent.

Work towards a goal, e.g.:• Question answering• Command-and-control• Form filling• Diagnosis, problem resolution• Query formulation

Goal-driven patterns,see paper

Frames, e.g.:

Slot Input Prompt Help text

$size @size = enum { individual size, medium, large }

What size?

Choices are individual-size, medium, or large.

$crust @crust = enum {thin / New York style, thick / Chicago style }

What crust?

Choices are thin or thick.

$toppings Need a sub-dialog for collecting list here ...

What toppings?

You can pick zero or more of R

filled /$size = @size

help /print “Choices are individual-size, medium, or large.”

Page 26: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Chat bots should be flexible.

Handle deviations from the goal, e.g.:• Anaphora and ellipsis• Repair• Disambiguation• Elaboration• Stopping a discussion• Digression, interleaved dialog

Add-on patterns,see paper.

H Chat bots should be coherent.

Work towards a goal, e.g.:• Question answering• Command-and-control• Form filling• Diagnosis, problem resolution• Query formulation

Goal-driven patterns,see paper

$crust @crust = enum {thin / New York style, thick / Chicago style }

What crust?

Choices are thin or thick.

$toppings Need a sub-dialog for collecting list here ...

What toppings?

You can pick zero or more of R

Page 27: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Coherence-flexibility dilemma

Techniques that improve coherencereduce flexibility and vice versa.

H Chat bots should be flexible.

Handle deviations from the goal, e.g.:• Anaphora and ellipsis• Repair• Disambiguation• Elaboration• Stopping a discussion• Digression, interleaved dialog

Add-on patterns,see paper.

H Chat bots should be coherent.

Work towards a goal, e.g.:• Question answering• Command-and-control• Form filling• Diagnosis, problem resolution• Query formulation

Goal-driven patterns,see paper

Page 28: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Idea: grammars as DSL for chat bots

Specify linear sequence of interactions,concise, flexible, with error correction.

H Coherence-flexibility dilemma

Techniques that improve coherencereduce flexibility and vice versa.

H Chat bots should be flexible.

Handle deviations from the goal, e.g.:• Anaphora and ellipsis• Repair• Disambiguation• Elaboration• Stopping a discussion• Digression, interleaved dialog

Add-on patterns,see paper.

• Command-and-control• Form filling• Diagnosis, problem resolution• Query formulation

Goal-driven patterns,see paper

Page 29: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Chat-bot / parser analogy

Automated Speech Recognition (ASR)

Natural Language Understanding (NLU)

Dialog Controller

Text to Speech(TTS)

Natural Language Generation (NLG)

Lexing

Parsing

Pretty-printing;Error reporting

H Idea: grammars as DSL for chat bots

Specify linear sequence of interactions,concise, flexible, with error correction.

H Coherence-flexibility dilemma

Techniques that improve coherencereduce flexibility and vice versa.

• Disambiguation• Elaboration• Stopping a discussion• Digression, interleaved dialog

Add-on patterns,see paper.

Page 30: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Grammar example

pizza ::= topping* crust size

topping ::= ‘chicken’ | ‘mushrooms’ | ‘blue cheese’

crust ::=

‘thin’ / ‘New York style’

| ‘thick’ / ‘Chicago style’

size ::= ‘individual-size’ | ‘medium’ | ‘large’

H Chat-bot / parser analogy

Automated Speech Recognition (ASR)

Natural Language Understanding (NLU)

Dialog Controller

Text to Speech(TTS)

Natural Language Generation (NLG)

Lexing

Parsing

Pretty-printing;Error reporting

Specify linear sequence of interactions,concise, flexible, with error correction.

Page 31: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

H Broader issues with Cognitive Systems

• Safety and trust• Modularity and reuse• Lifecycle management• Boot-strapping

H Grammar example

pizza ::= topping* crust size

topping ::= ‘chicken’ | ‘mushrooms’ | ‘blue cheese’

crust ::=

‘thin’ / ‘New York style’

| ‘thick’ / ‘Chicago style’

size ::= ‘individual-size’ | ‘medium’ | ‘large’

Dialog Controller

Text to Speech(TTS)

Natural Language Generation (NLG)

Parsing

Pretty-printing;Error reporting

Page 32: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

C

H Thank you all for your attention, andthank you Circular Bot for your help!

Your blue-cheese pizza is ready now.

H Broader issues with Cognitive Systems

• Safety and trust• Modularity and reuse• Lifecycle management• Boot-strapping

H Grammar example

pizza ::= topping* crust size

topping ::= ‘chicken’ | ‘mushrooms’ | ‘blue cheese’

crust ::=

‘thin’ / ‘New York style’

| ‘thick’ / ‘Chicago style’

size ::= ‘individual-size’ | ‘medium’ | ‘large’

Page 33: I Can Parse You: Grammars for Dialogshirzels.com/martin/papers/snapl17-dialog-talk.pdf · 2017-05-10 · C H Circular Bot, that’s great! Can you just give my talk for me? I am sorry,

v Just kidding.

C

H Thank you all for your attention, andthank you Circular Bot for your help!

Your blue-cheese pizza is ready now.

H Broader issues with Cognitive Systems

• Safety and trust• Modularity and reuse• Lifecycle management• Boot-strapping

pizza ::= topping* crust size

topping ::= ‘chicken’ | ‘mushrooms’ | ‘blue cheese’

crust ::=

‘thin’ / ‘New York style’

| ‘thick’ / ‘Chicago style’

size ::= ‘individual-size’ | ‘medium’ | ‘large’