CS626: NLP, Speech and the Web Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 15, 17: Parsing Ambiguity, Probabilistic Parsing, sample seminar 17.

Slides:



Advertisements
Similar presentations
CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 2 (06/01/06) Prof. Pushpak Bhattacharyya IIT Bombay Part of Speech (PoS)
Advertisements

10. Lexicalized and Probabilistic Parsing -Speech and Language Processing- 발표자 : 정영임 발표일 :
1 Statistical NLP: Lecture 12 Probabilistic Context Free Grammars.
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing Probabilistic Context Free Grammars (Chapter 14) Muhammed Al-Mulhem March 1,
CS460/449 : Speech, Natural Language Processing and the Web/Topics in AI Programming (Lecture 2– Introduction+ML and NLP) Pushpak Bhattacharyya CSE Dept.,
For Monday Read Chapter 23, sections 3-4 Homework –Chapter 23, exercises 1, 6, 14, 19 –Do them in order. Do NOT read ahead.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 20-21– Natural Language Parsing.
6/9/2015CPSC503 Winter CPSC 503 Computational Linguistics Lecture 11 Giuseppe Carenini.
Parsing with PCFG Ling 571 Fei Xia Week 3: 10/11-10/13/05.
Introduction to Syntax, with Part-of-Speech Tagging Owen Rambow September 17 & 19.
Language Model. Major role: Language Models help a speech recognizer figure out how likely a word sequence is, independent of the acoustics. A lot of.
Machine Learning in Natural Language Processing Noriko Tomuro November 16, 2006.
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
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.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 26: Probabilistic Parsing.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
CS : Speech, Natural Language Processing and the Web/Topics in Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 12: Deeper.
1 Statistical Parsing Chapter 14 October 2012 Lecture #9.
Natural Language Processing Lecture 6 : Revision.
THE BIG PICTURE Basic Assumptions Linguistics is the empirical science that studies language (or linguistic behavior) Linguistics proposes theories (models)
GRAMMARS David Kauchak CS159 – Fall 2014 some slides adapted from Ray Mooney.
SI485i : NLP Set 8 PCFGs and the CKY Algorithm. PCFGs We saw how CFGs can model English (sort of) Probabilistic CFGs put weights on the production rules.
CS : Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Constituent Parsing and Algorithms (with.
Parsing I: Earley Parser CMSC Natural Language Processing May 1, 2003.
CS774. Markov Random Field : Theory and Application Lecture 19 Kyomin Jung KAIST Nov
PARSING David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
11 Chapter 14 Part 1 Statistical Parsing Based on slides by Ray Mooney.
Page 1 Probabilistic Parsing and Treebanks L545 Spring 2000.
Lecture 1, 7/21/2005Natural Language Processing1 CS60057 Speech &Natural Language Processing Autumn 2007 Lecture August 2007.
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture-17: Probabilistic parsing; inside- outside probabilities.
Albert Gatt Corpora and Statistical Methods Lecture 11.
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
CS460/626 : Natural Language Processing/Speech, NLP and the Web (Lecture 29– CYK; Inside Probability; Parse Tree construction) Pushpak Bhattacharyya CSE.
CPE 480 Natural Language Processing Lecture 4: Syntax Adapted from Owen Rambow’s slides for CSc Fall 2006.
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture-16: Probabilistic parsing; computing probability of.
CS460/626 : Natural Language Processing/Speech, NLP and the Web (Lecture 26– Recap HMM; Probabilistic Parsing cntd) Pushpak Bhattacharyya CSE Dept., IIT.
CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 17 (14/03/06) Prof. Pushpak Bhattacharyya IIT Bombay Formulation of Grammar.
CSA2050 Introduction to Computational Linguistics Parsing I.
PARSING 2 David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture-14: Probabilistic parsing; sequence labeling, PCFG.
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:
For Friday Finish chapter 23 Homework –Chapter 23, exercise 15.
CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 6 (14/02/06) Prof. Pushpak Bhattacharyya IIT Bombay Top-Down and Bottom-Up.
CPSC 422, Lecture 27Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27 Nov, 16, 2015.
December 2011CSA3202: PCFGs1 CSA3202: Human Language Technology Probabilistic Phrase Structure Grammars (PCFGs)
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 13: Deeper Adjective and PP Structure; Structural Ambiguity.
GRAMMARS David Kauchak CS457 – Spring 2011 some slides adapted from Ray Mooney.
NLP. Introduction to NLP Time flies like an arrow –Many parses –Some (clearly) more likely than others –Need for a probabilistic ranking method.
CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 13 (17/02/06) Prof. Pushpak Bhattacharyya IIT Bombay Top-Down Bottom-Up.
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture-15: Probabilistic parsing; PCFG (contd.)
NLP. Introduction to NLP #include int main() { int n, reverse = 0; printf("Enter a number to reverse\n"); scanf("%d",&n); while (n != 0) { reverse =
CS : Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Parsing Algos.
PARSING David Kauchak CS159 – Fall Admin Assignment 3 Quiz #1  High: 36  Average: 33 (92%)  Median: 33.5 (93%)
CS460/626 : Natural Language Processing/Speech, NLP and the Web (Lecture 25– Probabilistic Parsing) Pushpak Bhattacharyya CSE Dept., IIT Bombay 14 th March,
Natural Language Processing : Probabilistic Context Free Grammars Updated 8/07.
CSC 594 Topics in AI – Natural Language Processing
Statistical NLP Winter 2009
CS : Speech, NLP and the Web/Topics in AI
CS : Speech, NLP and the Web/Topics in AI
CS460/626 : Natural Language Processing/Speech, NLP and the Web (Lecture 23, 24– Parsing Algorithms; Parsing in case of Ambiguity; Probabilistic Parsing)
CS 388: Natural Language Processing: Syntactic Parsing
CSCI 5832 Natural Language Processing
Natural Language - General
Parsing and More Parsing
CS : Language Technology for the Web/Natural Language Processing
Pushpak Bhattacharyya CSE Dept., IIT Bombay
David Kauchak CS159 – Spring 2019
David Kauchak CS159 – Spring 2019
Presentation transcript:

CS626: NLP, Speech and the Web Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 15, 17: Parsing Ambiguity, Probabilistic Parsing, sample seminar 17 th and 24 th September, 2012 (16 th lecture was on UNL by Avishek)

Dealing With Structural Ambiguity Multiple parses for a sentence The man saw the boy with a telescope. The man saw the mountain with a telescope. The man saw the boy with the ponytail. At the level of syntax, all these sentences are ambiguous. But semantics can disambiguate 2 nd & 3 rd sentence.

Prepositional Phrase (PP) Attachment Problem V – NP 1 – P – NP 2 (Here P means preposition) NP 2 attaches to NP 1 ? or NP 2 attaches to V ?

Xerox Parsers XLE Parser (Freely available) XIP Parser (expensive) Linguistic Data Consortium (LDC at UPenn) European Language Resource Association (ELRA) Linguistic Data Consortium for Indian Languages (LDC-IL) EuropeIndia

Parse Trees for a Structurally Ambiguous Sentence Let the grammar be – S  NP VP NP  DT N | DT N PP PP  P NP VP  V NP PP | V NP For the sentence, “I saw a boy with a telescope”

Parse Tree - 1 S NPVP NVNP DetNPP PNP DetN I saw a boy with atelescope

Parse Tree -2 S NPVP NVNP DetN PP PNP DetN I saw a boy with atelescope

Parsing Structural Ambiguity

Parsing for Structurally Ambiguous Sentences Sentence “I saw a boy with a telescope” Grammar: S  NP VP NP  ART N | ART N PP | PRON VP  V NP PP | V NP ART  a | an | the N  boy | telescope PRON  I V  saw

Ambiguous Parses Two possible parses: PP attached with Verb (i.e. I used a telescope to see) ( S ( NP ( PRON “I” ) ) ( VP ( V “saw” ) ( NP ( (ART “a”) ( N “boy”)) ( PP (P “with”) (NP ( ART “a” ) ( N “telescope”))))) PP attached with Noun (i.e. boy had a telescope) ( S ( NP ( PRON “I” ) ) ( VP ( V “saw” ) ( NP ( (ART “a”) ( N “boy”) (PP (P “with”) (NP ( ART “a” ) ( N “telescope”))))))

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used 3B3B ( ( PRON VP ) 1 )− −

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used 3B3B ( ( PRON VP ) 1 )− − 4( ( VP ) 2 )− Consumed “I”

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used 3B3B ( ( PRON VP ) 1 )− − 4( ( VP ) 2 )− Consumed “I” 5( ( V NP PP ) 2 )( ( V NP ) 2 ) −Verb Attachment Rule used

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used 3B3B ( ( PRON VP ) 1 )− − 4( ( VP ) 2 )− Consumed “I” 5( ( V NP PP ) 2 )( ( V NP ) 2 ) −Verb Attachment Rule used 6( ( NP PP ) 3 )− Consumed “saw”

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used 3B3B ( ( PRON VP ) 1 )− − 4( ( VP ) 2 )− Consumed “I” 5( ( V NP PP ) 2 )( ( V NP ) 2 ) −Verb Attachment Rule used 6( ( NP PP ) 3 )− Consumed “saw” 7( ( ART N PP ) 3 ) (a) ( ( ART N PP PP ) 3 ) (b) ( ( PRON PP ) 3 )

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used 3B3B ( ( PRON VP ) 1 )− − 4( ( VP ) 2 )− Consumed “I” 5( ( V NP PP ) 2 )( ( V NP ) 2 ) −Verb Attachment Rule used 6( ( NP PP ) 3 )− Consumed “saw” 7( ( ART N PP ) 3 ) (a) ( ( ART N PP PP ) 3 ) (b) ( ( PRON PP ) 3 ) 8( ( N PP) 4 )− Consumed “a”

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used 3B3B ( ( PRON VP ) 1 )− − 4( ( VP ) 2 )− Consumed “I” 5( ( V NP PP ) 2 )( ( V NP ) 2 ) −Verb Attachment Rule used 6( ( NP PP ) 3 )− Consumed “saw” 7( ( ART N PP ) 3 ) (a) ( ( ART N PP PP ) 3 ) (b) ( ( PRON PP ) 3 ) 8( ( N PP) 4 )− Consumed “a” 9( ( PP ) 5 )− Consumed “boy”

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP 2( ( NP VP ) 1 )− −Use NP  ART N | ART N PP | PRON 3( ( ART N VP ) 1 ) (a) ( ( ART N PP VP ) 1 ) (b) ( ( PRON VP ) 1) −ART does not match “I”, backup state (b) used 3B3B ( ( PRON VP ) 1 )− − 4( ( VP ) 2 )− Consumed “I” 5( ( V NP PP ) 2 )( ( V NP ) 2 ) −Verb Attachment Rule used 6( ( NP PP ) 3 )− Consumed “saw” 7( ( ART N PP ) 3 ) (a) ( ( ART N PP PP ) 3 ) (b) ( ( PRON PP ) 3 ) 8( ( N PP) 4 )− Consumed “a” 9( ( PP ) 5 )− Consumed “boy” 10 ( ( P NP ) )− −

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP ……… …… 7( ( ART N PP ) 3 ) (a) ( ( ART N PP PP ) 3 ) (b) ( ( PRON PP ) 3 ) 8( ( N PP) 4 )− Consumed “a” 9( ( PP ) 5 )− Consumed “boy” 10( ( P NP ) 5 )− − 11 ( ( NP ) 6 )− Consumed “with”

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP ……… …… 7( ( ART N PP ) 3 ) (a) ( ( ART N PP PP ) 3 ) (b) ( ( PRON PP ) 3 ) 8( ( N PP) 4 )− Consumed “a” 9( ( PP ) 5 )− Consumed “boy” 10( ( P NP ) 5 )− − 11 ( ( NP ) 6 )− Consumed “with” 12( ( ART N ) 6 ) (a) ( ( ART N PP ) 6 ) (b) ( ( PRON ) 6) −

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP ……… …… 7( ( ART N PP ) 3 ) (a) ( ( ART N PP PP ) 3 ) (b) ( ( PRON PP ) 3 ) 8( ( N PP) 4 )− Consumed “a” 9( ( PP ) 5 )− Consumed “boy” 10( ( P NP ) 5 )− − 11 ( ( NP ) 6 )− Consumed “with” 12( ( ART N ) 6 ) (a) ( ( ART N PP ) 6 ) (b) ( ( PRON ) 6) − 13( ( N ) 7 )− Consumed “a”

Top Down Parse StateBackup State ActionComments 1( ( S ) 1 )− −Use S  NP VP ……… …… 7( ( ART N PP ) 3 ) (a) ( ( ART N PP PP ) 3 ) (b) ( ( PRON PP ) 3 ) 8( ( N PP) 4 )− Consumed “a” 9( ( PP ) 5 )− Consumed “boy” 10( ( P NP ) 5 )− − 11 ( ( NP ) 6 )− Consumed “with” 12( ( ART N ) 6 ) (a) ( ( ART N PP ) 6 ) (b) ( ( PRON ) 6) − 13( ( N ) 7 )− Consumed “a” 14( ( − ) 8 )− Consume “telescope” Finish Parsing

Top Down Parsing - Observations Top down parsing gave us the Verb Attachment Parse Tree (i.e., I used a telescope) To obtain the alternate parse tree, the backup state in step 5 will have to be invoked Is there an efficient way to obtain all parses ?

I saw a boy with a telescope Colour Scheme : Blue for Normal Parse Green for Verb Attachment Parse Purple for Noun Attachment Parse Red for Invalid Parse Bottom Up Parse

I saw a boy with a telescope Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2?

I saw a boy with a telescope Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3?

I saw a boy with a telescope Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5?

I saw a boy with a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? NP 35  ART 34 N 45

I saw a boywith a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? NP 35  ART 34 N 45 VP 25  V 23 NP 35 S 15  NP 12 VP 25 VP 2?  V 23 NP 35 PP 5?

I saw a boy with a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? PP 5?  P 56 NP 6? NP 35  ART 34 N 45 VP 25  V 23 NP 35 S 15  NP 12 VP 25 VP 2?  V 23 NP 35 PP 5?

I saw a boywith a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? PP 5?  P 56 NP 6? NP 35  ART 34 N 45 NP 68  ART 67 N 7? NP6 ?  ART 67 N 78 PP 8? VP 25  V 23 NP 35 S 15  NP 12 VP 25 VP 2?  V 23 NP 35 PP 5?

I saw a boywith a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? PP 5?  P 56 NP 6? NP 35  ART 34 N 45 NP 68  ART 67 N 7? NP6 ?  ART 67 N 78 PP 8? NP 68  ART 67 N 78 VP 25  V 23 NP 35 S 15  NP 12 VP 25 VP 2?  V 23 NP 35 PP 5?

I saw a boy with a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? PP 5?  P 56 NP 6? NP 35  ART 34 N 45 NP 68  ART 67 N 7? NP6 ?  ART 67 N 78 PP 8? NP 68  ART 67 N 78 VP 25  V 23 NP 35 S 15  NP 12 VP 25 VP 2?  V 23 NP 35 PP 5? PP 58  P 56 NP 68

I saw a boy with a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? PP 5?  P 56 NP 6? NP 35  ART 34 N 45 NP 68  ART 67 N 7? NP6 ?  ART 67 N 78 PP 8? NP 68  ART 67 N 78 VP 25  V 23 NP 35 S 15  NP 12 VP 25 VP 2?  V 23 NP 35 PP 5? PP 58  P 56 NP 68 NP 38  ART 34 N 45 PP 58

I saw a boywith a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? PP 5?  P 56 NP 6? NP 35  ART 34 N 45 NP 68  ART 67 N 7? NP6 ?  ART 67 N 78 PP 8? NP 68  ART 67 N 78 VP 25  V 23 NP 35 S 15  NP 12 VP 25 VP 2?  V 23 NP 35 PP 5? PP 58  P 56 NP 68 NP 38  ART 34 N 45 PP 58 VP 28  V 23 NP 38 VP 28  V 23 NP 35 PP 58

I saw a boy with a telescope NP 3?  ART 34 N 45 PP 5? Bottom Up Parse NP 12  PRON 12 S 1?  NP 12 VP 2? VP 2?  V 23 NP 3? PP ?? VP 2?  V 23 NP 3? NP 35  ART 34 N 45 NP 3?  ART 34 N 45 PP 5? PP 5?  P 56 NP 6? NP 35  ART 34 N 45 NP 68  ART 67 N 7? NP6 ?  ART 67 N 78 PP 8? NP 68  ART 67 N 78 VP 25  V 23 NP 35 S 15  NP 12 VP 25 VP 2?  V 23 NP 35 PP 5? PP 58  P 56 NP 68 NP 38  ART 34 N 45 PP 58 VP 28  V 23 NP 38 VP 28  V 23 NP 35 PP 58 S 18  NP 12 VP 28

Bottom Up Parsing - Observations Both Noun Attachment and Verb Attachment Parses obtained by simply systematically applying the rules Numbers in subscript help in verifying the parse and getting chunks from the parse

Exercise For the sentence, “The man saw the boy with a telescope” & the grammar given previously, compare the performance of top-down, bottom-up & top-down chart parsing.

Start of Probabilistic Parsing

Example of Sentence labeling: Parsing [ S1 [ S [ S [ VP [ VB Come][ NP [ NNP July]]]] [,,] [ CC and] [ S [ NP [ DT the] [ JJ IIT] [ NN campus]] [ VP [ AUX is] [ ADJP [ JJ abuzz] [ PP [ IN with] [ NP [ ADJP [ JJ new] [ CC and] [ VBG returning]] [ NNS students]]]]]] [..]]]

Noisy Channel Modeling Noisy Channel Source sentence Target parse T*= argmax [P(T|S)] T = argmax [P(T).P(S|T)] T = argmax [P(T)], since given the parse the Tsentence is completely determined and P(S|T)=1

Corpus A collection of text called corpus, is used for collecting various language data With annotation: more information, but manual labor intensive Practice: label automatically; correct manually The famous Brown Corpus contains 1 million tagged words. Switchboard: very famous corpora 2400 conversations, 543 speakers, many US dialects, annotated with orthography and phonetics

Discriminative vs. Generative Model W * = argmax (P(W|SS)) W Compute directly from P(W|SS) Compute from P(W).P(SS|W) Discriminative Model Generative Model

Language Models N-grams: sequence of n consecutive words/characters Probabilistic / Stochastic Context Free Grammars:  Simple probabilistic models capable of handling recursion  A CFG with probabilities attached to rules  Rule probabilities  how likely is it that a particular rewrite rule is used?

PCFGs Why PCFGs?  Intuitive probabilistic models for tree-structured languages  Algorithms are extensions of HMM algorithms  Better than the n-gram model for language modeling.

Data driven parsing is tied up with what is seen in the training data “Stand right walk left.” Often a message on the airport escalators. “Walk left” can come from :- “After climbing, we realized the walk left was still considerable.” “Stand right” can come from: - “The stand right though it seemed at that time, does not stand the scrutiny now.” Then the given sentence “Stand right walk left” will never be parsed correctly.

Chomsky Hierarchy Properties of the hierarchy:- The containment is proper. Grammar is not learnable even for the lowest type from positive examples alone. Type 3 or regular grammar Type 2 or CFG Type 1 or CSG Type 0

Rationalism vs Empiricism Scientific paper : - “The pendulum swings back” by Ken Church. Every 20 years there is a shift from rationalism to empiricism. AI approaches are of two types:- Rational (Theory and model driven e.g. Brill Tagger; humans decide the templates) Empirical (Data driven e.g. HMM) Is it possible to classify probabilistic CFG into any of these categories? Very difficult to answer. Anything that comes purely from brain can be put into the category of “rationalism”. There is no pure rationalism or pure empiricism

Laws of machine learning “Learning from vaccuum (zero knowledge) is impossible”. “Inductive bias decides what to learn”. In case of POS tagger, bias is that we assume the tagger to be a HMM model.

Formal Definition of PCFG A PCFG consists of  A set of terminals {w k }, k = 1,….,V {w k } = { child, teddy, bear, played…}  A set of non-terminals {N i }, i = 1,…,n {N i } = { NP, VP, DT…}  A designated start symbol N 1  A set of rules {N i   j }, where  j is a sequence of terminals & non-terminals NP  DT NN  A corresponding set of rule probabilities

Rule Probabilities  Rule probabilities are such that E.g., P( NP  DT NN) = 0.2 P( NP  NN) = 0.5 P( NP  NP PP) = 0.3  P( NP  DT NN) = 0.2  Means 20 % of the training data parses use the rule NP  DT NN

Probabilistic Context Free Grammars S  NP VP1.0 NP  DT NN0.5 NP  NNS0.3 NP  NP PP 0.2 PP  P NP1.0 VP  VP PP 0.6 VP  VBD NP0.4 DT  the1.0 NN  gunman0.5 NN  building0.5 VBD  sprayed 1.0 NNS  bullets1.0