The cyk parsing method 2
Download
1 / 31

THE CYK PARSING METHOD (2) - PowerPoint PPT Presentation


  • 80 Views
  • Uploaded on

THE CYK PARSING METHOD (2). Cornelia Kempa Carla Parra Escartín WS 2006-2007. AGENDA. Building the recognition table Undoing the effect of the CNF transformation 2.1. Overview 2.2. Adding removed elements 2.3. Parsing 2.3.1. Methodology 2.3.2. Left-most derivation

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' THE CYK PARSING METHOD (2)' - tashya-hudson


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
The cyk parsing method 2

THE CYK PARSING METHOD (2)

Cornelia Kempa

Carla Parra Escartín

WS 2006-2007


Agenda
AGENDA

  • Building the recognition table

  • Undoing the effect of the CNF transformation

    2.1. Overview

    2.2. Adding removed elements

    2.3. Parsing

    2.3.1. Methodology

    2.3.2. Left-most derivation

  • A short retrospective of CYK

  • Chart Parsing

Tübingen, 4th December 2006


Agenda1
AGENDA

  • Building the recognition table

  • Undoing the effect of the CNF transformation

    2.1. Overview

    2.2. Adding removed elements

    2.3. Parsing

    2.3.1. Methodology

    2.3.2. Left-most derivation

  • A short retrospective of CYK

  • Chart Parsing

Tübingen, 4th December 2006


2 undoing the effect of the cnf transformation
2. Undoing the effect of the CNF transformation

2.1. Overview (1)

Tübingen, 4th December 2006


2 undoing the effect of the cnf transformation1
2. Undoing the effect of the CNF transformation

2.1. Overview (2)

Tübingen, 4th December 2006


2 undoing the effect of the cnf transformation2
2. Undoing the effect of the CNF transformation

2.1. Overview (3)

Tübingen, 4th December 2006


Agenda2
AGENDA

  • Building the recognition table

  • Undoing the effect of the CNF transformation

    2.1. Overview

    2.2. Adding removed elements

    2.3. Parsing

    2.3.1. Methodology

    2.3.2. Left-most derivation

  • A short retrospective of CYK

  • Chart Parsing

Tübingen, 4th December 2006


2 2 adding removed elements 1

2. Undoing the effect of the CNF transformation

2.2. Adding removed elements (1)

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.2. Adding removed elements (2)

  • CYK does not require all non-terminals reachable.

+

Rule added!!!

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.2. Adding removed elements (3)

New line

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.2. Adding removed elements (4)

  • Set Rsi, 0

     non-terminals that can be considered as possibly occurring just in front of symbol zi

  • Set Rsn +1,0

    non-terminals that can occur at the end of the sentence.

Tübingen, 4th December 2006


Agenda3
AGENDA

  • Building the recognition table

  • Undoing the effect of the CNF transformation

    2.1. Overview

    2.2. Adding removed elements

    2.3. Parsing

    2.3.1. Methodology

    2.3.2. Left-most derivation

  • A short retrospective of CYK

  • Chart Parsing

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.3. Parsing2.3.1. Methodology (1)

  • Derivation starts with start-symbol S.

  • Is A1A2···Am a right hand side of S?

    • Does A1A2···Am derive S1,n?

    • We check this starting with A1

    • 2 cases:

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.3. Parsing2.3.1. Methodology (2)

A) A1 is a terminal symbol

 it must be the first symbol of s1,n

 then check if A2···Am derives s2,n-1

B) A1 is a non-terminal symbol

 it must be a member of Rs1,k

 then check if A2···Am derives s2,k+1,n-k

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.3. Parsing2.3.1. Methodology (3)

  • 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.

Tübingen, 4th December 2006


Agenda4
AGENDA

  • Building the recognition table

  • Undoing the effect of the CNF transformation

    2.1. Overview

    2.2. Adding removed elements

    2.3. Parsing

    2.3.1. Methodology

    2.3.2. Left-most derivation

  • A short retrospective of CYK

  • Chart Parsing

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.3. Parsing2.3.2. Left-most derivation (1)

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.3. Parsing2.3.2. Left-most derivation (2)

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.3. Parsing2.3.2. Left-most derivation (3)

This is what we saw so far:

If we continue... The derivation is:

Tübingen, 4th December 2006


2. Undoing the effect of the CNF transformation

2.3. Parsing2.3.2. Left-most derivation (4)

Tübingen, 4th December 2006


Agenda5
AGENDA

  • Building the recognition table

  • Undoing the effect of the CNF transformation

    2.1. Overview

    2.2. Adding removed elements

    2.3. Parsing

    2.3.1. Methodology

    2.3.2. Left-most derivation

  • A short retrospective of CYK

  • Chart Parsing

Tübingen, 4th December 2006


3 a short retrospective of cyk 1
3. A short retrospective of CYK (1)

  • First: recognition table using the original grammar.

  • Then: transforming grammar to CNF.

Tübingen, 4th December 2006


3 a short retrospective of cyk 2
3. A short retrospective of CYK (2)

  • 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!

Tübingen, 4th December 2006


3 a short retrospective of cyk 3
3. A short retrospective of CYK (3)

  • In the transformation process, some non-terminals were thrown away

    (non-productive)

  • Missing information could be added.

Tübingen, 4th December 2006


3 a short retrospective of cyk 21
3. A short retrospective of CYK (2)

  • Result: almost the same recognition table.

    • Extra information on non-terminals

    • Obtained in a simpler and much more efficient way.

Tübingen, 4th December 2006


Agenda6
AGENDA

  • Building the recognition table

  • Undoing the effect of the CNF transformation

    2.1. Overview

    2.2. Adding removed elements

    2.3. Parsing

    2.3.1. Methodology

    2.3.2. Left-most derivation

  • A short retrospective of CYK

  • Chart Parsing

Tübingen, 4th December 2006


4 chart parsing 1
4. Chart parsing (1)

  • CYK algorithm also known as chart parsing.

  • Both techniques  variants

    (some of them identical among the techniques)

  • Difference: implementation.

Tübingen, 4th December 2006


4 chart parsing 2
4. Chart parsing (2)

A chart is just a recognition table.

Tübingen, 4th December 2006


Final overview 1
FINAL OVERVIEW (1)

  • Building the recognition table

  • Possible Derivations

  • Undoing the effect of the CNF transformation.

  • A short retrospective of CYK

  • Chart Parsing

Tübingen, 4th December 2006


Final overview 2
FINAL OVERVIEW (2)

Tübingen, 4th December 2006



ad