CSCI 5832 Natural Language Processing

Slides:



Advertisements
Similar presentations
Basic Parsing with Context-Free Grammars CS 4705 Julia Hirschberg 1 Some slides adapted from Kathy McKeown and Dan Jurafsky.
Advertisements

PARSING WITH CONTEXT-FREE GRAMMARS
Parsing with Context Free Grammars Reading: Chap 13, Jurafsky & Martin
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing Probabilistic Context Free Grammars (Chapter 14) Muhammed Al-Mulhem March 1,
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.
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.
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.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
PARSING David Kauchak CS457 – Fall 2011 some slides adapted from Ray Mooney.
CS460/626 : Natural Language Processing/Speech, NLP and the Web (Lecture 29– CYK; Inside Probability; Parse Tree construction) Pushpak Bhattacharyya CSE.
1 Basic Parsing with Context- Free Grammars Slides adapted from Dan Jurafsky and Julia Hirschberg.
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.
中文信息处理 Chinese NLP Lecture 9.
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- 발표자 : 정영임 발표일 :
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.
11 Chapter 14 Part 1 Statistical Parsing Based on slides by Ray Mooney.
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2007 Lecture August 2007.
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.
Sentence Parsing Parsing 3 Dynamic Programming. Jan 2009 Speech and Language Processing - Jurafsky and Martin 2 Acknowledgement  Lecture based on  Jurafsky.
PARSING 2 David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
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:
Natural Language Processing Lecture 15—10/15/2015 Jim Martin.
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.
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.
1 Statistical methods in NLP Diana Trandabat
CSC 594 Topics in AI – Natural Language Processing
CSC 594 Topics in AI – Natural Language Processing
Parsing Recommended Reading: Ch th Jurafsky & Martin 2nd edition
Statistical NLP Winter 2009
CS60057 Speech &Natural Language Processing
Basic Parsing with Context Free Grammars Chapter 13
CKY Parser 0Book 1 the 2 flight 3 through 4 Houston5 6/19/2018
Parsing Recommended Reading: Ch th Jurafsky & Martin 2nd edition
Probabilistic CKY Parser
CSCI 5832 Natural Language Processing
CPSC 503 Computational Linguistics
CSCI 5832 Natural Language Processing
Probabilistic and Lexicalized Parsing
CSCI 5832 Natural Language Processing
CPSC 503 Computational Linguistics
CKY Parser 0Book 1 the 2 flight 3 through 4 Houston5 11/16/2018
CS 388: Natural Language Processing: Syntactic Parsing
CSCI 5832 Natural Language Processing
Probabilistic and Lexicalized Parsing
Lecture 14: Grammar and Parsing (II) November 11, 2004 Dan Jurafsky
CSCI 5832 Natural Language Processing
Natural Language - General
Earley’s Algorithm (1970) Nice combo of our parsing ideas so far:
Parsing and More Parsing
CSCI 5832 Natural Language Processing
Heng Ji January 17, 2019 SYNATCTIC PARSING Heng Ji January 17, 2019.
CPSC 503 Computational Linguistics
CSCI 5832 Natural Language Processing
CSA2050 Introduction to Computational Linguistics
Parsing I: CFGs & the Earley Parser
David Kauchak CS159 – Spring 2019
NLP.
Presentation transcript:

CSCI 5832 Natural Language Processing Lecture 13 Jim Martin 11/16/2018 CSCI 5832 Spring 2007

Today: 3/1 Review/Finish CKY Earley parsing 11/16/2018 CSCI 5832 Spring 2007

CKY Algorithm 11/16/2018 CSCI 5832 Spring 2007

CKY Table 11/16/2018 CSCI 5832 Spring 2007

Example 11/16/2018 CSCI 5832 Spring 2007

Other Ways to Do It? Are there any other sensible ways to fill the table that still guarantee that the cells we need are already filled? 11/16/2018 CSCI 5832 Spring 2007

Other Ways to Do It? 11/16/2018 CSCI 5832 Spring 2007

Sample Grammar 11/16/2018 CSCI 5832 Spring 2007

CNF Conversion 11/16/2018 CSCI 5832 Spring 2007

Example Fill the Last Column 11/16/2018 CSCI 5832 Spring 2007

Example Fill the Last Column 11/16/2018 CSCI 5832 Spring 2007

Example Fill the Last Column 11/16/2018 CSCI 5832 Spring 2007

Example Fill the Last Column 11/16/2018 CSCI 5832 Spring 2007

Example Fill the Last Column 11/16/2018 CSCI 5832 Spring 2007

CKY Notes Since it’s bottom up, CKY populates the table with a lot of phantom constituents. Segments that by themselves are constituents but cannot really occur in the context in which they are being suggested. To avoid this we can switch to a top-down control strategy or We can add some kind of filtering that blocks constituents where they can not happen in a final analysis. 11/16/2018 CSCI 5832 Spring 2007

Earley Parsing Allows arbitrary CFGs Top-down control Fills a table in a single sweep over the input words Table is length N+1; N is number of words Table entries represent Completed constituents and their locations In-progress constituents Predicted constituents 11/16/2018 CSCI 5832 Spring 2007

States The table-entries are called states and are represented with dotted-rules. S -> · VP A VP is predicted NP -> Det · Nominal An NP is in progress VP -> V NP · A VP has been found 11/16/2018 CSCI 5832 Spring 2007

States/Locations It would be nice to know where these things are in the input so… S ->  VP [0,0] A VP is predicted at the start of the sentence NP -> Det  Nominal [1,2] An NP is in progress; the Det goes from 1 to 2 VP -> V NP  [0,3] A VP has been found starting at 0 and ending at 3 11/16/2018 CSCI 5832 Spring 2007

States/Locations S ->  VP [0,0] NP -> Det  Nominal [1,2] VP -> V NP  [0,3] A VP is predicted at the start of the sentence An NP is in progress; the Det goes from 1 to 2 A VP has been found starting at 0 and ending at 3 11/16/2018 CSCI 5832 Spring 2007

Graphically 11/16/2018 CSCI 5832 Spring 2007

Earley As with most dynamic programming approaches, the answer is found by looking in the table in the right place. In this case, there should be an S state in the final column that spans from 0 to n and is complete. If that’s the case you’re done. S –> α  [0,n] 11/16/2018 CSCI 5832 Spring 2007

Earley So sweep through the table from 0 to n… New predicted states are created by starting top-down from S New incomplete states are created by advancing existing states as new constituents are discovered New complete states are created in the same way. 11/16/2018 CSCI 5832 Spring 2007

Earley More specifically… Predict all the states you can upfront Read a word Extend states based on matches Generate new predictions Go to step 2 Look at n to see if you have a winner 11/16/2018 CSCI 5832 Spring 2007

Earley Code 11/16/2018 CSCI 5832 Spring 2007

Earley Code 11/16/2018 CSCI 5832 Spring 2007

Example Book that flight We should find… an S from 0 to 3 that is a completed state… 11/16/2018 CSCI 5832 Spring 2007

Example 11/16/2018 CSCI 5832 Spring 2007

Add To Chart 11/16/2018 CSCI 5832 Spring 2007

Example 11/16/2018 CSCI 5832 Spring 2007

Example 11/16/2018 CSCI 5832 Spring 2007

Efficiency For such a simple example, there seems to be a lot of useless stuff in there. Why? It’s predicting things that aren’t consistent with the input That’s the flipside to the CKY problem. 11/16/2018 CSCI 5832 Spring 2007

Details As with CKY that isn’t a parser until we add the backpointers so that each state knows where it came from. 11/16/2018 CSCI 5832 Spring 2007

Back to Ambiguity Did we solve it? 11/16/2018 CSCI 5832 Spring 2007

Ambiguity 11/16/2018 CSCI 5832 Spring 2007

Ambiguity No… Both CKY and Earley will result in multiple S structures for the [0,n] table entry. They both efficiently store the sub-parts that are shared between multiple parses. And they obviously avoid re-deriving those sub-parts. But neither can tell us which one is right. 11/16/2018 CSCI 5832 Spring 2007

Ambiguity In most cases, humans don’t notice incidental ambiguity (lexical or syntactic). It is resolved on the fly and never noticed. We’ll try to model that with probabilities. But note something odd and important about the Groucho Marx example… 11/16/2018 CSCI 5832 Spring 2007

Next Time Read Section 12.5 (Partial Parsing) Then go back and start reading Sections 6.6, 6,7 and 6.8. If you have no background in stats please slog through section 6.6 carefully. After that we’ll move on to probabilistic parsing which is in the new draft Ch.13 Which isn’t there yet. Hopefully it will be there when we get there. 11/16/2018 CSCI 5832 Spring 2007