LING 388: Language and Computers Sandiway Fong Lecture 13.

Slides:



Advertisements
Similar presentations
LING 581: Advanced Computational Linguistics Lecture Notes January 30th.
Advertisements

LING 388: Language and Computers
Review of Homework 4 November 20, Exercise 1 (A) 1 pt Modify the DCG to accept the omission of the complementizer that for object relative clauses.
LING/C SC/PSYC 438/538 Lecture 22 Sandiway Fong 1.
LING 388: Language and Computers Sandiway Fong Lecture 2.
Statistical NLP: Lecture 3
Fall 2008Programming Development Techniques 1 Topic 9 Symbol Manipulation Generating English Sentences Section This is an additional example to symbolic.
Natural Language Processing DCG and Syntax NLP DCG A “translation” example: special case A DCG recogniser.
LING 388: Language and Computers Sandiway Fong Lecture 15.
LING 364: Introduction to Formal Semantics Lecture 8 February 7th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
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 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING 388: Language and Computers Sandiway Fong Lecture 14: 10/13.
LING 364: Introduction to Formal Semantics Lecture 11 February 16th.
1 Introduction to Computational Linguistics Eleni Miltsakaki AUTH Fall 2005-Lecture 2.
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.
Computational Intelligence 696i Language Lecture 4 Sandiway Fong.
LING 364: Introduction to Formal Semantics Lecture 13 February 23rd.
LING 388 Language and Computers Lecture 13 10/14/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/24.
LING 364: Introduction to Formal Semantics Lecture 5 January 26th.
LING 388 Language and Computers Lecture 17 10/28/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 13: 10/10.
LING 388 Language and Computers Lecture 12 10/9/03 Sandiway FONG.
Phrase Structure The formal means of representing constituency.
LING 388: Language and Computers Sandiway Fong Lecture 8.
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 14 10/11.
LING 388: Language and Computers Sandiway Fong Lecture 17.
LING 388: Language and Computers Sandiway Fong Lecture 7.
Syntax I: Constituents and Structure Gareth Price – Duke University.
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.
Today Phrase structure rules, trees Constituents Recursion Conjunction
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong. Administrivia 538 Presentations – Send me your choices if you haven’t already Thanksgiving Holiday –
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.
Syntax Why is the structure of language (syntax) important? How do we represent syntax? What does an example grammar for English look like? What strategies.
LING 388: Language and Computers Sandiway Fong Lecture 12.
Rules, Movement, Ambiguity
The man bites the dog man bites the dog bites the dog the dog dog Parse Tree NP A N the man bites the dog V N NP S VP A 1. Sentence  noun-phrase verb-phrase.
CSA2050 Introduction to Computational Linguistics Parsing I.
Natural Language Processing
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.
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.
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 =
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Syntax II. Specifiers Specifiers tell us more information about nouns, verbs, adjectives, adverbs and prepositions The, a, this, three, some, many etc.
Week 3. Clauses and Trees English Syntax. Trees and constituency A sentence has a hierarchical structure Constituents can have constituents of their own.
SYNTAX.
LING/C SC/PSYC 438/538 Lecture 23 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 21 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.
Presentation transcript:

LING 388: Language and Computers Sandiway Fong Lecture 13

Administrivia Another Homework on recursion – Homework 5 – due next Wednesday by midnight…

Left to Right Recursive Transformation 1.np --> np, pp. 2.np --> det, nn. x --> [z], v. v --> [y], v. v --> [y]. x --> [z]. x(x(z,V)) --> [z], v(V). v(v(y,V)) --> [y], v(V). v(v(y)) --> [y]. x(x(z)) --> [z]. np --> det, nn, v. v --> pp, v. v --> pp. np --> det, nn. np(np(D,N,V)) --> det(D), nn(N), v(V). v(v(PP,V)) --> pp(PP), v(V). v(v(PP)) --> pp(PP). np(np(D,NN)) --> det(D), nn(NN).

Last Time We developed the following rules: 1.sentence(s(X,Y)) --> np(X), vp(Y). 2.pp(pp(X,Y)) --> in(X), np(Y). 3.np(np(X)) --> prp(X). 4.np(np(nnp(mary))) --> [mary]. 5.np(np(nnp(john))) --> [john]. 6.np(np(nnp(bill))) --> [bill]. 7.np(np(D,NN)) --> det(D), nn(NN). 8.np(np(D,NN,V)) --> det(D), nn(NN), v(V). 9.v(v(PP,V)) --> pp(PP), v(V). 10.v(v(PP)) --> pp(PP). 11.v2(v2(PP,V2)) --> pp(PP), v2(V2). 12.v2(v2(PP)) --> pp(PP). 13.vp(vp(V,NP,V2)) --> verb(V), np(NP), v2(V2). 14.vp(vp(V,X)) --> verb(V), np(X). 15.vp(vp(V,X)) --> verb(V), sbar(X). 16.sbar(sbar(X,S)) --> c(X), sentence(S). 17.c(in(that)) --> [that]. 18.in(in(with)) --> [with]. 19.a(jj(big)) --> [big]. 20.a(jj(shiny)) --> [shiny]. 21.a(jj(red)) --> [red]. 22.prp(prp(i)) --> [i]. 23.prp(prp(me)) --> [me]. 24.nn(nn(boy)) --> [boy]. 25.nn(nn(limp)) --> [limp]. 26.nn(nn(telescope)) --> [telescope]. 27.nn(nn(bus)) --> [bus]. 28.nn(nn(A,NN)) --> a(A), nn(NN). 29.verb(vbd(noticed)) --> [noticed]. 30.verb(vbd(saw)) --> [saw]. 31.det(dt(the)) --> [the]. 32.det(dt(a)) --> [a]. Left recursive np  np, pp and vp  vp, pp adjunction rules transformed into right recursive rules involving v and v2, respectively grammar-transformed.pl

Last Time 1.sentence(s(X,Y)) --> np(X), vp(Y). 2.pp(pp(X,Y)) --> in(X), np(Y). 3.np(np(X)) --> prp(X). 4.np(np(nnp(mary))) --> [mary]. 5.np(np(nnp(john))) --> [john]. 6.np(np(nnp(bill))) --> [bill]. 7.np(np(D,NN)) --> det(D), nn(NN). 8.np(np(np(X,Y),Z)) --> det(X), nn(Y), pp(Z). 9.vp(vp(V,X)) --> verb(V), np(X). 10.vp(vp(V,NP,PP)) --> verb(V), np(NP), pp(PP). 11.vp(vp(V,X)) --> verb(V), sbar(X). 12.sbar(sbar(X,S)) --> c(X), sentence(S). 13.c(in(that)) --> [that]. 14.in(in(with)) --> [with]. 15.a(jj(big)) --> [big]. 16.a(jj(shiny)) --> [shiny]. 17.a(jj(red)) --> [red]. 18.prp(prp(i)) --> [i]. 19.prp(prp(me)) --> [me]. 20.nn(nn(boy)) --> [boy]. 21.nn(nn(limp)) --> [limp]. 22.nn(nn(telescope)) --> [telescope]. 23.nn(nn(bus)) --> [bus]. 24.nn(nn(A,NN)) --> a(A), nn(NN). 25.verb(vbd(noticed)) --> [noticed]. 26.verb(vbd(saw)) --> [saw]. 27.det(dt(the)) --> [the]. 28.det(dt(a)) --> [a]. Quick Fix grammar grammar-quickfix.pl

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?

Last Time Modification RelationsQuick FixPP adjunction to NP/PP telescope  boy, limp  boy telescope  see, limp  see telescope  boy, limp  see telescope  see, limp  telescope telescope  boy, limp  telescope Example: I saw the boy with a telescope with a limp

Left to Right Recursive Transformation Structures are right branching They have extra v and v2 nodes

Step 5 Step 5: – in step 4, we obtained a right recursive parse – Modify your natural language grammar to produce a left recursive parse following the template on the right… – Test your grammar Example: – x(x(z,V)) --> [z], v(V). – v(v(y,V)) --> [y], v(V). – v(v(v)) --> [y]. – x(x(z)) --> [z]. Modified grammar:

Homework 5 Regular sentence: – the rat ate the cheese Object relative clause construction: – object of the sentence is missing – "moves" to become a new head noun – the cheese (that) the rat ate – [ NP [ NP the cheese] [ SBAR [ S [ NP the rat][ VP [ VBD ate] ____ ]]]]

Homework 5 Subject relative clause construction: – subject "moves" to become a new head noun – the rat that ate the cheese – [ NP [ NP the rat] [ SBAR that [ S ____ [ VP [ VBD ate] [ NP the cheese]]]]]

Homework 5 Implement another kind of recursion: – Object relative clauses the cat that saw the rat that saw the cheese that … [ NP the cat [ SBAR that [ S saw [ NP the rat [ SBAR that [ S saw [ NP the cheese that … ]]]]]]] the cheese that the rat ate the cheese that the rat that the cat saw ate the cheese that the rat that the cat that the dog chased saw ate

Homework 5 Other kinds of recursion, e.g. – Object relative clauses the cheese that the rat ate

Homework 5 Other kinds of recursion, e.g. – Object relative clauses the cheese that the rat that the cat saw ate

Homework 5 the cheese that the rat that the cat saw ate was rotten.

Homework 5 the cheese that the rat that the cat that the dog chased saw ate was rotten.

Homework 5 Use grammar.pl as the starting point Submit your revised grammar. Submit your runs