130 likes | 278 Views
Left-Corner Grammar Transform and Incremental Parsing. Aria Haghighi. Grammar Transform. A CFG G Nonterminals N Terminals T Productions (Rules) P A grammar Transform : G ! G’. Parsing Strategies. Bottom-Up e.g. CKY Top-Down Inefficient and may not terminate
E N D
Left-Corner Grammar TransformandIncremental Parsing Aria Haghighi
Grammar Transform • A CFG G • Nonterminals N • Terminals T • Productions (Rules) P • A grammar Transform • :G !G’
Parsing Strategies • Bottom-Up • e.g. CKY • Top-Down • Inefficient and may not terminate • Left-Corner • Recognize Left-Child predict parent
Left-Corner’s Arch-Nemesis • Left recursion • X !* X • Nontermination • Recognize X starting at position 1 • Recognize X starting at position 1 • Recognize X starting at position 1 • Recognize X starting at position 1 • …..
Old School Left-Recursion Removal • Due to Hopcraft and Ullman For A !1 | … | m (i A ) A ! A 1 | … | A k (i ) Add A !1 | 1 A’|…|m | m A’ A’ !1 | 1 A’ | …. | k | k A’
Problem with the old school • It’s a big school!! • Can have exponential Blowup in number of productions • PCFG Estimation • Lots of sparse rules
Select Left-Corner Transform • Left-corner productions L • Add states D-X
Keeping it Small • Do we need each D-X ? • Only if D !L* X • How do we choose L ? • Need all left recursive rules • Suffice to have rules where first child is a non-terminal
Binarizing the Output For Top-Down Rules: (td) For Left-Corner Rules: (lc)
Incremental Parsing • Operate on flattened selective left-corner algorithm • Partial Parses include left-chain with heuristic filtering • Beam Search