LING 388: Language and Computers Sandiway Fong Lecture 12.

Slides:



Advertisements
Similar presentations
LING 388: Language and Computers
Advertisements

Syntactic analysis using Context Free Grammars. Analysis of language Morphological analysis – Chairs, Part Of Speech (POS) tagging – The/DT man/NN left/VBD.
LING 388: Language and Computers Sandiway Fong Lecture 2.
LING 388: Language and Computers Sandiway Fong Lecture 15.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING 364: Introduction to Formal Semantics Lecture 10 February 14th.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 388 Language and Computers Lecture 19 11/04/03 Sandiway FONG.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/21.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 8: 9/18.
LING 388 Language and Computers Lecture 14 10/16/03 Sandiway FONG.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/11.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 22: 11/15.
LING 388 Language and Computers Lecture 10 10/2/03 Sandiway FONG.
LING 388 Language and Computers Lecture 20 11/6/03 Sandiway FONG.
LING 388 Language and Computers Lecture 18 10/30/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/25.
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.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
LING 388 Language and Computers Lecture 12 10/9/03 Sandiway FONG.
LING 388 Language and Computers Lecture 15 10/21/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 8.
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.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
LING 388: Language and Computers Sandiway Fong Lecture 11.
LING 388: Language and Computers Sandiway Fong Lecture 17.
LING 388: Language and Computers Sandiway Fong Lecture 7.
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.
LING 388: Language and Computers Sandiway Fong Lecture 3.
GRAMMARS David Kauchak CS159 – Fall 2014 some slides adapted from Ray Mooney.
LING 388: Language and Computers Sandiway Fong Lecture 18.
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.
LING 388: Language and Computers Sandiway Fong Lecture 10.
LING 388: Language and Computers Sandiway Fong Lecture 19.
PARSING David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
LING 388: Language and Computers Sandiway Fong Lecture 13.
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.
Parsing with Context-Free Grammars for ASR Julia Hirschberg CS 4706 Slides with contributions from Owen Rambow, Kathy McKeown, Dan Jurafsky and James Martin.
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.
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.
PARSING 2 David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
LING 388: Language and Computers Sandiway Fong Lecture 21.
SYNTAX.
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong 1.
LING 388: Language and Computers Sandiway Fong Lecture 16.
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 13: Deeper Adjective and PP Structure; Structural Ambiguity.
LING/C SC/PSYC 438/538 Lecture 18 Sandiway Fong. Adminstrivia Homework 7 out today – due Saturday by midnight.
1 Chapter 4 Syntax Part III. 2 The infinity of language pp The number of sentences in a language is infinite. 2. The length of sentences is.
CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 13 (17/02/06) Prof. Pushpak Bhattacharyya IIT Bombay Top-Down Bottom-Up.
LING 388: Language and Computers Sandiway Fong Lecture 20.
CS : Speech, NLP and the Web/Topics in AI Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture-15: Probabilistic parsing; PCFG (contd.)
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
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 17 th.
LING/C SC/PSYC 438/538 Lecture 23 Sandiway Fong.
CS : Speech, NLP and the Web/Topics in AI
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong.
LING/C SC 581: Advanced Computational Linguistics
LING/C SC/PSYC 438/538 Lecture 23 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 24 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 25 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong.
David Kauchak CS159 – Spring 2019
Presentation transcript:

LING 388: Language and Computers Sandiway Fong Lecture 12

Adminstrivia Review: – Homework 4 on Recursion – Continue on with the left to right recursion grammar transformation: Last Time: abstract grammar fragment Today: PP adjunction to NP and VP

Homework 4 Review Recursion type 1: – we can stack adjectives… – the bus – the big bus – the big red bus – the shiny big red bus – (cf. the big shiny red bus) Recursive rule: – right recursive rule – nn --> a, nn.

Homework 4 Review Start with grammar.pl from the course webpage: nn(nn(A,NN)) --> a(A), nn(NN). a(jj(big)) --> [big]. a(jj(shiny)) --> [shiny]. a(jj(red)) --> [red]. nn(nn(bus)) --> [bus]. sentence(s(X,Y)) --> np(X), vp(Y). pp(pp(X,Y)) --> in(X), np(Y). in(in(with)) --> [with]. np(np(X)) --> prp(X). np(np(np(X,Y),Z)) --> det(X), nn(Y), pp(Z). np(np(D,NN)) --> det(D), nn(NN). prp(prp(i)) --> [i]. prp(prp(me)) --> [me]. nn(nn(boy)) --> [boy]. nn(nn(telescope)) --> [telescope]. vp(vp(V,X)) --> verb(V), np(X). vp(vp(V,X,Y)) --> verb(V), np(X), pp(Y). verb(vbd(saw)) --> [saw]. det(dt(the)) --> [the]. det(dt(a)) --> [a].

Homework 4 Review Tree representation:

Homework 4 Review Tree representation:

Homework 4 Review Tree representation:

Homework 4 Review Tree representation:

Homework 4 review Recursion is a property of natural language – simple iteration: … big shiny red bus Another kind of recursion – Some verbs can select for clauses (as well as object NPs), e.g. notice I noticed that John noticed that Mary noticed the big red bus [ S I noticed [ SBAR that [ S John noticed [ SBAR that [ S Mary noticed the big red bus]]]]] Idea : some verbs can select for sentences introduced by the complementizer that

Homework 4 review Example: – Mary noticed the big red bus 1.verb(vbd(noticed)) --> [noticed]. 2.np(np(X)) --> proper_noun(X). 3.proper_noun(nnp(mary)) --> [mary].

Homework 4 review Example: – John noticed that Mary noticed the big red bus 1.vp(vp(V,SBAR)) --> verb(V), sbar(SBAR). 2.sbar(sbar(C,S)) --> c(C), sentence(S). 3.c(c(that)) --> [that]. 4.proper_noun(nnp(john)) --> [john]. (IN that)

Homework 4 review Example: – I noticed that John noticed that Mary noticed the big red bus

Homework 4 review Example: – I noticed that John noticed that Mary noticed the big red bus

Today’s Topic Exercise: – Convert left recursive natural language grammar rules into right recursive grammar rules

Step 1 Recipe: 1.Let x be the nonterminal with the left recursion. 2.Let z be the terminal (or nonterminal) sequence that x also expands to 3.Let y be the terminal (and/or nonterminal) sequence after the left recursive call Abstract example from last time: – x --> x, [y]. – x --> [z].

Step 1 Part 1: – identify x, y, and z in the following rules: 1.np --> dt, nn. 2.np --> np, pp. – identify x, y, and z in the following rules: 3.vp --> vbd, np. 4.vp --> vp, pp. x --> x, [y]. x --> [z].

Step 2 Transformation: – x --> x, [y]. – x --> [z]. into – x --> [z], v. – v --> [y], v. – v --> [y]. – x --> [z]. Step 2: – apply transformation to: – np --> dt, nn. – np --> np, pp. also to: – vp --> vbd, np. – vp --> vp, pp.

Step 3 Step 3: – modify the grammar fragments from step 2 into grammars that compute parse trees – test your grammar fragments on VPs like saw a boy with a telescope –vp(Parse,[saw, a, boy, with, a, telescope], []). Abstract example: – x --> [z], v. – v --> [y], v. – v --> [y]. – x --> [z]. modified version: – x(x(z,V)) --> [z], v(V). – v(v(y,V)) --> [y], v(V). – v(v(y)) --> [y]. – x(x(z)) --> [z].

Comparison “Quick Fix” grammar from last time: Result:

Step 4 Step 4: – Compare the transformed grammar parses with those obtained using the “Quick Fix” grammar on the NP a boy with a telescope with a limp number of parses? attachment of the PPs?