1 / 24

LING 388 Language and Computers

LING 388 Language and Computers. Take-Home Final Examination 12/9 /03 Sandiway FONG. Administrivia. Final Lecture Today: Topic Review Final Exam Review of questions Ask clarification questions! Class Survey Office Hours (TA):

toni
Download Presentation

LING 388 Language and Computers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. Administrivia • 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 email 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)

  4. Topics Covered • 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)

  5. Topics Covered • 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

  6. Topics Covered • 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)

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

  8. Topics Covered • 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

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

  10. Topics Covered • 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

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

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

  13. Final Examination

  14. Final Examination • 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)

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

  16. Question 2: On the Extension of Regular Grammars (5 pts) • L = { anbn | 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 • i.e. no calls to Prolog arithmetic in {…} permitted

  17. Question 2: On the Extension of Regular Grammars • 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

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

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

  20. Question 5: Grammar Rules (10 pts) • 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

  21. Question 5: Grammar 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

  22. Question 6: Prolog and Logic (6 pts) • Unification • (2 pts) What does the query • ?- a(X) =.. X. instantiate X to? Explain your answer. • 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.

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

  24. Class Survey

More Related