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 4 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 14, 2007 Review of “bird.gra” exercise Submit the results of grammar exercise “bird-test.lisp” using “bird.gra”. Grammar Writing Project -- The 1 st assignment Due Start grammar exercise (3) bird2-test.lisp by expanding your grammar.

3 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 3 LTI Grammars and Lexicons Review: Bird Grammar (1) with bird-test.lisp Goal: To learn basic equations General problems we often have: –Incomplete F-structure –Incorrect F-structure

4 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 4 LTI Grammars and Lexicons Incomplete F-structures Example: Determiner information is missing from f- structure “A bird flies” and “The bird flies” showed the same F-structure ((subj ((agreement 3sg) (number sg) (root bird))) (form present) (agreement 3sg) (root fly))

5 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 5 LTI Grammars and Lexicons Complete F-structure Contains all the necessary grammatical information Be able to reconstruct the original sentence “A bird flies” ((SUBJ ( (NUMBER SG) (AGREEMENT 3SG) (ROOT BIRD) (DET ((NUMBER SG) (DEFINITENESS -) (ROOT A))) )) (FORM PRESENT) (AGREEMENT 3SG) (ROOT FLY)) Some feature structures are redundant

6 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 6 LTI Grammars and Lexicons Incomplete F-structures (2) Grammar problem: ( ( ) ( ((x1 number) = (x2 number)) (x0 = x2) ))

7 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 7 LTI Grammars and Lexicons Incorrect F-structures ( ( ) ( ((x1 agreement) = (x2 agreement)) ((x1 subj) = x2) (x0 = x1) ))

8 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 8 LTI Grammars and Lexicons Incorrect F-structures NIL is in the f-structure (DET ((Number NIL) … This happens when there is no value of Number in the grammar. ((x1 number) = (x2 number))

9 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 9 LTI Grammars and Lexicons Incorrect F-structures Unnecessary feature structure “A bird flies” ((subj ((definiteness (*or* + -)… Conflicting information, no checking for numbers “The birds fly” ((subj ((det ((number sg) …)) (number pl) (root bird) …

10 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 10 LTI Grammars and Lexicons Frequently Seen Problems Parentheses don’t match Bad equations: ((x1 case) = (NOM)) ((x1 case) = *OR* NOM ACC) ((x1 case) = c NOM) (*OR* ((x1 tense) = present) ((x1 tense) = past))

11 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 11 LTI Grammars and Lexicons Grammar Exercise (3) Test Sentences "A bird flies“ "Birds fly“ "The bird flies“ "The birds fly“ "The cat runs“ "The cats run“ “Morris runs“ “Morris meows“ "Cats meow“ "A cat meows” "The cats meow“ "The penguins run” "A penguin runs"

12 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 12 LTI Grammars and Lexicons Grammar Exercise (3) Test Sentences (fail) "A bird fly" "A birds flies" "Birds flies" "Bird flies" "The bird fly" "The birds flies"

13 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 13 LTI Grammars and Lexicons Test Sentences (fail) "The cat flies" "The cats fly" "The cat run" "A cat meow" “Morris meow" “Morris flies" "The bird meows" "A penguin meows" “Penguins meow" "The penguin flies"

14 Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 14 LTI Grammars and Lexicons Grammar Exercise (3) Continue working on bird.gra (copy to bird2.gra) Files are in /afs/cs/project/cmt-55/lti/Lab/Modules/ GNL-721/2007/ Test file name: “bird2-test.lisp”


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