Download presentation
Presentation is loading. Please wait.
Published byStewart Anthony Modified over 9 years ago
1
October 2008CSA3180: Sentence Parsing1 CSA3180: NLP Algorithms Sentence Parsing Algorithms 2 Problems with DFTD Parser
2
October 2008CSA3180: Sentence Parsing2 Problems with DFTD Parser Left Recursion Handling Ambiguity Inefficiency
3
October 2008CSA3180: Sentence Parsing3 Left Recursion A grammar is left recursive if it contains at least one non-terminal A for which A * A and * (n.b. * is the transitive closure of ) Intuitive idea: derivation of that category includes itself along its leftmost branch. NP NP PP NP NP and NP NP DetP Nominal DetP NP ' s
4
October 2008CSA3180: Sentence Parsing4 Left Recursion Left recursion can lead to an infinite loop [nltk demo
5
October 2008CSA3180: Sentence Parsing5 Dealing with Left Recursion Use different parsing strategy Reformulate the grammar to eliminate LR A A | is rewritten as A A' A' A' |
6
October 2008CSA3180: Sentence Parsing6 Rewriting the Grammar NP → NP ‘and’ NP NP → D N | D N PP
7
October 2008CSA3180: Sentence Parsing7 Rewriting the Grammar NP → NP ‘and’ NP β NP → D N | D N PP α
8
October 2008CSA3180: Sentence Parsing8 Rewriting the Grammar NP → NP ‘and’ NP β NP → D N | D N PP α New Grammar NP → α NP1 NP1 → β NP1 | ε
9
October 2008CSA3180: Sentence Parsing9 Rewriting the Grammar NP → NP ‘and’ NP β NP → D N | D N PP α New Grammar NP → α NP1 NP1 → β NP1 | ε α → D N | D N PP β → ‘and’ NP
10
October 2008CSA3180: Sentence Parsing10 New Parse Tree D N the cat α NP NP1 ε
11
October 2008CSA3180: Sentence Parsing11 Rewriting the Grammar Different parse tree Unnatural parse tree?
12
October 2008CSA3180: Sentence Parsing12 Problems with DFTD Parser Left Recursion Handling Ambiguity Inefficiency
13
October 2008CSA3180: Sentence Parsing13 Handling Ambiguity Coordination Ambiguity: different scope of conjunction: Hot curry and ice taste nice with rice Hot curry and rice taste nice with ice Attachment Ambiguity: a constituent can be added to the parse tree in different places: I shot an elephant in my trousers VP → VP PP NP → NP PP
14
October 2008CSA3180: Sentence Parsing14 Real sentences are full of ambiguities President Kennedy today pushed aside other White House business to devote all his time and attention to working on the Berlin crisis address he will deliver tomorrow night to the American people over nationwide television and radio
15
October 2008CSA3180: Sentence Parsing15 Prepositional Phrase Ambiguity No of PPs# parses 22 35 414 5132 6469 71430 84867 he will deliver - to the American people - over nationwide TV - in New York - during September - for very good reasons
16
October 2008CSA3180: Sentence Parsing16 Growth of Number of Ambiguities The nth Catalan number counts the ways of dissecting a polygon with n+2 sides into triangles by drawing nonintersecting diagonals. No of PPs# parses 22 35 414 5132 6469 71430 84867
17
October 2008CSA3180: Sentence Parsing17 Handling Ambiguities Statistical disambiguation –which is the most probable interpretation? Semantic knowledge –which is the most sensible interpretation? –Subatomic particles such as positively charged protons and electrons
18
October 2008CSA3180: Sentence Parsing18 Problems with DFTD Parser Left Recursion Handling Ambiguity Inefficiency
19
October 2008CSA3180: Sentence Parsing19 Repeated Parsing of Subtrees Local versus global ambiguity. –NP → Det Noun –NP → NP PP Because of the top down depth first, left to right policy, the parser builds trees that fail because they do not cover all of the input. Successive parses cover larger segments of the input, but these include structures that have already been built before.
20
October 2008CSA3180: Sentence Parsing20 Repeated Parsing of Subtrees a flight4 from Indianapolis3 to Houston2 on TWA1 A flight from Indianapolis3 A flight from Indianapolis to Houston 2 A flight from Indianapolis to Houston on TWA 1 NP Nom Det Noun a flight NP NP PP Nom Det Noun P Noun a flight from Indianapolis
21
October 2008CSA3180: Sentence Parsing21 Repeated Parsing of Subtrees a flight4 from Indianapolis3 to Houston2 on TWA1 A flight from Indianapolis3 A flight from Indianapolis to Houston 2 A flight from Indianapolis to Houston on TWA 1
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.