Context-Free Parsing Part 2 Features and Unification.

Slides:



Advertisements
Similar presentations
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Advertisements

Feature Structures and Parsing Unification Grammars Algorithms for NLP 18 November 2014.
Lexical Functional Grammar : Grammar Formalisms Spring Term 2004.
BİL711 Natural Language Processing1 Problems with CFGs We know that CFGs cannot handle certain things which are available in natural languages. In particular,
1 Natural Language Processing Lecture 7 Unification Grammars Reading: James Allen NLU (Chapter 4)
Grammar Development Platform Miriam Butt October 2002.
Grammar Engineering: Set-valued Attributes Various Kinds of Constraints Case Restrictions on Arguments Miriam Butt (University of Konstanz) and Martin.
Grammatical Relations and Lexical Functional Grammar Grammar Formalisms Spring Term 2004.
1 Features and Augmented Grammars Allen ’ s Chapter 4 J&M ’ s Chapter 11.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
1 Pertemuan 23 Syntatic Processing Matakuliah: T0264/Intelijensia Semu Tahun: 2005 Versi: 1/0.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2007 Lecture 16 5 September 2007.
NLP and Speech 2004 Feature Structures Feature Structures and Unification.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 26, 2011.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 31, 2011.
1 Pertemuan 22 Natural Language Processing Syntactic Processing Matakuliah: T0264/Intelijensia Semu Tahun: Juli 2006 Versi: 2/2.
Context-Free Parsing. 2/37 Basic issues Top-down vs. bottom-up Handling ambiguity –Lexical ambiguity –Structural ambiguity Breadth first vs. depth first.
Center for PersonKommunikation P.1 UNIFICATION GRAMMAR  Forerunner: “Attribute Grammars” introduced by Donald E. Knuth: “Semantics of context-free Languages”.
Syllabus Text Books Classes Reading Material Assignments Grades Links Forum Text Books עיבוד שפות טבעיות - שיעור עשר Chart Parsing (cont) Features.
Amirkabir University of Technology Computer Engineering Faculty AILAB Efficient Parsing Ahmad Abdollahzadeh Barfouroush Aban 1381 Natural Language Processing.
Analyzing Features of Grammatical Categories Show my head to the people; it is worth seeing. --Feature structure, to Ivan Sag in a dream.
Sag et al., Chapter 4 Complex Feature Values 10/7/04 Michael Mulyar.
Artificial Intelligence 2005/06 From Syntax to Semantics.
Issues in Computational Linguistics: Parsing and Generation Dick Crouch and Tracy King.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Features and Unification
 2003 CSLI Publications Ling 566 Oct 16, 2007 How the Grammar Works.
Unification-based algorithms We have seen that treating features, such as person-number agreement, as part of the category of a phrase results in a large.
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language Syntax Parsing.
CS 4705 Lecture 11 Feature Structures and Unification Parsing.
Stochastic POS tagging Stochastic taggers choose tags that result in the highest probability: P(word | tag) * P(tag | previous n tags) Stochastic taggers.
Features and Unification Read J & M Chapter 11.. Solving the Agreement Problem Number agreement: S  NP VP * Mary walk. [NP NUMBER] [VP NUMBER] NP  det.
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Feature structures and unification Attributes and values.
1 Features and Unification Chapter 15 October 2012 Lecture #10.
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
LING 388: Language and Computers Sandiway Fong Lecture 17.
Semantic Analysis Legality checks –Check that program obey all rules of the language that are not described by a context-free grammar Disambiguation –Name.
BİL711 Natural Language Processing1 Statistical Parse Disambiguation Problem: –How do we disambiguate among a set of parses of a given sentence? –We want.
CS 4705 Parsing More Efficiently and Accurately. Review Top-Down vs. Bottom-Up Parsers Left-corner table provides more efficient look- ahead Left recursion.
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2007 Lecture 16 5 September 2007.
Chapter 16: Features and Unification Heshaam Faili University of Tehran.
CSE Introduction to Computational Linguistics Tuesdays, Thursdays 14:30-16:00 – South Ross 101 Fall Semester, 2011 Instructor: Nick Cercone
Grammar Engineering: What is it good for? Miriam Butt (University of Konstanz) and Martin Forst (NetBase Solutions) Colombo 2014.
7. Parsing in functional unification grammar Han gi-deuc.
Rule Learning - Overview Goal: Syntactic Transfer Rules 1) Flat Seed Generation: produce rules from word- aligned sentence pairs, abstracted only to POS.
2007CLINT-LIN-FEATSTR1 Computational Linguistics for Linguists Feature Structures.
Head-driven Phrase Structure Grammar (HPSG)
Natural Language - General
Section 11.3 Features structures in the Grammar ─ Jin Wang.
CS412/413 Introduction to Compilers and Translators Spring ’99 Lecture 3: Introduction to Syntactic Analysis.
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
1 Natural Language Processing Lecture 6 Features and Augmented Grammars Reading: James Allen NLU (Chapter 4)
NLP. Introduction to NLP (U)nderstanding and (G)eneration Language Computer (U) Language (G)
 2003 CSLI Publications Ling 566 Oct 17, 2011 How the Grammar Works.
Lexical-Functional Grammar A Formal System for Grammatical Representation Kaplan and Bresnan, 1982 Erin Fitzgerald NLP Reading Group October 18, 2006.
Chapter 11: Parsing with Unification Grammars Heshaam Faili University of Tehran.
Roadmap Probabilistic CFGs –Handling ambiguity – more likely analyses –Adding probabilities Grammar Parsing: probabilistic CYK Learning probabilities:
Natural Language Processing Vasile Rus
Lexical Functional Grammar
Dependency Parsing & Feature-based Parsing
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
CSC 594 Topics in AI – Applied Natural Language Processing
Instructor: Nick Cercone CSEB -
Introduction to Computational Linguistics
CPSC 503 Computational Linguistics
Ling 566 Oct 14, 2008 How the Grammar Works.
Presentation transcript:

Context-Free Parsing Part 2 Features and Unification

2/21 Parsing with features We need to constrain the rules in CFGs, for example –to coerce agreement within and between constituents –to pass features around –to enforce subcategorisation constraints Features can be easily added to our grammars And later we’ll see that feature bundles can completely replace constituents

3/21 Parsing with features Rules can stipulate values, or placeholders (variables) for values Features can be used within the rule, or passed up via the mother nodes Example: subject-verb agreement S  NP VP [if NP and VP agree in number] number of NP depends on noun and/or determiner number of VP depends on verb S  NP(num=X) VP (num=X) NP (num=X)  det(num=X) n (num=X) VP(num=X)  v(num=X) NP(num=?)

4/21 Declarative nature of features The rules can be used in various ways –To build an NP only if det and n agree (bottom-up) –When generating an NP, to choose an n which agrees with the det (if working L-to-R) (top-down) –To show that the num value for an NP comes from its components (percolation) –To ensure that the num value is correctly set when generating an NP (inheritance) –To block ill-formed input NP (num=X)  det(num=X) n (num=X) this det (num=sg) these det (num=pl) the det (num=?) man n (num=sg) men n (num=pl) det(num=sg) n(num=sg) thisman NP (num=sg) n(num=pl) men

5/21 Use of variables Unbound (unassigned) variables (ie variables with a free value): –the can combine with any value for num –Unification means that the num value for the is set to sg NP (num=X)  det(num=X) n (num=X) this det (num=sg) these det (num=pl) the det (num=?) man n (num=sg) men n (num=pl) det(num=?) n(num=sg) theman NP (num=sg)

6/21 Parsing with features Features must be compatible Formalism should allow features to remain unspecified Feature mismatch can be used to block false analyses, and disambiguate –e.g. they can fish ~ he can fish ~ he cans fish Formalism may have attribute-value pairs, or rely on argument position e.g. NP(_num,_sem)  det(_num) n (_num,_sem) an = det(sing) the = det(_num) man = n(sing,hum)

7/21 Parsing with features Using features to impose subcategorization constraints VP  ve.g. dance VP  v NPe.g. eat VP  v NP NPe.g. give VP  v PPe.g. wait (for) VP(_num)  v(_num,intr) VP(_num)  v(_num,trans) NP VP(_num)  v(_num,ditrans) NP NP VP(_num)  v(_num,prepobj(_case)) PP(_case) PP(_case)  prep(_case)NP dance = v(plur,intr) dances = v(sing,intr) danced = v(_num,intr) waits = v(sing,prepobj(for)) for = prep(for)

8/21 v (sing,intrans) S  NP(_num) VP(_num) NP(_num)  det(_num) n(_num) VP(_num)  v(_num,intrans) VP(_num)  v (_num,trans) NP(_1) Parsing with features (top-down) S  NP(_num) VP(_num) S NP VP (_num) NP(_num)  det(_num) n(_num) the man shot those elephants det n (_num) the = det(_num) the man = n(sing) man VP(sing)  v(sing,intrans) shot = v(sing,trans) (sing) VP(sing)  v(sing,trans) NP(_1) shot = v(sing,trans) v NP (sing,trans) (_1) shot det n (_1) (_1) thoseelephants (pl) NP(_1)  det(_1) n(_1) those = det(pl) elephants = n(pl) _num=sing (pl)

9/21 S  NP(_num) VP(_num) NP(_num)  det(_num) n(_num) VP(_num)  v(_num,intrans) VP(_num)  v (_num,trans) NP(_1) Parsing with features (bottom-up) S  NP(_num) VP(_num) NP(_num)  det(_num) n(_num) the man shot those elephants NP (sing) the = det(_num) det (_num) the man = n(sing) shot = v(sing,trans) (sing) S VP(_num)  v (_num,trans) NP(_1) VP (sing,trans) those = det(pl) elephants = n(pl) n (sing) man v (sing,trans) shot det (pl) those n (pl) elephants NP (pl)

10/21 Feature structures Instead of attaching features to the symbols, we can parse with symbols made up entirely of attribute-value pairs: “feature structures” Can be used in the same way as seen previously Values can be atomic … … or embedded feature structures … CAT NP NUMBER SG PERSON 3 ATTR1 VAL1 ATTR2 VAL2 ATTR3 VAL3 CAT NP AGR NUM SG PERS 3

11/21 Feature structures … or they can be coindexed CAT S HEAD AGR 1 SUBJ [ AGR 1 ] NUM SG PERS 3

12/21 Parsing with feature structures Grammar rules can specify assignments to or equations between feature structures Expressed as “feature paths” e.g. HEAD.AGR.NUM = SG CAT S HEAD AGR 1 SUBJ [ AGR 1 ] NUM SG PERS 3

13/21 Feature unification Feature structures can be unified if –They have like-named attributes that have the same value: [NUM SG]  [NUM SG] = [NUM SG] –Like-named attributes that are “open” get the value assigned: CAT NP NUMBER ?? PERSON 3 NUMBER SG PERSON 3  = CAT NP NUMBER SG PERSON 3

14/21 Feature unification –Complementary features are brought together –Unification is recursive –Coindexed structures are identical (not just copies): assignment to one effects all CAT NP NUMBER SG [PERSON 3]  = CAT NP NUMBER SG PERSON 3 CAT NP AGR [NUM SG]  CAT NP AGR NUM SG PERS 3 = CAT NP AGR [PERS 3]

15/21 Example CAT NP AGR _1  _2 SEM _3  CAT DET AGR _1 CAT N AGR _2 SEM _3  CAT DET AGR VAL INDEF NUM SG a  CAT DET AGR [VAL DEF] the  CATN LEX “man” AGR [NUM SG] SEM HUM man

16/21 the man the  CAT N AGR _2 SEM _3  CAT DET AGR [VAL DEF] the CAT NP AGR _1  _2 SEM [_3] CAT DET AGR _1 [VAL DEF] VAL DEF  CATN LEX “man” AGR [NUM SG] SEM HUM man LEX “man” AGR [NUM SG] SEM HUM the man NUM SG HUM

17/21 a mana  CAT N AGR _2 SEM _3 CAT NP AGR _1  _2 SEM [_3] CAT DET AGR _1  CATN LEX “man” AGR [NUM SG] SEM HUM man LEX “man” AGR [NUM SG] SEM HUM a man [NUM SG] HUM  CAT DET AGR VAL INDEF NUM SG a VAL INDEF NUM SG VAL INDEF NUM SG VAL INDEF AGR NUM SG

18/21 Types and inheritance Feature typing allows us to constrain possible values a feature can have –e.g. num = {sing,plur} –Allows grammars to be checked for consistency, and can make parsing easier We can express general “feature co-occurrence conditions” … And “feature inheritance rules” Both these allow us to make the grammar more compact

19/21 Co-occurrence conditions and Inheritance rules General rules (beyond simple unification) which apply automatically, and so do not need to be stated (and repeated) in each rule or lexical entry Examples: [cat=np]  [num=??, gen=??, case=??] [cat=v,num=sg]  [tns=pres] [attr1=val1]   [attr2=val2]

20/21 Inheritance rules Inheritance rules can be over-ridden e.g. [cat=n]  [gen=??,sem=??] sex={male,female} gen={masc,fem,neut} [cat=n,gen=fem,sem=hum]  [sex=female] uxor [cat=n,gen=fem,sem=hum] agricola [cat=n,gen=fem,sem=hum,sex=male]

21/21 Unification in Linguistics Lexical Functional Grammar –If interested, see PARGRAM project GPSG, HPSG Construction Grammar Categorial Grammar