29
CS 182 Sections 103 - 104 slides created by: Eva Mok ([email protected]) modified by jgm April 26, 2006

CS 182 Sections 103 - 104 slides created by: Eva Mok ([email protected]) modified by jgm April 26, 2006

  • View
    216

  • Download
    1

Embed Size (px)

Citation preview

CS 182Sections 103 - 104

slides created by:

Eva Mok ([email protected])

modified by jgm

April 26, 2006

Announcements

• a9 due Tuesday, May 2nd, 11:59pm

• final paper due Tuesday May 9th, 11:59pm

• final exam Tuesday May 9th in class

• final review?

Schedule

• Last Week

– Constructions, ECG

– Models of language learning

• This Week

– Embodied Construction Grammar learning

– (Bayesian) psychological model of sentence processing

• Next Week

– Applications

– Wrap-Up

Quiz

1. How does the analyzer use the constructions to parse a sentence?

2. What is the process by which new constructions are learned from <utterance, situation> pairs?

3. What are ways to re-organize and consolidate the current grammar?

4. What metric is used to determine when to form a new construction?

Quiz

1. How does the analyzer use the constructions to parse a sentence?

2. What is the process by which new constructions are learned from <utterance, situation> pairs?

3. What are ways to re-organize and consolidate the current grammar?

4. What metric is used to determine when to form a new construction?

“you” you schema Addresseesubcase of Human

FORM (sound) MEANING (stuff)

Analyzing “You Throw The Ball”

“throw” throw

schema Throwroles:

throwerthrowee

“ball” ball schema Ballsubcase of Object

“block” blockschema Block

subcase of Object

t1 before t2t2 before t3

Thrower-Throw-Object

t2.thrower ↔ t1t2.throwee ↔ t3

“the”

Addressee

Throwthrowerthrowee

Ball

I will get the cup

the analyzer allows the skipping of unknown lexical items

here is the SemSpec

CauseMove1:CauseMove mover = {Cup1:Cup} direction = {Place2:Place} causer = {Entity4:Speaker} motion = Move1:Move mover = {Cup1:Cup} direction = Place2:Place agent = {Entity4:Speaker} agent = {Entity4:Speaker} patient = {Cup1:Cup}Referent2:Referent category = {Cup1:Cup} resolved-ref = {Cup1:Cup}Referent1:Referent category = {Entity4:Speaker} resolved-ref = {Entity4:Speaker}

Remember that the transitive construction takes 3 constituents:

agt : Ref-Exprv : Cause-Motion-Verbobj : Ref-Expr

their meaning poles are:agt : Referentv : CauseMoveobj : Referent

Another way to think of the SemSpec

Analyzer Chart

Chart Entry 0: Transitive-Cn1 span: [0, 4] processed input: i

bring cup Skipped: 1 3 semantic coherence: 0.56 I-Cn1 span: [0, 0] processed input: i Skipped: none semantic coherence: 0.3333333333333333Chart Entry 2: Bring-Cn1 span: [2, 2] processed input: bring Skipped: none semantic coherence: 0.9090909090909091Chart Entry 4: Cup-Cn1 span: [4, 4] processed input: cup Skipped: none semantic coherence: 0.2857142857142857

Analyzing in ECG

create a recognizer for each construction in the grammar

for each level j (in ascending order)

repeat

for each recognizer r in j

for each position p of utterance

initiate r starting at p

until the number of states in the chart doesn't change

Recognizer for the Transitive-Cn

• an example of a level-1 construction is Red-Ball-Cn

• each recognizer looks for its constituents in order (the ordering constraints on the constituents can be a partial ordering)

agt v obj

I get cuplevel 0

level 2

level 1

Constructions

(Utterance, Situation)

1. Learner passes input (Utterance + Situation) and current grammar to Analyzer.

Analyze

Semantic Specification,

Constructional Analysis

2. Analyzer produces SemSpec and Constructional Analysis.

3. Learner updates grammar:

Hypothesize

a. Hypothesize new map.

Reorganize

b. Reorganize grammar

(merge or compose).c. Reinforce

(based on usage).

Learning-Analysis Cycle (Chang, 2004)

Quiz

1. How does the analyzer use the constructions to parse a sentence?

2. What is the process by which new constructions are learned from <utterance, situation> pairs?

3. What are ways to re-organize and consolidate the current grammar?

4. What metric is used to determine when to form a new construction?

Acquisition

Reorganize

Hypothesize

Production

Utterance

(Comm. Intent, Situation)

Generate

Constructions

(Utterance, Situation)

Analysis

Comprehension

Analyze

Partial

Usage-based Language Learning

Basic Learning Idea

• The learner’s current grammar produces a certain analysis for an input sentence

• The context contains richer information (e.g. bindings) that are unaccounted for in the analysis

• Find a way to account for these meaning relations (by looking for corresponding form relations)

SemSpecr1r2

r1r2r3

r1r2

Contextr1r2

r1r2r3

r1r2

“you”

“throw”

“ball”

you

throw

ball

“block” block

schema Addresseesubcase of Human

FORM (sound) MEANING (stuff)lexical constructions

Initial Single-Word Stage

schema Throwroles:

throwerthrowee

schema Ballsubcase of Object

schema Blocksubcase of Object

“you” you schema Addresseesubcase of Human

FORM MEANING

New Data: “You Throw The Ball”

“throw” throw

schema Throwroles:

throwerthrowee

“ball” ball schema Ballsubcase of Object

“block” blockschema Block

subcase of Object

“the”

Addressee

Throwthrowerthrowee

Ball

Self

SITUATION

Addressee

Throwthrowerthrowee

Ball

before

role-filler

throw-ball

Relational Mapping Scenarios

Af

Bf

Am

Bm

A

B

form-relation

role-filler

throw ball throw.throwee ↔ ball

Af

Bf

Am

Bm

A

B

form-relation

role-filler

X

role-filler

put ball down put.mover ↔ balldown.tr ↔ ball

Af

Bf

Am

Bm

A

B

form-relation

role-filler

Y

role-filler

Nomi ball possession.possessor ↔ Nomipossession.possessed ↔

ball

Quiz

1. How does the analyzer use the constructions to parse a sentence?

2. What is the process by which new constructions are learned from <utterance, situation> pairs?

3. What are ways to re-organize and consolidate the current grammar?

4. What metric is used to determine when to form a new construction?

Merging Similar Constructions

throw before block Throw.throwee = Block

throw before ball Throw.throwee = Ball

throw before-s ing Throw.aspect = ongoing

throw-ing the ball

throw the block

throw before Objectf THROW.throwee = Objectm

THROW-OBJECT

Resulting Construction

construction THROW-OBJECTconstructional constituentst : THROWo : OBJECT

formtf before of

meaning tm.throwee ↔ om

Composing Co-occurring Constructions

ball before offMotion mm.mover = Ballm.path = Offball off

throw before ball Throw.throwee = Ball

throw the ball

throw before ball ball before off

THROW.throwee = BallMotion mm.mover = Ballm.path = Off

THROW-BALL-OFF

Resulting Constructionconstruction THROW-BALL-OFFconstructional constituentst : THROWb : BALLo : OFF

formtf before bf

bf before of

meaning evokes MOTION as m tm.throwee ↔ bm

m.mover ↔ bm

m.path ↔ om

Quiz

1. How does the analyzer use the constructions to parse a sentence?

2. What is the process by which new constructions are learned from <utterance, situation> pairs?

3. What are ways to re-organize and consolidate the current grammar?

4. What metric is used to determine when to form a new construction?

Minimum Description Length

• Choose grammar G to minimize cost(G|D):– cost(G|D) = α • size(G) + β • complexity(D|G)

– Approximates Bayesian learning; cost(G|D) ≈ 1/posterior probability ≈ 1/P(G|D)

• Size of grammar = size(G) ≈ 1/prior ≈ 1/P(G)– favor fewer/smaller constructions/roles; isomorphic

mappings

• Complexity of data given grammar ≈ 1/likelihood ≈ 1/P(D|G)– favor simpler analyses

(fewer, more likely constructions)

– based on derivation length + score of derivation

Size Of Grammar• Size of the grammar G is the sum of the size of each

construction:

• Size of each construction c is:

where

• nc = number of constituents in c,

• mc = number of constraints in c,

• length(e) = slot chain length of element reference e

Gc

cG )size()size(

ce

cc emnc )length()size(

Example: The Throw-Ball Cxn

construction THROW-BALLconstructional constituents

t : THROWb : BALL

formtf before bf

meaning tm.throwee ↔ bm

size(THROW-BALL) = 2 + 2 + (2 + 3) = 9

ce

cc emnc )length(++)size(

Complexity of Data Given Grammar• Complexity of the data D given grammar G is the sum of the

analysis score of each input token d:

• Analysis score of each input token d is:

where

• c is a construction used in the analysis of d

• weightc ≈ relative frequency of c,

• |typer| = number of ontology items of type r used,

• heightd = height of the derivation graph,

• semfitd = semantic fit provide by the analyzer

Dd

dGD )score()|(complexity

dddc cr

rc semfitheighttypeweightd

)score(

Final Remark

• The goal here is to build a cognitive plausible model of language learning

• A very different game that one could play is unsupervised / semi-supervised language learning using shallow or no semantics– statistical NLP– automatic extraction of syntactic structure– automatic labeling of frame elements

• Fairly reasonable results for use in tasks such as information retrieval, but the semantic representation is very shallow