LING/C SC/PSYC 438/538 Lecture 24 Sandiway Fong.

Slides:



Advertisements
Similar presentations
LING 388: Language and Computers
Advertisements

Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
LING 388: Language and Computers Sandiway Fong Lecture 2.
Natural Language Processing DCG and Syntax NLP DCG A “translation” example: special case A DCG recogniser.
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/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 Sandiway Fong Lecture 20: 11/2.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/25.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 6: 9/6.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/24.
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.
11/22/1999 JHU CS /Jan Hajic 1 Introduction to Natural Language Processing ( ) Shift-Reduce Parsing in Detail Dr. Jan Hajič CS Dept., Johns.
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.
LING 388: Language and Computers Sandiway Fong Lecture 15 10/13.
LING 388: Language and Computers Sandiway Fong Lecture 18.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
LING 388: Language and Computers Sandiway Fong Lecture 13.
11 Chapter 14 Part 1 Statistical Parsing Based on slides by Ray Mooney.
October 2008CSA3180: Sentence Parsing1 CSA3180: NLP Algorithms Sentence Parsing Algorithms 2 Problems with DFTD Parser.
LING 388: Language and Computers Sandiway Fong Lecture 12.
Rules, Movement, Ambiguity
CSA2050 Introduction to Computational Linguistics Parsing I.
LING 388: Language and Computers Sandiway Fong Lecture 21.
CPSC 422, Lecture 27Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27 Nov, 16, 2015.
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong 1.
LING 388: Language and Computers Sandiway Fong Lecture 16.
Handling Unlike Coordinated Phrases in TAG by Mixing Syntactic Category and Grammatical Function Carlos A. Prolo Faculdade de Informática – PUCRS CELSUL,
LING/C SC/PSYC 438/538 Lecture 18 Sandiway Fong. Adminstrivia Homework 7 out today – due Saturday by midnight.
CS460/IT632 Natural Language Processing/Language Technology for the Web Lecture 13 (17/02/06) Prof. Pushpak Bhattacharyya IIT Bombay Top-Down Bottom-Up.
November 2009HLT: Sentence Parsing1 HLT Sentence Parsing Algorithms 2 Problems with Depth First Top Down Parsing.
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.
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.
Natural Language Processing Vasile Rus
Statistical NLP Winter 2009
Statistical NLP: Lecture 3
Basic Parsing with Context Free Grammars Chapter 13
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27
LING/C SC/PSYC 438/538 Lecture 23 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 5 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.
Probabilistic and Lexicalized Parsing
CSCI 5832 Natural Language Processing
CS 388: Natural Language Processing: Syntactic Parsing
TREE ADJOINING GRAMMAR
LING/C SC 581: Advanced Computational Linguistics
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
Probabilistic and Lexicalized Parsing
Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27
Parsing and More Parsing
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 22 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 25 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong.
Linguistic Essentials
LING/C SC/PSYC 438/538 Lecture 13 Sandiway Fong.
CSA2050 Introduction to Computational Linguistics
David Kauchak CS159 – Spring 2019
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
LING/C SC 581: Advanced Computational Linguistics
Presentation transcript:

LING/C SC/PSYC 438/538 Lecture 24 Sandiway Fong

Today's Topics Homework 11 Review (Reminder: Homework 12 due tomorrow night) Agreement example Dealing with left recursion by grammar transformation

Homework 11 Review Question 1: write a Prolog CFG for the following sentences: John ate (sensibly) (intransitive eat) I fish (intransitive fish) I ate fish (transitive eat) Bill ate rice Harry ate roast beef Note: you can use lowercase names… (or quotes, e.g. 'John') Note: use Penn Treebank tagset for words (see inside the cover of your textbook) nnp(prp(i)) --> [i]. nnp(nnp(john)) --> [john]. vbd(vbd(ate)) --> [ate].

Homework 11 Review Question 2: expand your grammar to handle these sentences: I ate fish, and Bill ate rice *I ate fish, Bill ate rice I ate fish, Bill ate rice, and Harry ate roast beef Note: the comma can be a quoted terminal, e.g. [','] comma(comma(',')) --> [',']. ','(','(',')) --> [',']. Note: be careful of left recursion on S List: (i) S; (ii) S, and S; (iii) S, S, and S (Stanford Parser)

Subject Verb Agreement We need feature percolation: Form Ending Comment eat uninflected not 3rd person singular eats -s 3rd person singular ate -ed past eaten -en past participle eating -ing gerund Subject and VP come together at this rule Person Number Ending POS tags eats *eat Person Number Ending

Subject Verb Agreement Implementation: using POS tags Constraint table: % table of Person Number Tag possible combinations table(3,pl,vb). table(3,pl,vbd). table(3,sg,vbz). table(3,sg,vbd). Person, Number from Subject NP POS tag from verb

Left recursion and Prolog Left recursive grammars: we know from an earlier lecture that left recursive rules are a no-no given Prolog’s left-to-right depth- first computation rule… s a ... Example: s --> a, [!]. a --> ba, [a]. a --> a, [a]. ba --> b, [a]. b --> [b]. ?- s([b,a,!],[]). ERROR: Out of local stack

Preposition Phrase (PP) Attachment The preferred syntactic analysis is a left recursive parse Examples: John saw the boy with a telescope (structural ambiguity: automatically handled by Prolog) withinstrument withpossessive

Preposition Phrase (PP) Attachment The preferred syntactic analysis is a left recursive parse Can “stack” the PPs: John saw the boy with a limp with Mary with a telescope ambiguity: withpossessive , withaccompaniment, withinstrument

Preposition Phrase Attachment Linguistically: PP (recursively) adjoins to NP or VP np(np(NP,PP)) --> np(NP), pp(PP). vp(vp(VP,PP)) --> vp(VP), pp(PP). Left recursion gives Prolog problems Derivation (top-down, left-to-right): vp vp pp vp pp pp vp pp pp pp vp pp pp pp pp infinite loop… Note: other extra arguments not shown here …

Transformation Apply the general transformation: to NP and VP rules: np(np(DT,NN)) --> dt(DT,Number), nn(NN,Number). np(np(NP,PP)) --> np(NP), pp(PP). vp(vp(VBD,NP)) --> vbd(VBD), np(NP). vp(vp(VP,PP)) --> vp(VP), pp(PP). Note: w is a fresh non-terminal that takes 2 arguments x(X) --> [z], w(X,x(z)). x(x(z)) --> [z]. w(W,X) --> [y], w(W,x(X,y)). w(x(X,y),X) --> [y]. x(x(X,y)) --> x(X), [y]. x(x(z)) --> [z]. [z] [y] x x x is the recursive nonterminal [z] [y] x x Let's write some code!