Feature Structures and Parsing Unification Grammars 11-711 Algorithms for NLP 18 November 2014.

Slides:



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

Lexical Functional Grammar : Grammar Formalisms Spring Term 2004.
1 Unification Grammars Allen ’ s Chapter 4 J&M ’ s Chapter 11.
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)
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Approaches to Parsing.
LING NLP 1 Introduction to Computational Linguistics Martha Palmer April 19, 2006.
1 Features and Augmented Grammars Allen ’ s Chapter 4 J&M ’ s Chapter 11.
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
1 Auxiliary Verbs and Movement Phenomena Allen ’ s Chapter 5 J&M ’ s Chapter 11.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
COMP 4060 Natural Language Processing Using Features.
NLP and Speech 2004 Feature Structures Feature Structures and Unification.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 26, 2011.
PCFG Parsing, Evaluation, & Improvements Ling 571 Deep Processing Techniques for NLP January 24, 2011.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 31, 2011.
Parsing context-free grammars Context-free grammars specify structure, not process. There are many different ways to parse input in accordance with a given.
Syllabus Text Books Classes Reading Material Assignments Grades Links Forum Text Books עיבוד שפות טבעיות - שיעור עשר Chart Parsing (cont) Features.
Artificial Intelligence 2005/06 From Syntax to Semantics.
Artificial Intelligence 2005/06 Features, Gaps, Movement Questions and Passives.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Features and Unification
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
1 CSC 594 Topics in AI – Applied Natural Language Processing Fall 2009/ Outline of English Syntax.
CS 4705 Lecture 11 Feature Structures and Unification Parsing.
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 Parsing Part 2 Features and Unification.
SI485i : NLP Set 9 Advanced PCFGs Some slides from Chris Manning.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
Context Free Grammars Reading: Chap 12-13, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Paul Tarau, based on Rada.
Feature structures and unification Attributes and values.
1 Semantics Interpretation Allen ’ s Chapter 9 J&M ’ s Chapter 15.
1 Features and Unification Chapter 15 October 2012 Lecture #10.
CS 4705 Parsing More Efficiently and Accurately. Review Top-Down vs. Bottom-Up Parsers Left-corner table provides more efficient look- ahead Left recursion.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
Chapter 16: Features and Unification Heshaam Faili University of Tehran.
10. Parsing with Context-free Grammars -Speech and Language Processing- 발표자 : 정영임 발표일 :
Parsing I: Earley Parser CMSC Natural Language Processing May 1, 2003.
PARSING David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
11 Chapter 14 Part 1 Statistical Parsing Based on slides by Ray Mooney.
2007CLINT-LIN-FEATSTR1 Computational Linguistics for Linguists Feature Structures.
Natural Language - General
Basic Parsing Algorithms: Earley Parser and Left Corner Parsing
Section 11.3 Features structures in the Grammar ─ Jin Wang.
CS 4705 Lecture 10 The Earley Algorithm. Review Top-Down vs. Bottom-Up Parsers –Both generate too many useless trees –Combine the two to avoid over-generation:
NLP. Introduction to NLP Shallow parsing Useful for information extraction –noun phrases, verb phrases, locations, etc. Example –FASTUS (Appelt and Israel,
csa3050: Parsing Algorithms 11 CSA350: NLP Algorithms Parsing Algorithms 1 Top Down Bottom-Up Left Corner.
1 Natural Language Processing Lectures 8-9 Auxiliary Verbs Movement Phenomena Reading: James Allen NLU (Chapter 5)
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
1 Natural Language Processing Lecture 6 Features and Augmented Grammars Reading: James Allen NLU (Chapter 4)
Instructor: Nick Cercone CSEB - 1 Parsing and Context Free Grammars Parsers, Top Down, Bottom Up, Left Corner, Earley.
October 2005CSA3180: Parsing Algorithms 21 CSA3050: NLP Algorithms Parsing Algorithms 2 Problems with DFTD Parser Earley Parsing Algorithm.
Chapter 11: Parsing with Unification Grammars Heshaam Faili University of Tehran.
CS : Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Parsing Algos.
PARSING David Kauchak CS159 – Fall Admin Assignment 3 Quiz #1  High: 36  Average: 33 (92%)  Median: 33.5 (93%)
Natural Language Processing Vasile Rus
Natural Language Processing Vasile Rus
Lecture – VIII Monojit Choudhury RS, CSE, IIT Kharagpur
Lexical Functional Grammar
Dependency Parsing & Feature-based Parsing
CKY Parser 0Book 1 the 2 flight 3 through 4 Houston5 11/16/2018
CS 388: Natural Language Processing: Syntactic Parsing
Instructor: Nick Cercone CSEB -
Parsing and More Parsing
CSCI 5832 Natural Language Processing
CPSC 503 Computational Linguistics
Parsing I: CFGs & the Earley Parser
David Kauchak CS159 – Spring 2019
Presentation transcript:

Feature Structures and Parsing Unification Grammars Algorithms for NLP 18 November 2014

Linguistic features (Linguistic “features” vs. ML “features”.) Human languages usually include agreement constraints; in English, e.g., subject /verb Could have a separate category for each minor type: N1sf, N1sm, N1pf, N1pm, … – Each with its own set of grammar rules! Much better: represent these regularities using orthogonal features: number, gender, person, … Features are typically introduced by lexicon; checked and propagated by constraint equations attached to grammar rules

Feature Structures (FSs) Having multiple orthogonal features with values leads naturally to Feature Structures: [Det [root: a] [number: sg ]] A feature structure’s values can in turn be FSs: [NP [agreement: [[number: sg] [person: 3rd]]]]

Adding constraints to CFG rules S → NP VP = NP → Det Nominal =

FSs from lexicon, constrs. from rules Lexicon entry: [Det [root: a] [number: sg ]] Combine to get result: [NP [Det [root: a] [number: sg ]] [Nominal [number: sg]] [number: sg]] Rule with constraints: NP → Det Nominal =

Verb Subcategorization +none -- Jack laughed +np -- Jack found a key +np+np -- Jack gave Sue the paper +vp:inf -- Jack wants to fly +np+vp:inf -- Jack told the man to go +vp:ing -- Jack keeps hoping for the best +np+vp:ing -- Jack caught Sam looking at his desk +np+vp:base -- Jack watched Sam look at his desk +np+pp:to -- Jack gave the key to the man +pp:loc -- Jack is at the store +np+pp:loc -- Jack put the box in the corner +pp:mot -- Jack went to the store +np+pp:mot -- Jack took the hat to the party +adjp -- Jack is happy +np+adjp -- Jack kept the dinner hot +sthat -- Jack believed that the world was flat +sfor -- Jack hoped for the man to win a prize Verbs have sets of allowed args. Could have many sets of VP rules. Instead, have a SUBCAT feature, marking sets of allowed arguments: possible frames for English; a single verb can have several. (Notation from James Allen book.)

Adding transitivity constraints S → NP VP = NP → Det Nominal = VP → Verb NP = = transitive

Applying a verb subcat feature Lexicon entry: [Verb [root: found] [head: found] [subcat: +np ]] Combine to get result: [VP [Verb [root: found] [head: found] [subcat: +np ]] [NP] [head: [found subcat: +np]]] Rule with constraints: VP → Verb NP = = +np

Relation to LFG constraint notation VP → Verb NP = = transitive from the book is the same as the LFG expression VP → Verb NP (↑ head) = (↓ head) (↑ head subcat) = transitive

Unification

Recap: applying constraints Lexicon entry: [Det [root: a] [number: sg ]] Combine to get result: [NP [Det [root: a] [number: sg ]] [Nominal [number: sg]] [number: sg]] Rule with constraints: NP → Det Nominal =

Turning constraint eqns. into FS Lexicon entry: [Det [root: a] [number: sg ]] Combine to get result: [NP [Det [root: a] [number: sg ]] [Nominal [number: sg]] [number: sg]] Rule with constraints: NP → Det Nominal = becomes [NP [Det [number: (1) ]] [Nominal [number: (1) ]]

Another example This (oversimplified) rule: S → NP VP = NP = turns into this DAG: [S [agreement (1) ] [subject [agreement (1) ]] [subject (2) ] [NP (2) ] [VP ]

Unification example with “=“

Unification example without “=“

Why bother? Unification allows the systems that use it to handle complex phenomena in “simple” elegant ways: – There seems to be a person … – There seem to be people... Unification makes this work smoothly. – (Ask Lori Levin for details.)

Representing FSs as DAGs Taking feature paths seriously May be easier to think about than numbered cross-references in text [cat NP, agreement [number sg, person 3rd]]

Re-entrant FS DAGs [cat S, head [agreement (1) [number sg, person 3rd], subject [agreement (1)]]] HEAD

Splitting nodes into content and pointer [number sg, person 3rd]

[number sg, person 3rd] (corrected)

[number sg, person 3rd] (unlikely…)

Unification algorithm

[agr (1) [number sg, person 3rd], subj [agr (1)]]

Adding Unification to Earley Parser Could just parse, then unify FSs at the end – But this fails to use constraints to limit bad parses. 1: Add feature structures to rules. This rule: S → NP VP = turns into this DAG: [S [head (1)] NP [head [agr (2)]] VP [head (1) [agr (2)]]]

Adding Unification to Earley Parser 2: Include a DAG in each state in chart 3: Completer unifies the two input DAGs when producing a new state 4: AddToChart tests whether new state is subsumed by any chart state 5: Unify-States makes copies of both of its DAG args

Earley+Unification: DAGs added

Earley+Unification: the rest

Real Unification-Based Parsing X0 → X1 X2 = S, = NP, = VP = X0 → X1 and X2 =, = X0 → X1 X2 = how, =

Complexity Earley modification: “search the chart for states whose DAGs unify with the DAG of the completed state”. Plus a lot of copying. Unification parsing is “quite expensive”. – NP-Complete in some versions. – Early AWB paper on Turing Equivalence(!) So maybe too powerful? (like GoTo or Call-by-Name?) – Add restrictions to make it tractable: Tomita’s Pseudo-unification Gerald Penn work on tractable HPSG: ALE

Formalities

Hierarchical Types Hierarchical types allow values to unify too (or not):

Hierarchical subcat frames Many verbs share subcat frames, some with more arguments specified than others:

Questions?

Subcategorization

Frames for “ask”