LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.

Slides:



Advertisements
Similar presentations
Prolog programming....Dr.Yasser Nada. Chapter 8 Parsing in Prolog Taif University Fall 2010 Dr. Yasser Ahmed nada prolog programming....Dr.Yasser Nada.
Advertisements

LING 388: Language and Computers
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 5: 9/5.
Grammars, Languages and Parse Trees. Language Let V be an alphabet or vocabulary V* is set of all strings over V A language L is a subset of V*, i.e.,
LING 388: Language and Computers Sandiway Fong Lecture 2.
LING 388: Language and Computers Sandiway Fong Lecture 16: 10/20.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 7: 9/12.
LING/C SC/PSYC 438/538 Computational Linguistics Sandiway Fong Lecture 10: 9/27.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/21.
LING 388: Language and Computers Sandiway Fong Lecture 15: 10/17.
LING 388: Language and Computers Sandiway Fong Lecture 21: 11/7.
LING 388: Language and Computers Sandiway Fong Lecture 12: 10/5.
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 388: Language and Computers Sandiway Fong Lecture 28: 12/6.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 22: 11/15.
LING 388: Language and Computers Sandiway Fong Lecture 20: 11/2.
LING 364: Introduction to Formal Semantics Lecture 4 January 24th.
LING 388: Language and Computers Sandiway Fong Lecture 14: 10/13.
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 Lecture 10 10/2/03 Sandiway FONG.
LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 28: 12/5.
LING 388 Language and Computers Lecture 18 10/30/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/25.
LING 388: Language and Computers Sandiway Fong Lecture 16: 10/19.
LING 388 Language and Computers Lecture 13 10/14/03 Sandiway FONG.
Stochastic POS tagging Stochastic taggers choose tags that result in the highest probability: P(word | tag) * P(tag | previous n tags) Stochastic taggers.
LING 388: Language and Computers Sandiway Fong Lecture 17: 10/24.
LING 388 Language and Computers Lecture 12 10/9/03 Sandiway FONG.
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 14 10/11.
LING 388: Language and Computers Sandiway Fong Lecture 17.
LING 388: Language and Computers Sandiway Fong Lecture 27.
LING 388: Language and Computers Sandiway Fong Lecture 7.
LING/C SC/PSYC 438/538 Lecture 14 Sandiway Fong. Administrivia Midterm – This Wednesday – A bit like doing a homework in real time – Bring your laptop.
LING 388: Language and Computers Sandiway Fong Lecture 15 10/13.
LING 388: Language and Computers Sandiway Fong Lecture 3.
LING 388: Language and Computers Sandiway Fong Lecture 30 12/8.
LING 388: Language and Computers Sandiway Fong Lecture 18.
LING 388: Language and Computers Sandiway Fong Lecture 10.
LING/C SC/PSYC 438/538 Lecture 26 Sandiway Fong. Administrivia 538 Presentations – Send me your choices if you haven’t already Thanksgiving Holiday –
LING 388: Language and Computers Sandiway Fong Lecture 12.
LING 388: Language and Computers Sandiway Fong Lecture 11: 10/4.
Rules, Movement, Ambiguity
CSA2050 Introduction to Computational Linguistics Parsing I.
LING/C SC/PSYC 438/538 Lecture 13 Sandiway Fong. Administrivia Reading Homework – Chapter 3 of JM: Words and Transducers.
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.
LING 388: Language and Computers Sandiway Fong Lecture 20.
LING/C SC/PSYC 438/538 Lecture 10 Sandiway Fong. Today's Topics A note on the UIUC POS Tagger Fun with POS Tagging Perl regex wrap-up.
LING/C SC 581: Advanced Computational Linguistics Lecture Notes Feb 3 rd.
LING/C SC/PSYC 438/538 Lecture 17 Sandiway Fong. Last Time Talked about: – 1. Declarative (logical) reading of grammar rules – 2. Prolog query: s(String,[]).
LING/C SC/PSYC 438/538 Lecture 23 Sandiway Fong.
Part I: Basics and Constituency
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong.
CS 388: Natural Language Processing: Syntactic Parsing
LING/C SC/PSYC 438/538 Lecture 3 Sandiway Fong.
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 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/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1

Administrivia Veterans Day is November 11th – No class Wednesday

Today's Topics 538 Presentations Homework 7 review – Grammar programming Writing natural language grammars – "learn by doing" – a worked example

538 Presentations From lecture 1 syllabus – 438 homeworks: 100% – 538 homeworks: 75% (sub-)chapter presentation: 25% If you are currently taking 438, and you plan to do the HLT Master's Program consider volunteering to do the presentation

538 Presentations 538 presentations We can’t cover as many topics as we’d like this semester next semester this course continues as 581 Select a topic from some sections from the textbook – not a full chapter – don’t pick something too big or too small … Range: chapter 14 through 25 – you can’t pick the same thing as your classmate – First come, first served basis

538 Presentations Your job: present the selected topic in class produce slides you’ll be evaluated on the quality of the presentation – don’t just simply copy the textbook! – important: you'll be evaluated on how well you communicate the essential ideas employed – communicate your understanding of the tradeoffs and limitations etc. be prepared to take questions from me and your fellow classmates

538 Presentations Scheduling – Topic selection: begins now – Talk length: 10 mins – first come, first served basis – me your 1 st, 2 nd and 3 rd choices – me your 1 st and 2 nd choice of presentation dates: December 7 th and 9 th

Homework 7 Review

Question 1: – Give a regular DCG grammar for the language with strings containing: an odd number of a's and an even number of b's (even: 0,2,4,…) assume alphabet is {a,b} – Examples: aaa, abb, babaabb *aab, *ab, *ε – Show your grammar working, i.e. it accepts and rejects positive and negative examples, respectively. – Allow rules of the form: x --> [].

Homework 7 Review Central idea: – you don't need to do (unbounded) counting! – think of states even odd > a a Apply this to both a's and b's

Homework 7 Review Example grammar:

Homework 7 Review Question 2: – Order your grammar rules so it enumerates strings in the language. – Show it working. – Is your grammar capable of enumerating all the strings of the language? Explain why or why not.

Homework 7 Review Enumeration:

Homework 7 Review Question 3: – (a) Determine how many strings of size 3 are in the language? List them. – (b) Compute how many strings of size < 10 are there in the language. – Examples: [b,b,a] is of size 3 [a, a, a, b, b, b, b] is of size 7

Homework 7 Review Question 3: – (a) Determine how many strings of size 3 are in the language? List them.

Homework 7 Review Question 3: (b) Compute how many strings of size < 10 are there in the language. SizeNumber Total: 341

Phrase Structure Grammars Let's write a phrase structure grammar (PSG) using Prolog Mechanisms: 1.Extra argument for Prolog term representation of a parse 2.Extra arguments for feature value agreement 3.Dealing with left recursive rules: grammar transformation (Next time)

Topics Mechanisms: 1.Extra argument for Prolog term representation of a parse 2.Extra arguments for feature value agreement 3.Dealing with left recursive rules: grammar transformation

Parse Let's write a simple grammar returning appropriate parse trees for sentences like: – John kicked the ball – the men kicked the ball – a man kicked the ball Stanford Parser: –(ROOT – (S – (NP (DT the) (NNS men)) – (VP (VBD kicked) – (NP (DT the) (NN ball)))))

Topics Mechanisms: 1.Extra argument for Prolog term representation of a parse 2.Extra arguments for feature value agreement 3.Dealing with left recursive rules: grammar transformation

Extra Arguments: Agreement Idea: – We can also use an extra argument to impose constraints between constituents within a DCG rule Example: – English determiner-noun number agreement – Data: the man the men a man *a men – Lexical Features: man singular men plural 21

Extra Arguments: Agreement Data: – the man/men – a man/*a men Grammar: (NP section) np(np(Y)) --> pronoun(Y). np(np(D,N)) --> det(D,Number), common_noun(N,Number). det(det(the),sg) --> [the]. det(det(the),pl) --> [the]. det(det(a),sg) --> [a]. common_noun(n(ball),sg) --> [ball]. common_noun(n(man),sg) --> [man]. common_noun(n(men),pl) --> [men]. pronoun(i) --> [i]. pronoun(we) --> [we]. –Idea: give determiners a number feature as well and make it agree with the noun Rules the can combine with singular or plural nouns a can combine only with singular nouns 22

Extra Arguments: Agreement Simplifying the grammar: det(det(the),sg) --> [the]. det(det(the),pl) --> [the]. det(det(a),sg) --> [a]. Grammar is ambiguous: – two rules for determiner the Agreement Rule (revisited): the can combine with singular or plural nouns i.e. the doesn’t care about the number of the noun DCG Rule: np(np(D,N)) --> det(D,Number), common_noun(N,Number). det(det(the),_) --> [the]. Note: _ is a variable used underscore character because we don’t care about the value of the variable 23

Extra Arguments: Agreement Note: Use of the extra argument for agreement here is basically “syntactic sugar” and lends no more expressive power to the grammar rule system i.e. we can enforce the agreement without the use of the extra argument at the cost of more rules Note: Use of the extra argument for agreement here is basically “syntactic sugar” and lends no more expressive power to the grammar rule system i.e. we can enforce the agreement without the use of the extra argument at the cost of more rules Instead of np(np(D,N)) --> det(D,Number), common_noun(N,Number). we could have written: np(np(D,N)) --> detsg(D), common_nounsg(N). np(np(D,N)) --> detpl(D), common_nounpl(N). detsg(det(a)) --> [a]. detsg(det(the)) --> [the]. detpl(det(the)) --> [the]. common_nounsg(n(ball)) --> [ball]. common_nounsg(n(man)) -->[man]. common_nounpl(n(men)) --> [men]. 24

Extra Arguments: Agreement English exhibits subject- verb agreement Examples: – John kicked the ball – The men kicked the ball – John kicks the balls – The men *kicks/kick the ball Constraint: 1.-s form of the verb is compatible with 3rd person singular only for the subject NP 2.uninflected form is not compatible with 3 rd person singular for the subject NP

Subject Verb Agreement We need feature percolation: eats *eat FormEndingComment eat uninflectednot 3 rd person singular eats-s3 rd person singular ate-edpast eaten-enpast participle eating-inggerund Person Number Person Number Ending Subject and VP come together at this rule Person Number Person Number Ending POS tags

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