20
CSE 415 -- (c) S. Tanimot o, 2007 Natural Langu 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating with language Syntax Semantics Semantic grammars Augmented Transition Nets The STONEWORLD program

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

Embed Size (px)

Citation preview

Page 1: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

1

Natural Language Understanding

Outline:

MotivationThe SHRINK program, revisitedCommunicating with languageSyntaxSemanticsSemantic grammarsAugmented Transition NetsThe STONEWORLD program

Page 2: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

2

MotivationMake it easier for people to give commands to computers.

Allow computers to perform language translation.

Allow computers to listen to lectures and read books, in order alleviate the knowledge acquisition bottleneck.

Integrate robots into human society.

Page 3: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

3

Levels of Analysis for NLU(Read up from the acoustic level to the pragmatic level)

Pragmatic level (goals, intents, dialog, rhetorical structure, speech acts)

Semantic level (meaning, representation)

Syntactic level (grammar, phrase structure)

Lexical, Morphological level (words, inflections)

Phonological level (acoustic features -- phonemes)

Acoustic level (sensing, signal processing)

Page 4: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

4

The SHRINK Program, revisited

Holds a conversation with the user.

Works primarily at the pragmatic level, glossing over the semantic level, and ignoring or simplifying analysis at the other levels.

Illustrates how shallow a program’s knowledge can be and still present an image of understanding.

Demonstrates key ideas from J. Weizenbaum’s ELIZA program, published in 1966.

Page 5: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

5

Mechanisms in SHRINKProcessing is oriented towards maintaining an illusion of understanding.

Pattern matching used to “parse” user input.

The YOU-ME-MAP function transposes first and second person references.

Keyword-based rules respond to certain topics such as dreams, love, being positive or negative.

Questions to the SHRINK are transformed into questions to the user.

When all other rules fail, PUNT responses are used.

Page 6: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

6

A Sample Dialog with SHRINK>>> shrink()Welcome to my sofa!Please state your problem.Hi there.Tell me moreI have a little problem.How long have you had a little problem?Ever since I told my girlfriend that I love computers more than her.All is fair in love and war.Thanks. Maybe I should have told her that.Be more decisive.Ok.I see.Bye.Goodbye.

Page 7: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

7

Syntax, Semantics, PragmaticsBy taking a more systematic approach to NLU at these levels, we will be able to create more useful and reliable natural language interfaces.

Issues to resolve: What is the ultimate purpose of language, and how does that influence NLU?

How do phrase-structure grammars work?

How can meaning be interpreted and represented?

How can the syntax and semantics of a system be designed to match the needs of an application?

Page 8: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

8

Communicating with LanguageLanguage is for communication.

Communication usually means sending and receiving information.

Sentences describe events, states of the world, objects and ideas, feelings and attitudes, and hypothetical situations.

Phrase-structure grammars provide a method of structuring messages, allowing for a great variety of possible meanings.

Page 9: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

9

SyntaxDescribes the form, not meaning, of sentences in a language.

Syntax is traditionally described with formal systems called grammars.

A context free grammar can be specified with 4 components:G = (Σ, V, S, P), whereΣ is a finite set of terminal symbols called the alphabet.V is a finite set of nonterminal symbols.S is a distinguished member of V called the start symbol.P is a finite set of productions.

Page 10: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

10

Example Grammar

G = ({0, 1}, {S, A, B}, S, P), where

P = {S 01SS 10S

S 0S1

S 1S0

S 01

S 10}

Page 11: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

11

Example Grammar 2G = ({symbols, are, tools}, {S, N, V}, S, P), where

P = {S NVN

N symbols

N tools

V are}

A derivation of a sentence from S:S NVN tools VN tools are N tools are symbolsEach item in the sequence is a sentential form.

Page 12: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

12

ExerciseFor each of the strings below, determine whether or not it is in L(G), the language generated by G.If it’s in the language, give a derivation.

01λ01100101S10101S101

G = ({0, 1}, {S, A, B}, S, P), whereP = {S 01S, S 10S, S 0S1, S 1S0, S 01, S 10}

Page 13: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

13

Semantics

Representation of meaning using case frames.

The verb structures the frame:

“Alexander took an exam.”

Agent: AlexanderAction: take (write, submit to)Object: examTime: past

Page 14: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

14

Semantic Grammar

A semantic grammar is a grammar whose syntactic categories correspond directly to groups of words whose meanings can be largely inferred from the parse.

<command> <do-word> the <job-word>

<do-word> do | perform | start | finish

<job-word> job | task | command | activity | operation

“start the activity”“do the operation”“finish the job”

Page 15: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

15

Augmented Transition Nets

An ATN is a language processor that combines parsing and translation. It is based on a collection of transition diagrams.

<command>

<do-word>

<job-word>

<do-word> <job-word>

the

do, etc.

job, etc

Page 16: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

16

Stone WorldA microworld: 2-D cellular space in which various objects can be placed. An agent “Mace” that takes commands from the user, and which inhabits the microworld. Stationary objects: pillars, wells, quarries. Portable objects: stones, gems. Actions: Mace can move and can carry objects.

A natural-language interface: Augmented transition network based on a semantic grammar.

Page 17: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

17

Stone World MotivationDemonstrates a full combination of syntax, semantics, actions, and responses.

An artificial, closed world permits unambiguous interpretation.

Stone World offers a substrate upon which experiments can games can be constructed.

Stone World, while simple by comparison, shares these features with the well-known research system SHRDLU, developed by Terry Winograd at MIT.

Page 18: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

18

Stone World’s ATN

SHOW *

LASTG1 T2 T3 T4

P2 P3

G2 G3

DOWN,

*

IT

DOWN, (PUT-VERB)

(TAKE-VERB) UP,

(GO-VERB)

*TO (DNP1)

TOWARD (DNP1)

*

G1(NP1)

Page 19: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

19

Stone World’s ATN (Cont)

(ARTICLE) (OBJ-NOUN)

(ARTICLE)

(OBJ-NOUN)

(DIRECTION-NOUN)

DNP1 DNP2

NP1 NP2

Page 20: CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding 1 Natural Language Understanding Outline: Motivation The SHRINK program, revisited Communicating

CSE 415 -- (c) S. Tanimoto, 2007 Natural Language Understanding

20

Sample ConversationWALK NORTH *

I UNDERSTAND YOU. OK

GO TO THE WEST *

I UNDERSTAND YOU. OK

GO WEST *

I UNDERSTAND YOU. OK

TAKE A STONE FROM THE QUARRY *

I UNDERSTAND YOU. OK

DROP THE STONE TOWARD THE EAST *

I UNDERSTAND YOU. OK

TAKE A STONE *

I UNDERSTAND YOU. OK

DROP IT TO THE NORTH *

I UNDERSTAND YOU. OK

GO SOUTH *

I UNDERSTAND YOU. OK