csa2050

16
CSA2050 The PATR Formalism Rule Syntax Lexicon Syntax

Upload: kenneth-mooney

Post on 02-Jan-2016

12 views

Category:

Documents


0 download

DESCRIPTION

CSA2050. The PATR Formalism Rule Syntax Lexicon Syntax. PATR Rule Syntax. Rule LHS -> RHS_1 RHS_2 . . .RHS_N LHS (the symbol to the left of the arrow) is a nonterminal symbol for the type of phrase that is being described. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CSA2050

CSA2050

The PATR Formalism

Rule Syntax

Lexicon Syntax

Page 2: CSA2050

PATR Rule Syntax

Rule

LHS -> RHS_1 RHS_2 . . .RHS_N

• LHS (the symbol to the left of the arrow) is a nonterminal symbol for the type of phrase that is being described.

• RHS_1 RHS_2 . . .RHS_N is a list of categories, i.e. either nonterminal or terminal symbols.

Page 3: CSA2050

PATR Rule Syntax

• Optional constituents (or sets of constituents) are enclosed in parentheses Rule S -> NP VP (SubCl)

• Alternative constituents (or sets of constituents) on the right hand side are separated by slashesRule Det -> DT / PR

• Braces are used to group alternative sets of elements together, so that alternations are not ambiguousRule AdvP -> {AV / PrepP} (AdvP_1)

• Symbols should not be repeated verbatim within a rule. Underscore N (e.g. NP_3) used instead.

Page 4: CSA2050

Feature Structures

• Feature structures are commonly written as attribute-value matrices , e.g.

[ lex: telescope

cat: N ]

Page 5: CSA2050

Complex-Valued FS

• Feature structures can have either simple values, or complex values, such as this

[cat: np

head: [agr: [ num: sg

gen: masc]

deftype: indef]]• Feature structures can be arbitrarily nested

in this manner.

Page 6: CSA2050

Building Up Structure

• Agreement Features[ num sing person 3 ]

• Noun Phrase[ cat np agr [ num sing person 3 ]]

• Sentence[cat s subj [ cat np agr [ num sing person 3 ]]]

Page 7: CSA2050

Paths

• Portions of a feature structure can be referred to using the path notation.

• A path is a sequence of one or more feature names enclosed in angled brackets ( <> ).

• Checkpoint: identify all the paths in the

• previous FS, e.g. <head deftype>

Page 8: CSA2050

Unification

• Unification is the basic operation applied to feature structures in PC-PATR

• It consists of the merging of the information from two feature structures.

• Two feature structures can unify if their common features have the same values, but do not unify if any feature values conflict.

Page 9: CSA2050

Simple Unification Examples

1. [ agreement: [ number: singular person: first ] ]2. [ agreement: [ number: singular case:

nominative ] ]3. [ agreement: [ number: singular person: third ] ]

4.[ agreement: [ number: singular person: first ] case: nominative ] ]5. [ agreement: [ number: singular person: third ] case: nominative ] ]

Page 10: CSA2050

Checkpoint

Satisfy yourself that, using the previous

examples:

• unify(1,2) = 4

• unify(2,3) = 5

• unify(1,3) = fail

Page 11: CSA2050

Constraint Equations

• The feature constraints associated with phrase structure rules in PC-PATR consist of a set ofunification expressions.

• Each expression has three parts, in this order:• a feature path, the first element of which is one

of the symbols from the phrase structure rule• an equal sign (=)• either a simple value, or another feature path

that also starts with a symbol from the phrase structure

Page 12: CSA2050

Execution of Equations

• Each equation is interpreted as an instruction to unify the left and right hand sides

• First, each side is "evaluated" before any unification is attempted. If the path does not exist it is created.

• After successful unification, the two structures are not merely equivalent, but identical, so that any changes to one affect changes to the other.

Page 13: CSA2050

Lexical Entries

• Lexical entries define the basic properties of words.

• Each definition divided into fields, each of which begins with a standard format marker at the beginning of a line. – \w the lexical form of the word, – \c word category (part of speech) – \g word gloss – \f additional features of this word

Page 14: CSA2050

Lexical Entry Examples

\w fox \c N \g canine \f <number> = singular

\w foxes \c N \g canine+PL \f <number> = plural

Page 15: CSA2050

Corresponding Feature Structures

• When these entries are used by the grammar, they are represented by these feature structures: [ cat: N gloss: canine lex: foxes number: singular ]

[ cat: N gloss: canine+PL

lex: foxes number: plural ]

Page 16: CSA2050

Example Grammar and Lexicon

Grammar (grammar.grm)

Rule

s -> np vp

Rule

np -> n

Rule

vp -> v

Lexicon (lexicon.lex)

\w uther

\c n

\w sleeps

\c v