LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG.

Slides:



Advertisements
Similar presentations
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.
Advertisements

LING 364: Introduction to Formal Semantics Lecture 24 April 13th.
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/8.
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 364: Introduction to Formal Semantics Lecture 8 February 7th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 16: 10/19.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 8: 9/29.
LING 388: Language and Computers Sandiway Fong Lecture 9: 9/22.
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 388 Language and Computers Lecture 2 9/04/03 Sandiway FONG.
LING 364: Introduction to Formal Semantics Lecture 9 February 9th.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 9: 9/21.
C SC 620 Advanced Topics in Natural Language Processing Sandiway Fong.
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 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 388 Language and Computers Lecture 8 9/25/03 Sandiway FONG.
LING 388: Language and Computers Sandiway Fong Lecture 28: 12/6.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 22: 11/15.
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 4 9/11/03 Sandiway FONG.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 11: 10/3.
LING 388: Language and Computers Sandiway Fong Lecture 6: 9/13.
LING 388: Language and Computers Sandiway Fong Lecture 11: 10/3.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 6: 9/7.
LING 388: Language and Computers Sandiway Fong Lecture 28: 12/5.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.
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.
LING 388 Language and Computers Lecture 11 10/7/03 Sandiway FONG.
LING 388 Language and Computers Lecture 7 9/23/03 Sandiway FONG.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 5: 9/5.
LING 388: Language and Computers Sandiway Fong Lecture 1: 8/23.
LING 388 Language and Computers Lecture 9 9/30/03 Sandiway FONG.
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 6 9/18/03 Sandiway FONG.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
Context Free Grammars Reading: Chap 12-13, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Paul Tarau, based on Rada.
Introduction to CS Theory Lecture 1 – Introduction Piotr Faliszewski
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.
1 CPE 480 Natural Language Processing Lecture 5: Parser Asst. Prof. Nuttanart Facundes, Ph.D.
LING 388: Language and Computers Sandiway Fong Lecture 22: 11/10.
LING 388: Language and Computers Sandiway Fong Lecture 4.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
CST 229 Introduction to Grammars Dr. Sherry Yang Room 213 (503)
LING 388: Language and Computers Sandiway Fong Lecture 3.
LING 388: Language and Computers Sandiway Fong Lecture 30 12/8.
CS 390 Introduction to Theoretical Computer Science.
LING 388: Language and Computers Sandiway Fong Lecture 6.
LING 388: Language and Computers Sandiway Fong Lecture 18.
LING 388: Language and Computers Sandiway Fong Lecture 10.
Context Free Grammars Reading: Chap 9, Jurafsky & Martin This slide set was adapted from J. Martin, U. Colorado Instructor: Rada Mihalcea.
For Friday Finish chapter 23 Homework –Chapter 23, exercise 15.
LING/C SC/PSYC 438/538 Lecture 15 Sandiway Fong. Did you install SWI Prolog?
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong 1.
LING/C SC/PSYC 438/538 Lecture 18 Sandiway Fong. Adminstrivia Homework 7 out today – due Saturday by midnight.
LING/C SC/PSYC 438/538 Lecture 19 Sandiway Fong 1.
CSCI 2670 Introduction to Theory of Computing September 16, 2004.
LING/C SC/PSYC 438/538 Lecture 21 Sandiway Fong.
Presentation transcript:

LING 388 Language and Computers Take-Home Final Examination 12/9/03 Sandiway FONG

Administrivia Final Lecture Today: Final Lecture Today: 1. Topic Review 2. Final Exam  Review of questions  Ask clarification questions! 3. Class Survey  Office Hours (TA):  This Friday 11-12:15 pm in Social Science 224 (the computer lab)

Administrivia Final Examination Rules Final Examination Rules  Due exactly one week from today:  Noon Tuesday 16th  No late submissions will be accepted  Answers submitted must be your answers  TA (Charles) and instructor (me) available by and in person (as practical) to answer your questions about the final all week  Attempt as many questions as you can  46 pts on offer  You don’t have to answer all questions to receive full credit (30 pts)

Topics Covered Goals of the course: Goals of the course:  Introduction to computational linguistics  Ability to write grammars  Hands-on approach  Computer laboratory classes as well as regular lectures  Homeworks  Designed to be extensions of computer laboratory exercises  Final  Test your understanding of the lecture material and the homeworks (reviewed in class)

Topics Covered Prolog (using SWI-Prolog) Prolog (using SWI-Prolog)  Data Structures:  Atoms, variables, lists, structures  Programs:  Facts, program clauses  Execution:  Queries, unification, rules of inference  Non-determinism, negation  Built-ins:  =.., var/1, findall/3  Definite Clause Grammar (DCG) rules

Topics Covered Chomsky Hierarchy (Level 3) Chomsky Hierarchy (Level 3)  Regular expressions  Regular grammars  Right and left linear grammars  Finite State Automata (FSA)  Equivalence and limitations of the three frameworks  Finite State Transducers (FST)

Topics Covered Chomsky Hierarchy (Level 2) Chomsky Hierarchy (Level 2)  Context-free grammars  Combining right and left linear grammars  DCG implementation  Push-Down Automata (PDA)  Limitations of context-free grammars

Topics Covered Chomsky Hierarchy (Level 1) Chomsky Hierarchy (Level 1)  Context-sensitive grammars  DCG implementation Stopped here …  Did not go on to discuss Chomsky Hierarchy Level 0 aka General Rewrite Rule System

Topics Covered Natural Language Grammars Natural Language Grammars  Definite Clause Grammars (DCG)  Acceptors  Recovery of structure  Multiple parses  Idioms  Logical Form output  Feature propagation  Constituent agreement: local and distant

Topics Covered Natural Language Grammars: Advanced Topics Natural Language Grammars: Advanced Topics  Tree-Walking  Conditions on Representation: Filters  Universally Quantified Conditions  Implemented as negated existential conditions  Multiple Constraints Stopped here…  Tools necessary to implement constraints in linguistic theory

Topics Covered Shallow Parsing Shallow Parsing  Part-of-speech (POS) tagging  Transformation-Based Learning (Brill)  Stemming (Porter Stemmer)  Noun Compounding  Example of a difficult and unsolved problem

Topics Covered Stopped here… Stopped here…  Many other topics: statistical methods, ontologies, machine translation, document summarization, information retrieval, discourse processing … There are two advanced seminars offered next semester There are two advanced seminars offered next semester  If interested, talk to me for details

Final Examination

Contents: Contents:  1. Chomsky Hierarchy Level 3 (7 pts)  2. Extension of Regular Grammars (5 pts)  3. Chomsky Hierarchy Level 2 (7 pts)  4. Penetrable Idioms (5 pts)  5. Grammar Rules (10 pts)  6. Prolog and Logic (6 pts)  7. Porter Stemmer (6 pts)

Question 1: Chomsky Hierarchy Level 3(7pts) (A) (1 pt) (A) (1 pt)  Give a regular expression for the set:  {ab, abab, ababab, abababab, … } (B) (3 pts) (B) (3 pts)  Give the finite state automata for the set in part (A) (C) (3 pts) (C) (3 pts)  Write a regular grammar for the set in part (A)

Question 2: On the Extension of Regular Grammars (5 pts) L = { a n b n | n >= 1 } cannot be encoded by a regular grammar L = { a n b n | n >= 1 } cannot be encoded by a regular grammar  We know L can be encoded using regular grammar rules plus a counter  We know a counter can be implemented using calls to Prolog arithmetic and allowing non-terminals to take an argument Write a DCG for L using only regular grammar rules plus non-terminals that take an argument Write a DCG for L using only regular grammar rules plus non-terminals that take an argument  i.e. no calls to Prolog arithmetic in {…} permitted

Question 2: On the Extension of Regular Grammars Hint: Hint:  Consider the following encoding of natural numbers using the successor function s  1 = s(0)  2 = s(s(0))  3 = s(s(s(0))) and so on …  Use this encoding in your extra argument

Question 3: Chomsky Hierarchy Level 2 (7 pts) Consider the following set: Consider the following set:  { ww R | w  {a,b} + }  w is a string of non-zero length of a’s and b’s  w R = w in reverse string order, e.g. (abb) R = bba (A) (5 pts) (A) (5 pts)  Give a DCG grammar for ww R (B) (2 pts) (B) (2 pts)  Is ww R encodable using a regular grammar?  Explain your answer

Question 4: Penetrable Idioms(5 pts) DCG rules allow idiom chunk constituents to be encoded using one rule, e.g. kicked the bucket DCG rules allow idiom chunk constituents to be encoded using one rule, e.g. kicked the bucket However, some idioms are not completely frozen: However, some idioms are not completely frozen:  e.g.  take … advantage of NP John took some advantage of the offerJohn took some advantage of the offer John took full advantage of the offerJohn took full advantage of the offer John took good advantage of the offerJohn took good advantage of the offer John took little advantage of the offerJohn took little advantage of the offer *John took the/an advantage of the offer*John took the/an advantage of the offer Write a VP idiom DCG rule for take... advantage of Write a VP idiom DCG rule for take... advantage of

Question 5: Grammar Rules(10 pts) Verb Subcategorization Verb Subcategorization  Give and donate are double object verbs  John gave [ NP Mary] [ NP a book]  John gave [ NP a book] [ PP to Mary]  *John donated [ NP Mary] [ NP a book]  John donated [ NP a book] [ PP to Mary]  Write a DCG parser for these examples  Show the actual output of your program for these examples along with the whole DCG,  i.e. use copy and paste from your Prolog system

Question 5: Grammar Rules Hint: Modify the following acceptor rules Hint: Modify the following acceptor rules  vp --> v, np, pp.  vp --> v, np, np.  pp --> p, np.  v --> [give].  v --> [donate].  Make sure your program returns the syntactic structure

Question 6: Prolog and Logic(6 pts) Unification Unification  (2 pts) What does the query  ?- a(X) =.. X. instantiate X to? Explain your answer. Negation Negation  Suppose we have the following facts:  b(1). b(2). b(3).  (1 pt) What does ?- b(X). return?  (1 pt) What does ?- \+ b(X). return?  (2 pts) What does ?- \+ \+ b(X). return? Explain your answer.

Question 7: Porter Stemmer (6 pts) What does the Porter Stemmer output for the following words: What does the Porter Stemmer output for the following words:  (2 pts) Availability  (2 pts) Shipping  (2pts) Unbelievable Show the steps in your answer Show the steps in your answer

Class Survey