600.465 - Intro to NLP - J. Eisner1 Earley’s Algorithm (1970) Nice combo of our parsing ideas so far:  no restrictions on the form of the grammar:  A.

Slides:



Advertisements
Similar presentations
PARSING WITH CONTEXT-FREE GRAMMARS
Advertisements

Parsing with Context Free Grammars Reading: Chap 13, Jurafsky & Martin
Probabilistic Earley Parsing Charlie Kehoe, Spring 2004 Based on the 1995 paper by Andreas Stolcke: An Efficient Probabilistic Context-Free Parsing Algorithm.
CKY Parsing Ling 571 Deep Processing Techniques for NLP January 12, 2011.
1 Earley Algorithm Chapter 13.4 October 2009 Lecture #9.
Parsing context-free grammars Context-free grammars specify structure, not process. There are many different ways to parse input in accordance with a given.
Parsing with CFG Ling 571 Fei Xia Week 2: 10/4-10/6/05.
Context-Free Parsing. 2/37 Basic issues Top-down vs. bottom-up Handling ambiguity –Lexical ambiguity –Structural ambiguity Breadth first vs. depth first.
6/12/2015Prof. Hilfinger CS164 Lecture 111 Bottom-Up Parsing Lecture (From slides by G. Necula & R. Bodik)
Top-Down Parsing.
Amirkabir University of Technology Computer Engineering Faculty AILAB Efficient Parsing Ahmad Abdollahzadeh Barfouroush Aban 1381 Natural Language Processing.
Earley’s algorithm Earley’s algorithm employs the dynamic programming technique to address the weaknesses of general top-down parsing. Dynamic programming.
Basic Parsing with Context- Free Grammars 1 Some slides adapted from Julia Hirschberg and Dan Jurafsky.
Syntactic Parsing with CFGs CMSC 723: Computational Linguistics I ― Session #7 Jimmy Lin The iSchool University of Maryland Wednesday, October 14, 2009.
Professor Yihjia Tsai Tamkang University
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language Syntax Parsing.
Parsing SLP Chapter 13. 7/2/2015 Speech and Language Processing - Jurafsky and Martin 2 Outline  Parsing with CFGs  Bottom-up, top-down  CKY parsing.
Basic Parsing with Context- Free Grammars 1 Some slides adapted from Julia Hirschberg and Dan Jurafsky.
CPSC 388 – Compiler Design and Construction
11/22/1999 JHU CS /Jan Hajic 1 Introduction to Natural Language Processing ( ) Shift-Reduce Parsing in Detail Dr. Jan Hajič CS Dept., Johns.
CS 4705 Parsing More Efficiently and Accurately. Review Top-Down vs. Bottom-Up Parsers Left-corner table provides more efficient look- ahead Left recursion.
中文信息处理 Chinese NLP Lecture 9.
Top-Down Parsing - recursive descent - predictive parsing
1 CKY and Earley Algorithms Chapter 13 October 2012 Lecture #8.
LINGUISTICA GENERALE E COMPUTAZIONALE ANALISI SINTATTICA (PARSING)
10. Parsing with Context-free Grammars -Speech and Language Processing- 발표자 : 정영임 발표일 :
Profs. Necula CS 164 Lecture Top-Down Parsing ICOM 4036 Lecture 5.
Parsing with Context Free Grammars CSC 9010 Natural Language Processing Paula Matuszek and Mary-Angela Papalaskari This slide set was adapted from: Jim.
Parsing I: Earley Parser CMSC Natural Language Processing May 1, 2003.
PARSING David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2007 Lecture August 2007.
Top Down Parsing - Part I Comp 412 Copyright 2010, Keith D. Cooper & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
Parsing Based on presentations from Chris Manning’s course on Statistical Parsing (Stanford)
1 Chart Parsing Allen ’ s Chapter 3 J & M ’ s Chapter 10.
NLP. Introduction to NLP Background –Developed by Jay Earley in 1970 –No need to convert the grammar to CNF –Left to right Complexity –Faster than O(n.
Chart Parsing and Augmenting Grammars CSE-391: Artificial Intelligence University of Pennsylvania Matt Huenerfauth March 2005.
Sentence Parsing Parsing 3 Dynamic Programming. Jan 2009 Speech and Language Processing - Jurafsky and Martin 2 Acknowledgement  Lecture based on  Jurafsky.
Natural Language - General
Basic Parsing Algorithms: Earley Parser and Left Corner Parsing
Quick Speech Synthesis CMSC Natural Language Processing April 29, 2003.
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:
csa3050: Parsing Algorithms 11 CSA350: NLP Algorithms Parsing Algorithms 1 Top Down Bottom-Up Left Corner.
Parsing — Part II (Top-down parsing, left-recursion removal) Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students.
Top-down Parsing lecture slides from C OMP 412 Rice University Houston, Texas, Fall 2001.
Intro to NLP - J. Eisner1 Parsing Tricks.
Top-Down Parsing CS 671 January 29, CS 671 – Spring Where Are We? Source code: if (b==0) a = “Hi”; Token Stream: if (b == 0) a = “Hi”; Abstract.
Natural Language Processing Lecture 15—10/15/2015 Jim Martin.
Top-down Parsing. 2 Parsing Techniques Top-down parsers (LL(1), recursive descent) Start at the root of the parse tree and grow toward leaves Pick a production.
Top-Down Parsing.
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.
NLP. Introduction to NLP Time flies like an arrow –Many parses –Some (clearly) more likely than others –Need for a probabilistic ranking method.
CS 330 Programming Languages 09 / 25 / 2007 Instructor: Michael Eckmann.
COMP 3438 – Part II-Lecture 5 Syntax Analysis II Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Top-down parsing 1. Last Time CYK – Step 1: get a grammar in Chomsky Normal Form – Step 2: Build all possible parse trees bottom-up Start with runs of.
PARSING David Kauchak CS159 – Fall Admin Assignment 3 Quiz #1  High: 36  Average: 33 (92%)  Median: 33.5 (93%)
Speech and Language Processing SLP Chapter 13 Parsing.
CS 2130 Lecture 18 Bottom-Up Parsing or Shift-Reduce Parsing Warning: The precedence table given for the Wff grammar is in error.
CSC 594 Topics in AI – Natural Language Processing
Parsing Recommended Reading: Ch th Jurafsky & Martin 2nd edition
Modeling Grammaticality
Top-Down Parsing.
CSCI 5832 Natural Language Processing
Earley’s Algorithm (1970) Nice combo of our parsing ideas so far:
Parsing and More Parsing
Parsing Tricks Intro to NLP - J. Eisner.
CSA2050 Introduction to Computational Linguistics
Modeling Grammaticality
Parsing I: CFGs & the Earley Parser
NLP.
Presentation transcript:

Intro to NLP - J. Eisner1 Earley’s Algorithm (1970) Nice combo of our parsing ideas so far:  no restrictions on the form of the grammar:  A  B C spoon D x  incremental parsing (left to right, like humans)  left context constrains parsing of subsequent words  so waste less time building impossible things  makes it faster than O(n 3 ) for many grammars

Intro to NLP - J. Eisner2 … …

3 Overview of Earley’s Algorithm  Finds constituents and partial constituents in input  A  B C. D E is partial: only the first half of the A A BCDE A  B C. D E D + = A BCDE A  B C D. E i j i k jk

Intro to NLP - J. Eisner4 Overview of Earley’s Algorithm  Proceeds incrementally, left-to-right  Before it reads word 5, it has already built all hypotheses that are consistent with first 4 words  Reads word 5 & attaches it to immediately preceding hypotheses. Might yield new constituents that are then attached to hypotheses immediately preceding them …  E.g., attaching D to A  B C. D E gives A  B C D. E  Attaching E to that gives A  B C D E.  Now we have a complete A that we can attach to hypotheses immediately preceding the A, etc.

Intro to NLP - J. Eisner5 Our Usual Example Grammar ROOT  S S  NP VPNP  Papa NP  Det NN  caviar NP  NP PPN  spoon VP  VP PPV  ate VP  V NPP  with PP  P NPDet  the Det  a

Intro to NLP - J. Eisner6 First Try: Recursive Descent  0 ROOT . S 0  0 S . NP VP 0  0 NP . Papa 0  0 NP  Papa. 1  0 S  NP. VP 1  1 VP . VP PP 1 1 VP . VP PP 1 oops, stack overflowed  OK, let’s pretend that didn’t happen.  Let’s suppose we didn’t see VP  VP PP, and used VP  V NP instead. ROOT  SVP  VP PPNP  PapaV  ate S  NP VPVP  V NPN  caviarP  with NP  Det NPP  P NPN  spoonDet  the NP  NP PP Det  a 0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7 “goal stack”

Intro to NLP - J. Eisner7 First Try: Recursive Descent  1 VP . V NP 1 after dot = nonterminal, so recursively look for it (“ predict ”)  1 V . ate 1 after dot = terminal, so look for it in the input (“ scan ”)  1 V  ate. 2 after dot = nothing, so parent’s subgoal is completed (“ attach ”)  1 VP  V. NP 2 predict (next subgoal)  2 NP  do some more parsing and eventually...  2 NP  we complete the parent’s NP subgoal, so attach  1 VP  V NP. 7 attach again  0 S  NP VP. 7 attach again ROOT  SVP  V NPNP  PapaV  ate S  NP VPVP  VP PPN  caviarP  with NP  Det NPP  P NPN  spoonDet  the NP  NP PP Det  a 0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7  0 ROOT . S 0  0 S . NP VP 0  0 NP . Papa 0  0 NP  Papa. 1  0 S  NP. VP 1 after dot = nonterminal, so recursively look for it (“ predict ”)

Intro to NLP - J. Eisner8 First Try: Recursive Descent  0 ROOT . S 0  0 S . NP VP 0  0 NP . Papa 0  0 NP  Papa. 1  0 S  NP. VP 1  1 VP . V NP 1  1 V . ate 1  1 V  ate. 2  1 VP  V. NP 2  2 NP   2 NP   1 VP  V NP. 7  0 S  NP VP. 7 ROOT  SVP  V NPNP  PapaV  ate S  NP VPVP  VP PPN  caviarP  with NP  Det NPP  P NPN  spoonDet  the NP  NP PP Det  a But how about the other parse? must backtrack to try predicting a different VP rule here instead 0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7 implement by function calls: S() calls NP() and VP(), which recurse

Intro to NLP - J. Eisner9 First Try: Recursive Descent  1 VP . V NP 1  1 V . ate 1  1 V  ate. 2  1 VP  V. NP 2  2 NP  do some more parsing and eventually...  2 NP  the correct NP is from 2 to 4 this time (but might we find the one from 2 to 7 instead?) ROOT  SVP  V NPNP  PapaV  ate S  NP VPVP  VP PPN  caviarP  with NP  Det NPP  P NPN  spoonDet  the NP  NP PP Det  a we’d better backtrack here too! (why?) 0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7  0 ROOT . S 0  0 S . NP VP 0  0 NP . Papa 0  0 NP  Papa. 1  0 S  NP. VP 1  1 VP . VP PP 1

Intro to NLP - J. Eisner10 First Try: Recursive Descent  1 VP . VP PP 1 1 VP . VP PP 1 oops, stack overflowed no fix after all – must transform grammar to eliminate left-recursive rules ROOT  SVP  V NPNP  PapaV  ate S  NP VPVP  VP PPN  caviarP  with NP  Det NPP  P NPN  spoonDet  the NP  NP PP Det  a 0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7  0 ROOT . S 0  0 S . NP VP 0  0 NP . Papa 0  0 NP  Papa. 1  0 S  NP. VP 1  1 VP . VP PP 1

Intro to NLP - J. Eisner11 Use a Parse Table (= “Chart”)  Earley’s algorithm resembles recursive descent, but solves the left-recursion problem. No recursive function calls.  Use a parse table as we did in CKY, so we can look up anything we’ve discovered so far. “Dynamic programming.”  Entries in column 5 look like (3, S  NP. VP) (but we’ll omit the  etc. to save space)  Built while processing word 5  Means that the input substring from 3 to 5 matches the initial NP portion of a S  NP VP rule  Dot shows how much we’ve matched as of column 5  Perfectly fine to have entries like (3, S  is it. true that S)

Intro to NLP - J. Eisner12 Use a Parse Table (“Chart”)  Entries in column 5 look like (3, S  NP. VP)  What does it mean if we have this entry?  Unknown right context: Doesn’t mean we’ll necessarily be able to find a VP starting at column 5 to complete the S.  Known left context: Does mean that some dotted rule back in column 3 is looking for an S that starts at 3.  So if we actually do find a VP starting at column 5, allowing us to complete the S, then we’ll be able to attach the S to something.  And when that something is complete, it too will have a customer to its left … just as in recursive descent!  In short, a top-down (i.e., goal-directed) parser: it chooses to start building a constituent not because of the input but because that’s what the left context needs. In the spoon, won’t build spoon as a verb because there’s no way to use a verb there.  So any hypothesis in column 5 could get used in the correct parse, if words 1-5 are continued in just the right way by words 6-n.

Intro to NLP - J. Eisner13 Operation of the Algorithm  Process all hypotheses one at a time in order. (Current hypothesis is shown in blue, with substring.)  This may add to the end of the to-do list, or try to add again. new hypotheses old hypotheses  Process a hypothesis according to what follows the dot – just as in recursive descent:  If a word, scan input and see if it matches  If a nonterminal, predict ways to match it (we’ll predict blindly, but could reduce # of predictions by looking ahead k symbols in the input and only making predictions that are compatible with this limited right context)  If nothing, then we have a complete constituent, so attach it to all its customers (shown in purple).

Intro to NLP - J. Eisner14 BCDE i j A (i, A  B C. D E) column j current hypothesis (incomplete) which action? One entry (hypothesis) … All entries ending at j stored in column j, as in CKY

Intro to NLP - J. Eisner15 (j, D . bludger) new entry to process later Predict BCDE i j A (i, A  B C. D E) column j current hypothesis (incomplete) D jj bludger

Intro to NLP - J. Eisner16 Scan (i, A  B C. D E) column j D jj bludger (j, D  bludger.) column k … new entry to process later k=j+1 in this example Current hypothesis (incomplete) (j, D . bludger) + j k bludger = D j k

Intro to NLP - J. Eisner17 Attach D jk (i, A  B C. D E) column j column k (j, D  bludger.) … current hypothesis (complete)

Intro to NLP - J. Eisner18 Attach D jk BCDE + i j A (i, A  B C. D E) = BCDE i k A (i, A  B C D. E) column j column k (j, D  bludger.) … current hypothesis (complete) customer (incomplete) new entry to process later

Intro to NLP - J. Eisner19 Our Usual Example Grammar ROOT  S S  NP VPNP  Papa NP  Det NN  caviar NP  NP PPN  spoon VP  VP PPV  ate VP  V NPP  with PP  P NPDet  the Det  a 0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7

0 0 ROOT. S initialize Remember this stands for (0, ROOT . S)

0 0 ROOT. S 0 S. NP VP predict the kind of S we are looking for Remember this stands for (0, S . NP VP)

0 0 ROOT. S 0 S. NP VP 0 NP. Det N 0 NP. NP PP 0 NP. Papa predict the kind of NP we are looking for (actually we’ll look for 3 kinds: any of the 3 will do)

0 0 ROOT. S 0 S. NP VP 0 NP. Det N 0 NP. NP PP 0 NP. Papa 0 Det. the 0 Det. a predict the kind of Det we are looking for (2 kinds)

0 0 ROOT. S 0 S. NP VP 0 NP. Det N 0 NP. NP PP 0 NP. Papa 0 Det. the 0 Det. a predict the kind of NP we’re looking for but we were already looking for these so don’t add duplicate goals! Note that this happened when we were processing a left-recursive rule.

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP 0 NP. Det N 0 NP. NP PP 0 NP. Papa 0 Det. the 0 Det. a scan: the desired word is in the input!

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP 0 NP. Det N 0 NP. NP PP 0 NP. Papa 0 Det. the 0 Det. a scan: failure

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP 0 NP. Det N 0 NP. NP PP 0 NP. Papa 0 Det. the 0 Det. a scan: failure

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP0 S NP. VP 0 NP. Det N0 NP NP. PP 0 NP. NP PP 0 NP. Papa 0 Det. the 0 Det. a attach the newly created NP (which starts at 0) to its customers (incomplete constituents that end at 0 and have NP after the dot)

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP0 S NP. VP 0 NP. Det N0 NP NP. PP 0 NP. NP PP1 VP. V NP 0 NP. Papa1 VP. VP PP 0 Det. the 0 Det. a predict

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP0 S NP. VP 0 NP. Det N0 NP NP. PP 0 NP. NP PP1 VP. V NP 0 NP. Papa1 VP. VP PP 0 Det. the1 PP. P NP 0 Det. a predict

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP0 S NP. VP 0 NP. Det N0 NP NP. PP 0 NP. NP PP1 VP. V NP 0 NP. Papa1 VP. VP PP 0 Det. the1 PP. P NP 0 Det. a1 V. ate predict

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP0 S NP. VP 0 NP. Det N0 NP NP. PP 0 NP. NP PP1 VP. V NP 0 NP. Papa1 VP. VP PP 0 Det. the1 PP. P NP 0 Det. a1 V. ate predict

0 Papa 1 0 ROOT. S0 NP Papa. 0 S. NP VP0 S NP. VP 0 NP. Det N0 NP NP. PP 0 NP. NP PP1 VP. V NP 0 NP. Papa1 VP. VP PP 0 Det. the1 PP. P NP 0 Det. a1 V. ate 1 P. with predict

0 Papa 1 ate 2 0 ROOT. S0 NP Papa.1 V ate. 0 S. NP VP0 S NP. VP 0 NP. Det N0 NP NP. PP 0 NP. NP PP1 VP. V NP 0 NP. Papa1 VP. VP PP 0 Det. the1 PP. P NP 0 Det. a1 V. ate 1 P. with scan: success!

0 Papa 1 ate 2 0 ROOT. S0 NP Papa.1 V ate. 0 S. NP VP0 S NP. VP 0 NP. Det N0 NP NP. PP 0 NP. NP PP1 VP. V NP 0 NP. Papa1 VP. VP PP 0 Det. the1 PP. P NP 0 Det. a1 V. ate 1 P. with scan: failure

0 Papa 1 ate 2 0 ROOT. S0 NP Papa.1 V ate. 0 S. NP VP0 S NP. VP1 VP V. NP 0 NP. Det N0 NP NP. PP 0 NP. NP PP1 VP. V NP 0 NP. Papa1 VP. VP PP 0 Det. the1 PP. P NP 0 Det. a1 V. ate 1 P. with attach

0 Papa 1 ate 2 0 ROOT. S0 NP Papa.1 V ate. 0 S. NP VP0 S NP. VP1 VP V. NP 0 NP. Det N0 NP NP. PP2 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP 0 Det. a1 V. ate 1 P. with predict

0 Papa 1 ate 2 0 ROOT. S0 NP Papa.1 V ate. 0 S. NP VP0 S NP. VP1 VP V. NP 0 NP. Det N0 NP NP. PP2 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with predict (these next few steps should look familiar)

0 Papa 1 ate 2 0 ROOT. S0 NP Papa.1 V ate. 0 S. NP VP0 S NP. VP1 VP V. NP 0 NP. Det N0 NP NP. PP2 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with predict

0 Papa 1 ate 2 0 ROOT. S0 NP Papa.1 V ate. 0 S. NP VP0 S NP. VP1 VP V. NP 0 NP. Det N0 NP NP. PP2 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with scan (this time we fail since Papa is not the next word)

0 Papa 1 ate 2 the 3 0 ROOT. S0 NP Papa.1 V ate.2 Det the. 0 S. NP VP0 S NP. VP1 VP V. NP 0 NP. Det N0 NP NP. PP2 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with scan: success!

0 Papa 1 ate 2 the 3 0 ROOT. S0 NP Papa.1 V ate.2 Det the. 0 S. NP VP0 S NP. VP1 VP V. NP 0 NP. Det N0 NP NP. PP2 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with

0 Papa 1 ate 2 the 3 0 ROOT. S0 NP Papa.1 V ate.2 Det the. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N 0 NP. Det N0 NP NP. PP2 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with

0 Papa 1 ate 2 the 3 0 ROOT. S0 NP Papa.1 V ate.2 Det the. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with attach

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa 0 Det. the1 PP. P NP2 Det. the 0 Det. a1 V. ate2 Det. a 1 P. with attach (again!)

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a 1 P. with attach (again!)

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with0 ROOT S. attach (again!)

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with0 ROOT S.

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with.5 Det a. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with.5 Det a. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP5 NP Det. N 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with.5 Det a. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP5 NP Det. N 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N6 N. caviar 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP6 N. spoon 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with.5 Det a. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP5 NP Det. N 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N6 N. caviar 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP6 N. spoon 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with.5 Det a.6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP5 NP Det. N 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N6 N. caviar 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP6 N. spoon 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with.5 Det a.6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP5 NP Det. N5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N6 N. caviar 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP6 N. spoon 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with 5 a 6 spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar.4 P with.5 Det a.6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.4 PP P. NP5 NP Det. N5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.5 NP. Det N6 N. caviar4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP. NP PP6 N. spoon5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.5 NP. Papa 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP5 Det. the 0 Det. a1 V. ate2 Det. a4 PP. P NP5 Det. a 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S. 4 P. with

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with 0 ROOT S.

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with 0 ROOT S.

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with 0 ROOT S.

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with 0 ROOT S.

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa1 VP. VP PP2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with 0 ROOT S.

Intro to NLP - J. Eisner81 Left Recursion Kills Pure Top-Down Parsing … VP

Intro to NLP - J. Eisner82 Left Recursion Kills Pure Top-Down Parsing … VP PP

Intro to NLP - J. Eisner83 Left Recursion Kills Pure Top-Down Parsing … VP PP VP PP

Intro to NLP - J. Eisner84 Left Recursion Kills Pure Top-Down Parsing … VP PP VP PP VP PP makes new hypotheses ad infinitum before we’ve seen the PPs at all hypotheses try to predict in advance how many PP’s will arrive in input

Intro to NLP - J. Eisner85 … but Earley’s Alg is Okay! VP PP VP 1 VP . VP PP (in column 1)

Intro to NLP - J. Eisner86 … but Earley’s Alg is Okay! VP V NP 1 VP  V NP. ate the caviar VP PP VP 1 VP . VP PP (in column 1) (in column 4)

Intro to NLP - J. Eisner87 … but Earley’s Alg is Okay! VP V NP VP PP VP V NP attach ate the caviar 1 VP  VP. PP VP PP VP 1 VP . VP PP (in column 1) (in column 4)

Intro to NLP - J. Eisner88 … but Earley’s Alg is Okay! VP V NP VP PP VP V NP ate the caviar with a spoon 1 VP  VP PP. VP PP VP 1 VP . VP PP (in column 1) (in column 7)

Intro to NLP - J. Eisner89 … but Earley’s Alg is Okay! VP V NP VP PP VP V NP ate the caviar with a spoon 1 VP  VP PP. VP PP VP 1 VP . VP PP can be reused (in column 1) (in column 7)

Intro to NLP - J. Eisner90 … but Earley’s Alg is Okay! VP V NP VP PP VP V NP VP PP 1 VP  VP. PP ate the caviar with a spoon VP PP VP 1 VP . VP PP can be reused (in column 1) (in column 7) attach

Intro to NLP - J. Eisner91 … but Earley’s Alg is Okay! VP V NP VP PP VP V NP VP PP ate the caviar with a spoon in his bed 1 VP  VP PP. VP PP VP 1 VP . VP PP can be reused (in column 1) (in column 10)

Intro to NLP - J. Eisner92 … but Earley’s Alg is Okay! VP V NP VP PP VP V NP VP PP ate the caviar with a spoon in his bed 1 VP  VP PP. VP PP VP 1 VP . VP PP can be reused again (in column 1) (in column 10)

Intro to NLP - J. Eisner93 … but Earley’s Alg is Okay! VP V NP VP PP VP V NP VP PP VP 1 VP . VP PP can be reused again VP PP VP PP 1 VP  VP. PP ate the caviar with a spoon in his bed (in column 1) (in column 10) attach

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa 1 VP. VP PP 2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the 1 VP VP. PP 1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with 0 ROOT S. completed a VP in col 4 col 1 lets us use it in a VP PP structure

0 Papa 1 ate 2 the 3 caviar 4 with a spoon 7 0 ROOT. S0 NP Papa.1 V ate.2 Det the.3 N caviar. … 6 N spoon. 0 S. NP VP0 S NP. VP1 VP V. NP2 NP Det. N2 NP Det N.5 NP Det N. 0 NP. Det N0 NP NP. PP2 NP. Det N3 N. caviar1 VP V NP.4 PP P NP. 0 NP. NP PP1 VP. V NP2 NP. NP PP3 N. spoon2 NP NP. PP5 NP NP. PP 0 NP. Papa 1 VP. VP PP 2 NP. Papa0 S NP VP.2 NP NP PP. 0 Det. the1 PP. P NP2 Det. the1 VP VP. PP1 VP VP PP. 0 Det. a1 V. ate2 Det. a4 PP. P NP7 PP. P NP 1 P. with0 ROOT S.1 VP V NP. 4 P. with2 NP NP. PP 0 S NP VP. 1 VP VP. PP 7 P. with 0 ROOT S. completed that VP = VP PP in col 7 col 1 would let us use it in a VP PP structure can reuse col 1 as often as we need

Intro to NLP - J. Eisner96 What’s the Complexity?