THE CYK PARSING METHOD (2) Cornelia Kempa Carla Parra Escartín WS
Tübingen, 4th December AGENDA 1. Building the recognition table 2. Undoing the effect of the CNF transformation 2.1. Overview 2.2. Adding removed elements 2.3. Parsing Methodology Left-most derivation 3. A short retrospective of CYK 4. Chart Parsing
Tübingen, 4th December AGENDA 1. Building the recognition table 2. Undoing the effect of the CNF transformation 2.1. Overview 2.2. Adding removed elements 2.3. Parsing Methodology Left-most derivation 3. A short retrospective of CYK 4. Chart Parsing
Tübingen, 4th December Undoing the effect of the CNF transformation 2.1. Overview (1)
Tübingen, 4th December Undoing the effect of the CNF transformation 2.1. Overview (2)
Tübingen, 4th December Undoing the effect of the CNF transformation 2.1. Overview (3)
Tübingen, 4th December AGENDA 1. Building the recognition table 2. Undoing the effect of the CNF transformation 2.1. Overview 2.2. Adding removed elements 2.3. Parsing Methodology Left-most derivation 3. A short retrospective of CYK 4. Chart Parsing
Tübingen, 4th December Adding removed elements (1) 2. Undoing the effect of the CNF transformation
Tübingen, 4th December CYK does not require all non-terminals reachable. Rule added!!! Adding removed elements (2) 2. Undoing the effect of the CNF transformation
Tübingen, 4th December New line 2. Undoing the effect of the CNF transformation 2.2. Adding removed elements (3)
Tübingen, 4th December Set R si, 0 non-terminals that can be considered as possibly occurring just in front of symbol z i Set R sn +1,0 non-terminals that can occur at the end of the sentence Adding removed elements (4) 2. Undoing the effect of the CNF transformation
Tübingen, 4th December AGENDA 1. Building the recognition table 2. Undoing the effect of the CNF transformation 2.1. Overview 2.2. Adding removed elements 2.3. Parsing Methodology Left-most derivation 3. A short retrospective of CYK 4. Chart Parsing
Tübingen, 4th December Derivation starts with start-symbol S. Is A 1 A 2 ···A m a right hand side of S? Does A 1 A 2 ···A m derive S 1,n ? We check this starting with A 1 2 cases: 2. Undoing the effect of the CNF transformation 2.3. Parsing Methodology (1)
Tübingen, 4th December A) A 1 is a terminal symbol it must be the first symbol of s 1,n then check if A 2 ···A m derives s 2,n-1 B) A1 is a non-terminal symbol it must be a member of R s1,k then check if A 2 ···A m derives s 2,k+1,n-k 2. Undoing the effect of the CNF transformation 2.3. Parsing Methodology (2)
Tübingen, 4th December Now: determined whether the rule is applicable if so, which parts of the rule derive which substrings. Next step: determine how the substrings can be derived. 2. Undoing the effect of the CNF transformation 2.3. Parsing Methodology (3)
Tübingen, 4th December AGENDA 1. Building the recognition table 2. Undoing the effect of the CNF transformation 2.1. Overview 2.2. Adding removed elements 2.3. Parsing Methodology Left-most derivation 3. A short retrospective of CYK 4. Chart Parsing
Tübingen, 4th December Undoing the effect of the CNF transformation 2.3. Parsing Left-most derivation (1)
Tübingen, 4th December Undoing the effect of the CNF transformation 2.3. Parsing Left-most derivation (2)
Tübingen, 4th December This is what we saw so far: If we continue... The derivation is: 2. Undoing the effect of the CNF transformation 2.3. Parsing Left-most derivation (3)
Tübingen, 4th December Undoing the effect of the CNF transformation 2.3. Parsing Left-most derivation (4)
Tübingen, 4th December AGENDA 1. Building the recognition table 2. Undoing the effect of the CNF transformation 2.1. Overview 2.2. Adding removed elements 2.3. Parsing Methodology Left-most derivation 3. A short retrospective of CYK 4. Chart Parsing
Tübingen, 4th December First: recognition table using the original grammar. Then: transforming grammar to CNF. 3. A short retrospective of CYK (1)
Tübingen, 4th December For efficiency, CNF is a bit too restrictive Disadvantage of CNF: Resulting recognition table lacks the information we need to construct a derivation using the original grammar! 3. A short retrospective of CYK (2)
Tübingen, 4th December In the transformation process, some non-terminals were thrown away (non-productive) Missing information could be added. 3. A short retrospective of CYK (3)
Tübingen, 4th December Result: almost the same recognition table. Extra information on non-terminals Obtained in a simpler and much more efficient way. 3. A short retrospective of CYK (2)
Tübingen, 4th December AGENDA 1. Building the recognition table 2. Undoing the effect of the CNF transformation 2.1. Overview 2.2. Adding removed elements 2.3. Parsing Methodology Left-most derivation 3. A short retrospective of CYK 4. Chart Parsing
Tübingen, 4th December CYK algorithm also known as chart parsing. Both techniques variants (some of them identical among the techniques) Difference: implementation. 4. Chart parsing (1)
Tübingen, 4th December A chart is just a recognition table. 4. Chart parsing (2)
Tübingen, 4th December FINAL OVERVIEW (1) 1. Building the recognition table 2. Possible Derivations 3. Undoing the effect of the CNF transformation. 4. A short retrospective of CYK 5. Chart Parsing
Tübingen, 4th December PARSING METHODS Non-directional methods Top-downBottom-up Unger ParserCYK Parser FINAL OVERVIEW (2)
THANK YOU VERY MUCH