CS626-460: Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Constituent Parsing and Algorithms (with.

Slides:



Advertisements
Similar presentations
CS460/626 : Natural Language Processing/Speech, NLP and the Web (Lecture 20– Parsing) Pushpak Bhattacharyya CSE Dept., IIT Bombay 28 th Feb, 2011.
Advertisements

Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 2 (06/01/06) Prof. Pushpak Bhattacharyya IIT Bombay Part of Speech (PoS)
Chapter 4 Syntax.
Natural Language Processing - Parsing 1 - Language, Syntax, Parsing Problems in Parsing Ambiguity, Attachment / Binding Bottom vs. Top Down Parsing.
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Approaches to Parsing.
Techniques of Grammatical Analysis
Midterm Exam Nov. 2 1pm to 4pm Room: 3002 NSH Open book –But no internet or cell phone May bring food. May step outside to smoke. May go to restrooms.
GRAMMAR & PARSING (Syntactic Analysis) NLP- WEEK 4.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 20-21– Natural Language Parsing.
1 Words and the Lexicon September 10th 2009 Lecture #3.
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language, Syntax, Parsing Problems in Parsing Ambiguity, Attachment.
 Christel Kemke /08 COMP 4060 Natural Language Processing PARSING.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Word Classes and English Grammar.
Artificial Intelligence 2005/06 From Syntax to Semantics.
Syntax Phrase and Clause in Present-Day English. The X’ phrase system Any X phrase in PDE consists of: – an optional specifier – X’ (X-bar) which is the.
NLP and Speech 2004 English Grammar
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
1 CONTEXT-FREE GRAMMARS. NLE 2 Syntactic analysis (Parsing) S NPVP ATNNSVBD NP AT NNthechildrenate thecake.
1 CSC 594 Topics in AI – Applied Natural Language Processing Fall 2009/ Outline of English Syntax.
Artificial Intelligence 2004 Natural Language Processing - Syntax and Parsing - Language Syntax Parsing.
Lect. 11Phrase structure rules Learning objectives: To define phrase structure rules To learn the forms of phrase structure rules To compose new sentences.
Context-Free Grammar CSCI-GA.2590 – Lecture 3 Ralph Grishman NYU.
1 Basic Parsing with Context Free Grammars Chapter 13 September/October 2012 Lecture 6.
Constituency Tests Phrase Structure Rules
THE PARTS OF SYNTAX Don’t worry, it’s just a phrase ELL113 Week 4.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
CS460/626 : Natural Language Processing/Speech, NLP and the Web (Lecture 29– CYK; Inside Probability; Parse Tree construction) Pushpak Bhattacharyya CSE.
Pushpak Bhattacharyya CSE Dept., IIT Bombay 21st March, 2011
CS : Speech, Natural Language Processing and the Web/Topics in Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 12: Deeper.
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Parsing with Context Free Grammars.
NLP. Introduction to NLP Is language more than just a “bag of words”? Grammatical rules apply to categories and groups of words, not individual words.
October 2005csa3180: Parsing Algorithms 11 CSA350: NLP Algorithms Sentence Parsing I The Parsing Problem Parsing as Search Top Down/Bottom Up Parsing Strategies.
CS626: NLP, Speech and the Web Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 15, 17: Parsing Ambiguity, Probabilistic Parsing, sample seminar 17.
GrammaticalHierarchy in Information Flow Translation Grammatical Hierarchy in Information Flow Translation CAO Zhixi School of Foreign Studies, Lingnan.
11 Chapter 14 Part 1 Statistical Parsing Based on slides by Ray Mooney.
Notes on Pinker ch.7 Grammar, parsing, meaning. What is a grammar? A grammar is a code or function that is a database specifying what kind of sounds correspond.
CS460/626 : Natural Language Processing/Speech, NLP and the Web Some parse tree examples (from quiz 3) Pushpak Bhattacharyya CSE Dept., IIT Bombay 12 th.
Linguistic Essentials
Parsing with Context-Free Grammars for ASR Julia Hirschberg CS 4706 Slides with contributions from Owen Rambow, Kathy McKeown, Dan Jurafsky and James Martin.
CPE 480 Natural Language Processing Lecture 4: Syntax Adapted from Owen Rambow’s slides for CSc Fall 2006.
Rules, Movement, Ambiguity
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.
Natural Language - General
PARSING 2 David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
1 Context Free Grammars October Syntactic Grammaticality Doesn’t depend on Having heard the sentence before The sentence being true –I saw a unicorn.
CS621: Artificial Intelligence
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.
CS 4705 Lecture 7 Parsing with Context-Free Grammars.
CPSC 422, Lecture 27Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27 Nov, 16, 2015.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006-Lecture 2.
SYNTAX.
◦ Process of describing the structure of phrases and sentences Chapter 8 - Phrases and sentences: grammar1.
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 13: Deeper Adjective and PP Structure; Structural Ambiguity.
TYPES OF PHRASES REPRESENTING THE INTERNAL STRUCTURE OF PHRASES 12/5/2016.
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.
LING/C SC 581: Advanced Computational Linguistics Lecture Notes Feb 3 rd.
LING/C SC 581: Advanced Computational Linguistics Lecture Notes Feb 17 th.
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 11: Evidence for Deeper Structure; Top Down Parsing.
King Faisal University جامعة الملك فيصل Deanship of E-Learning and Distance Education عمادة التعلم الإلكتروني والتعليم عن بعد [ ] 1 King Faisal University.
Beginning Syntax Linda Thomas
Basic Parsing with Context Free Grammars Chapter 13
BBI 3212 ENGLISH SYNTAX AND MORPHOLOGY
CS : Speech, NLP and the Web/Topics in AI
Syntax.
CS 388: Natural Language Processing: Syntactic Parsing
Natural Language - General
David Kauchak CS159 – Spring 2019
Presentation transcript:

CS : Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Constituent Parsing and Algorithms (with major contributions from Dr. Rajat Mohanty)

Syntax Syntax is the study of the combination of words into phrases, clauses and sentences. Syntax describes how sentences and their constituents are structured.

Grammar A finite set of rules that generates only and all sentences of a language. that assigns an appropriate structural description to each one.

Grammatical Analysis Techniques Two main devices Morphological Categorial Functional Sequential Hierarchical Transformational Breaking up a String Labeling the Constituents

Hierarchical Breaking up and Categorial Labeling S VP VAdv ran away NP AN PoorJohn Poor John ran away.

Hierarchical Breaking up and Functional Labeling Immediate Constituent (IC) Analysis Construction types in terms of the function of the constituents: Predication (subject + predicate) Modification (modifier + head) Complementation(verbal + complement) Subordination (subordinator + dependent unit) Coordination (independent unit + coordinator)

S Head Modifier Inthemorning,theskylookedmuchbrighter SubordinatorDU PredicateSubject Head VerbalComplement Modifier In the morning, the sky looked much brighter. An Example

Noun Phrases John NP N student NP N the Det student NP N the Det intelligent AdjP John the student the intelligent student

Phrases

Noun Phrase five NP Quant his Det first Ord students N PhD N his first five PhD students

Noun Phrase five NP Quant the Det students N best AP of my class PP The five best students of my class

Verb Phrases sing VP V can Aux the ball VP NP can Aux hit V can sing can hit the ball

Verb Phrase a flower VP NP can Aux give V to Mary PP Can give a flower to Mary

Verb Phrase John VP NP may Aux make V the chairman NP may make John the chairman

Verb Phrase the book VP NP may Aux find V very interesting AP may find the book very interesting

Prepositional Phrases in the classroom the river PP NP near P the classroom PP NP in P near the river

Adjective Phrases intelligent AP A honest AP A very Degree of sweets AP PP fond A intelligent very honest fond of sweets

Adjective Phrase very worried that she might have done badly in the assignment that she might have done badly in the assignment AP S’ very Degree worried A

A segment of English Grammar S’  (C) S S  {NP/S’} VP VP  (AP+) V (AP+) ({NP/S’}) (AP+) (PP+) (AP+) NP  (D) (AP+) N (PP+) PP  P NP AP  (AP) A

PSG Parse Tree John wrote those words in the Book of Proverbs. S VP NP V PropN NP John wrote those words PP NP in P the book of proverbs NPPP

Penn Treebank (S (NP-SBJ (NP John)) (VP wrote (NP those words) (PP-LOC in (NP (NP-TTL (NP the Book) (PP of (NP Proverbs))) John wrote those words in the Book of Proverbs.

PSG Parse Tree Official trading in the shares will start in Paris on Nov 6. S VP NP N AP official PP trading willstart on Nov 6 A PP NP in P the shares NP PPVAux in Paris

Penn POS Tags [ Official/JJ trading/NN ] in/IN [ the/DT shares/NNS ] will/MD start/VB in/IN [ Paris/NNP ] on/IN [ Nov./NNP 6/CD ] Official trading in the shares will start in Paris on Nov 6.

Penn Treebank ( (S (NP-SBJ (NP Official trading) (PP in (NP the shares))) (VP will (VP start (PP-LOC in (NP Paris)) (PP-TMP on (NP (NP Nov 6) Official trading in the shares will start in Paris on Nov 6.

Penn POS Tag Sset Adjective: JJ Adverb: RB Cardinal Number: CD Determiner:DT Preposition: IN Coordinating ConjunctionCC Subordinating Conjunction: IN Singular Noun:NN Plural Noun:NNS Personal Pronoun:PP Proper Noun:NP Verb base form: VB Modal verb:MD Verb (3sg Pres):VBZ Wh-determiner:WDT Wh-pronoun:WP

Basic Parsing Strategy

A Fragment of English Grammar S  NP VP VP  V NP NP  NNP | ART N NNP  Ram V  ate | saw ART  a | an | the N  rice | apple | movie

Derivation S => NP VP (rewrite S) => NNP VP(rewrite NP) => Ram VP (rewrite NNP) => Ram V NP (rewrite VP) => Ram ate NP(rewrite V) => Ram ate ART N(rewrite NP) => Ram ate the N(rewrite ART) => Ram ate the rice (rewrite N) Multiple Choice Points S is a special symbol called start symbol.

Two Strategies : Top-Down & Bottom-Up Top down : Start with S and generate the sentence. Bottom up : Start with the words in the sentence and use the rewrite rules backwards to reduce the sequence of symbols to produce S. Previous slide showed top-down strategy.

Bottom-Up Derivation Ram ate the rice =>NNP ate the rice (rewrite Ram) =>NNP V the rice (rewrite ate) =>NNP V ART rice(rewrite the) =>NNP V ART N(rewrite rice) =>NP V ART N(rewrite NNP) =>NP V NP(rewrite ART N) =>NP VP(rewrite V NP) => S

Parsing Algorithm A procedure that “searches” through the grammatical rules to find a combination that generates a tree which stands for the structure of the sentence

Top-Down Parsing (using A*) DFS on the AND-OR graph Data structures: Open List (OL): Nodes to be expanded Closed List (CL): Expanded Nodes Input List (IL): Words of sentence to be parsed Moving Head (MH): Walks over the IL

Trace of Top-Down Parsing OL CL (empty) IL S Ram ate the rice Initial Condition (T 0 ) MH

Trace of Top-Down Parsing OL CL IL MH NP VP S Ram ate the rice T1:T1:

Trace of Top-Down Parsing OL CL IL MH NNP ART N VP S NP Ram ate the rice T2:T2:

Trace of Top-Down Parsing OL CL IL ART N VP S NP NNP Ram ate the rice T3:T3: MH(portion of Input consumed)

Trace of Top-Down Parsing OL CL IL N VP S NP NNP ART* Ram ate the rice T4:T4: MH (* indicates ‘useless’ expansion)

Trace of Top-Down Parsing OL CL IL VP S NP NNP ART* N* Ram ate the rice T5:T5: MH

Trace of Top-Down Parsing OL CL IL V NP S NP NNP ART* N* Ram ate the rice T6:T6: MH

Trace of Top-Down Parsing OL CL IL NP S NP NNP ART* N* V Ram ate the rice T7:T7: MH

Trace of Top-Down Parsing OL CL IL NNP ART N S NP NNP ART* N* V NP Ram ate the rice T8:T8: MH

Trace of Top-Down Parsing OL CL IL ART N S NP NNP ART* N* V NNP* Ram ate the rice T9:T9: MH

Trace of Top-Down Parsing OL CL IL N S NP NNP ART* N* V NNP ART Ram ate the rice T 10 : MH

Trace of Top-Down Parsing OL CL IL S NP NNP ART* N* V NNP ART N Ram ate the rice T 11 : MH Successful Termination: OL empty AND MH at the end of IL.

Bottom-Up Parsing Basic idea: Refer to words from the lexicon. Obtain all POSs for each word. Keep combining until S is obtained. (to be continued)