160 likes | 242 Views
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.
E N D
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. • RHS_1 RHS_2 . . .RHS_N is a list of categories, i.e. either nonterminal or terminal symbols.
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.
Feature Structures • Feature structures are commonly written as attribute-value matrices , e.g. [ lex: telescope cat: N ]
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.
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 ]]]
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>
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.
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 ] ] Simple Unification Examples
Checkpoint Satisfy yourself that, using the previous examples: • unify(1,2) = 4 • unify(2,3) = 5 • unify(1,3) = fail
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
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.
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
Lexical Entry Examples \w fox \c N \g canine \f <number> = singular \w foxes \c N \g canine+PL \f <number> = plural
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 ]
Grammar (grammar.grm) Rule s -> np vp Rule np -> n Rule vp -> v Lexicon (lexicon.lex) \w uther \c n \w sleeps \c v Example Grammar and Lexicon