Presentation is loading. Please wait.

Presentation is loading. Please wait.

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 1 LTI Grammars and Lexicons Grammar Writing Lecture.

Similar presentations


Presentation on theme: "Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 1 LTI Grammars and Lexicons Grammar Writing Lecture."— Presentation transcript:

1 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 1 LTI Grammars and Lexicons Grammar Writing Lecture 7 11-721 Grammars and Lexicons Teruko Mitamura teruko@cs.cmu.edu www.cs.cmu.edu/~teruko

2 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 2 LTI Grammars and Lexicons Schedule: November 28 Q/A on Grammar Writing Project Q/A sessions by TA Equations Finish Japanese Grammar exercise (jpn.gra) Start a new grammar

3 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 3 LTI Grammars and Lexicons *UNDEFINED* and *DEFINED* The word *UNDEFINED* and *DEFINED* can be used on the right hand side of an equation. *UNDEFINED* makes sure that the left hand side of the equation has no value. *DEFINED* makes sure that the left hand side of the equation has a value. ((x1 negation) = *UNDEFINED*)

4 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 4 LTI Grammars and Lexicons Assigning Multiple Values Multiple values can be assigned to a feature. Use the grater-than sign (>) in place of the equal sign. If the following rule applies recursively, the pp- adjunct function will have several different values at the same time: ( ( ) ((x0 = x1) ((x0 pp-adjunct) > x2))) ; This rule should come last. Multiple rule is sensitive to rule ordering

5 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 5 LTI Grammars and Lexicons Grammar Exercise (Japanese Grammar) Free word-order language SOV language Case markers determine grammatical relations (ga, wo, ni, de, etc) Grammar file: jpn.gra Test files: jpn-test1.lisp /afs/cs/project/cmt-55/lti/Lab/Modules/GNL-721/2007/

6 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 6 LTI Grammars and Lexicons Japanese Lexicon nichiyoubi (Sunday) nyuuyooku (New York) hoomuran (home run) itta (went) utta (hit-past) Hideki, Ichiro (person’s name) ga (NOM case) wo (ACC case) ni (Time-on) ni (Loc-to) e (Loc-to) de (Loc-at)

7 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 7 LTI Grammars and Lexicons Japanese Examples Nichiyoubi ni Hideki ga Nyuuyook e itta. Sunday on Hideki NOM New York to go PAST “Hideki went to New York on Sunday.” Nichiyoubi ni Nyuuyooku e Hideki ga itta. Hideki ga nichiyoubi ni Nyuuyooku e itta. Hideki ga Nyuuyooku e nichiyoubi ni itta. Nyuuyooku e Hideki ga nichiyoubi ni itta. Nyuuyooku e nichiyoubi ni Hideki ga itta.

8 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 8 LTI Grammars and Lexicons Japanese Examples (2) Hideki ga Nyuuyooku e itta Nyuuyooku e Hideki ga itta Nichiyoubi ni Nyuuyooku e itta Nyuuyooku e nichiyoubi ni itta Hideki ga nichiyoubi ni itta Nichiyoubi ni Hideki ga itta Hideki ga itta Nyuuyooku e itta Nichiyoubi ni itta

9 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 9 LTI Grammars and Lexicons Japanese Example Nichiyoubi ni Ichiro ga hoomuran wo utta. Sunday on Ichiro NOM home run ACC hit-PAST “Ichiro hit a home run on Sunday.”

10 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 10 LTI Grammars and Lexicons Ungrammatical Sentences You can’t have two nominatives or accusatives in a sentence. (jpn-test1.lisp) *Hideki ga nichiyoubi ga itta *Hideki ga Hideki ga itta *Hideki ga hoomuran ga utta *Hideki wo hoomuran wo utta

11 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 11 LTI Grammars and Lexicons Japanese Grammar Use of recursive rules ( ( ) ( ( )

12 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 12 LTI Grammars and Lexicons Recursive Rules S NP S N P N P V Hideki ga Nyuuyooku e itta

13 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 13 LTI Grammars and Lexicons Japanese Grammar (2) “ni” is ambiguous in Japanese Time-on, Loc-to Nichiyoubi ni itta (went on Sunday) Nyuuyooku ni itta (went to New York) “ni” and “e” can be used for Loc-to Nyuuyooku ni/e itta (went to New York)

14 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 14 LTI Grammars and Lexicons Japanese grammar exercise Grammar file: /afs/cs/project/cmt-55/lti/Lab/Modules/GNL721/2007/jpn.gra Test file: jpn-test1.lisp

15 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 15 LTI Grammars and Lexicons Japanese Grammar (2) “ni” is ambiguous in Japanese Time-on, Loc-to Nichiyoubi ni itta (went on Sunday) Nyuuyooku ni itta (went to New York) “ni” and “e” can be used for Loc-to Nyuuyooku ni/e itta (went to New York)

16 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 16 LTI Grammars and Lexicons Japanese Grammar (3) “de” is Loc-in/Loc-at with action verbs Nyuuyooku de tabeta (ate in New York) CMU de tabeta (ate at CMU) Nyuuyooku de hoomuran wo utta (hit hoomuran in New York)

17 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 17 LTI Grammars and Lexicons Ungrammatical Sentences (2) “itta (went)” doesn’t take Loc-at/in “de” *Nyuuyooku de itta (*went in/at New York) “tabeta (ate)” doesn’t take Loc-to “ni/e” *Nyuuyooku ni/e tabeta (*ate to New York) Time expression doesn’t take Loc-at, Loc-to *Nichiyoubi de/e itta (*went at/to Sunday) *Nichiyoubi de/e utta (*hit at/to Sunday) *Nichiyoubi de/e tabeta (*ate at/to Sunday)

18 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 18 LTI Grammars and Lexicons Ungrammatical Sentences (3) Wrong case marker (jpn-test2.lisp) Nyuuyooku ni/e itta (Loc-to) *Nyuuyooku de itta (Loc-at) Nyuuyooku de tabeta (Loc-at) *Nyuuyooku ni/e tabeta (Loc-to) Nichiyoubi ni itta/tabeta (Time-on) *Nichiyoubi de itta/tabeta (Loc-at) *Nichiyoubi e itta/tabeta (Loc-to)

19 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 19 LTI Grammars and Lexicons Japanese grammar exercise Grammar file: /afs/cs/project/cmt-55/lti/Lab/Modules/GNL721/2007/jpn.gra Test file: jpn-test2.lisp Work on test2 and test-fail2 Run test1 to see if it is still working

20 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 20 LTI Grammars and Lexicons Questions?


Download ppt "Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 1 LTI Grammars and Lexicons Grammar Writing Lecture."

Similar presentations


Ads by Google