21
CS 182 Sections 103 - 104 Eva Mok ([email protected]) April 21, 2004

CS 182 Sections 103 - 104

Embed Size (px)

DESCRIPTION

CS 182 Sections 103 - 104. Eva Mok ([email protected]) April 21, 2004. Announcements. a9 out sometime Thursday, due Wednesday April 22nd, 11:59pm How’s your progress on the BBS articles?. Schedule. Last Week SHRUTI Formal Grammar and Parsing This Week Construction Grammar, ECG - PowerPoint PPT Presentation

Citation preview

Page 1: CS 182 Sections 103 - 104

CS 182Sections 103 - 104

Eva Mok ([email protected])

April 21, 2004

Page 2: CS 182 Sections 103 - 104

Announcements

• a9 out sometime Thursday, due Wednesday April 22nd, 11:59pm

• How’s your progress on the BBS articles?

Page 3: CS 182 Sections 103 - 104

Schedule

• Last Week

– SHRUTI

– Formal Grammar and Parsing

• This Week

– Construction Grammar, ECG

– Psychological model of sentence processing

• Next Week

– Language learning

– Learning ECG

Page 4: CS 182 Sections 103 - 104

Quiz

1. What is top-down parsing? Using a plausible CFG grammar, what is the top down parse of “Pat ate the kiwi”?

2. How well can CFGs represent English? What are some mechanisms for improvement?

3. What are constructions?

4. What is the difference between subcasing and evoking another schema or construction?

Page 5: CS 182 Sections 103 - 104

Quiz

1. What is top-down parsing? Using a plausible CFG grammar, what is the top down parse of “Harry likes the cafe”?

2. How well can CFGs represent English? What are some mechanisms for improvement?

3. What are constructions?

4. What is the difference between subcasing and evoking another schema or construction?

Page 6: CS 182 Sections 103 - 104

Grammar

• A grammar is a set of rules defining a formal language

• an example is right-regular grammar

• a more common example is Context-Free Grammar

β : single non-terminal

• β : any combination of terminals and non-terminals

S NP VPNP Det Noun | ProperNounVP Verb NP | Verb PPPP Preposition NP

Noun kiwi | orange | storeProperNoun Pat | IDet a | an | theVerb ate | went | shopPreposition to | at

Page 7: CS 182 Sections 103 - 104

Top Down Parsing: Pat ate the kiwi

• start from S and apply all applicable rules

• forward search (use your favorite search algorithm…)

S NP VPNP Det Noun | ProperNounVP Verb NP | Verb PPPP Preposition NPNoun kiwi | orange | storeProperNoun Pat | IDet a | an | theVerb ate | went | shopPreposition to | at

S

NP VP

Det Noun VP ProperNoun VP

a Noun VP an Noun VP the Noun VP

a kiwi VP a orange VP a store VP …succeed when you encounter

Pat ate the kiwi in a state without any non-terminals

(DFS)

Page 8: CS 182 Sections 103 - 104

Bottom Up Parsing: Pat ate the kiwi

• start from the sentence and try to match non-teriminals to it

• backward search (use your favorite search algorithm…)

S NP VPNP Det Noun | ProperNounVP Verb NP | Verb PPPP Preposition NPNoun kiwi | orange | storeProperNoun Pat | IDet a | an | theVerb ate | went | shopPreposition to | at

succeed when you encounter S in a state by itself

Pat ate the kiwi

ProperNoun ate the kiwi

NP Verb the kiwi

NP Verb Det kiwi

NP Verb Det Noun

NP Verb NP

NP VP

NP ate the kiwi

(DFS)

S

Page 9: CS 182 Sections 103 - 104

Quiz

1. What is top-down parsing? Using a plausible CFG grammar, what is the top down parse of “Harry likes the cafe”?

2. How well can CFGs represent English? What are some mechanisms for improvement?

3. What are constructions?

4. What is the difference between subcasing and evoking another schema or construction?

Page 10: CS 182 Sections 103 - 104

Notice the ungrammatical and/or odd sentences that we can generate?

• * Pat ate a orange

• * Pat shop at the store

• * Pat went a store

• ? Pat ate a store

• ? The kiwi went to an orange

S NP VPNP Det Noun | ProperNounVP Verb NP | Verb PPPP Preposition NP

Noun kiwi | orange | storeProperNoun Pat | IDet a | an | theVerb ate | went | shopPreposition to | at

need to capture agreement, subcategorization, etc

you could make many versions of verbs, nouns, dets

cumbersome

Page 11: CS 182 Sections 103 - 104

Unification Grammar• Basic idea: capture these agreement features for each non-

terminal in feature structures

• Enforce constraints on these features using unification rules

Patnumber : SGperson : 3rd agreement

Inumber : SGperson : 1stagreement

Went

agreementShop

agreementnumber : person : 1st

VP Verb NP VP.agreement ↔ Verb.agreement

S NP VPNP.agreement ↔ VP.agreement

Page 12: CS 182 Sections 103 - 104

Quiz

1. What is top-down parsing? Using a plausible CFG grammar, what is the top down parse of “Harry likes the cafe”?

2. How well can CFGs represent English? What are some mechanisms for improvement?

3. What are constructions?

4. What is the difference between subcasing and evoking another schema or construction?

Page 13: CS 182 Sections 103 - 104

Embodied constructions

construction HARRYform : /hEriy/meaning : Harry

construction CAFEform : /khaefej/meaning : Cafe

Harry

CAFEcafe

ECG NotationForm Meaning

Constructions have form and meaning poles that are subject to type constraints.

Page 14: CS 182 Sections 103 - 104

Quiz

1. What is top-down parsing? Using a plausible CFG grammar, what is the top down parse of “Harry likes the cafe”?

2. How well can CFGs represent English? What are some mechanisms for improvement?

3. What are constructions?

4. What is the difference between subcasing and evoking another schema or construction?

Page 15: CS 182 Sections 103 - 104

A schema hierarchy of objects (Nomi)

schema Referentsubcase of Entityroles

categorydistributionboundednessnumbergenderaccessibilityresolved-ref

schema Referentsubcase of Entityroles

categorydistributionboundednessnumbergenderaccessibilityresolved-ref

schema Object subcase of Entity

schema Object subcase of Entity

schema Entityschema Entity

schema Placeschema Place

schema Physical-Objectsubcase of Object, Place

schema Physical-Objectsubcase of Object, Place

schema Animate subcase of Physical-

Objectroles

animacyconstraints

animacy ← true

schema Animate subcase of Physical-

Objectroles

animacyconstraints

animacy ← true

schema Humansubcase of

Animateroles

sex

schema Humansubcase of

Animateroles

sexschema Nomi

subcase of Humansex ← female

schema Nomisubcase of Human

sex ← female

schema Manipulable-Object

subcase of Physical-Object

schema Manipulable-Object

subcase of Physical-Object

schema Toysubcase of

Manipulable-Object

schema Toysubcase of

Manipulable-Object

schema Ball subcase of Toy

schema Ball subcase of Toy

slot filler

schema Cup subcase of Manipulable-Object

schema Cup subcase of Manipulable-Object

Page 16: CS 182 Sections 103 - 104

The schemas we just defined

Entity Place

Object

Physical-Object

Referent

AnimateManipulable-Object

HumanToy

Nomi Mother FatherBook

Cup

Ball Block

Food

Doll Bed

Cake Juice

Page 17: CS 182 Sections 103 - 104

A schema hierarchy of actions (Nomi)

schema DirectedActionsubcase of Actionroles

patient : Entity

schema DirectedActionsubcase of Actionroles

patient : Entity

schema Actionroles

agent : Entity

schema Actionroles

agent : Entity

schema Move subcase of Actionroles

mover : Entitydirection : Place

schema Move subcase of Actionroles

mover : Entitydirection : Place

schema CauseMove subcase of DirectedAction,

Moveroles

causer : Humanmover : Physical-Objectmotion : Move

constraints motion.mover ↔ movermotion.agent ↔ causermotion.direction ↔ directionagent ↔ causerpatient ↔ mover

schema CauseMove subcase of DirectedAction,

Moveroles

causer : Humanmover : Physical-Objectmotion : Move

constraints motion.mover ↔ movermotion.agent ↔ causermotion.direction ↔ directionagent ↔ causerpatient ↔ mover

identification constraint

type constraint

Page 18: CS 182 Sections 103 - 104

The schemas we just defined

Action

Directed Action

Cause-Move

Move

JointMoveTransfer

Page 19: CS 182 Sections 103 - 104

Constructions, finally (Nomi)construction Ref-Expr

form : Schematic-Formmeaning : Referent

construction Ref-Exprform : Schematic-Formmeaning : Referent

construction Nomi-Cnlevel 0subcase of Ref-Exprform : Word

self.f.orth ← "Nomi"meaning

evokes Nomi as nself.m.category ↔ nself.m.resolved-ref ↔ n

construction Nomi-Cnlevel 0subcase of Ref-Exprform : Word

self.f.orth ← "Nomi"meaning

evokes Nomi as nself.m.category ↔ nself.m.resolved-ref ↔ n

local name

fancy way of sayingthat the category ofthe referent is Nomi

construction Cup-Cnlevel 0subcase of Ref-Exprform : Word

self.f.orth ← “cup"meaning

evokes Cup as nself.m.category ↔ nself.m.resolved-ref ↔ n

construction Cup-Cnlevel 0subcase of Ref-Exprform : Word

self.f.orth ← “cup"meaning

evokes Cup as nself.m.category ↔ nself.m.resolved-ref ↔ n

Page 20: CS 182 Sections 103 - 104

Constructions, finally (Nomi)

construction Cause-Motion-Verb

subcase of Motion-Verbmeaning : CauseMove

construction Cause-Motion-Verb

subcase of Motion-Verbmeaning : CauseMove

construction Motion-Verbmeaning : Move

construction Motion-Verbmeaning : Move

construction Get-Cnlevel 0subcase of Cause-Motion-

Verbform : Word

self.f.orth ← "get"

construction Get-Cnlevel 0subcase of Cause-Motion-

Verbform : Word

self.f.orth ← "get"lexical construction

Page 21: CS 182 Sections 103 - 104

Constructions, finally (Nomi)

construction Transitive-Cnlevel 2constructional

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

formagt.f before v.fv.f before obj.f

meaningv.m.agent ↔ agt.m.resolved-

refv.m.patient ↔ obj.m.resolved-

ref

construction Transitive-Cnlevel 2constructional

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

formagt.f before v.fv.f before obj.f

meaningv.m.agent ↔ agt.m.resolved-

refv.m.patient ↔ obj.m.resolved-

ref

smaller constructions that it takes

ordering constraints on the constituents