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

Slides:



Advertisements
Similar presentations
Application: Yacc A parser generator A context-free grammar An LR parser Yacc Yacc input file:... definitions... %... production rules... %... user-defined.
Advertisements

Feature-based Grammar Ling 571 Deep Techniques for NLP February 2, 2001.
Computational language: week 10 Lexical Knowledge Representation concluded Syntax-based computational language Sentence structure: syntax Context free.
Development of a German- English Translator Felix Zhang.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Feature Structures and Parsing Unification Grammars Algorithms for NLP 18 November 2014.
Augmented Transition Networks
The Practical Value of Statistics for Sentence Generation: The Perspective of the Nitrogen System Irene Langkilde-Geary.
Notes on TAG (LTAG) and Feature Structures September AKJ.
CSA2050: DCG I1 CSA2050 Introduction to Computational Linguistics Lecture 8 Definite Clause Grammars.
Lexical Functional Grammar : Grammar Formalisms Spring Term 2004.
BİL711 Natural Language Processing1 Problems with CFGs We know that CFGs cannot handle certain things which are available in natural languages. In particular,
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Prolog COMP 112 #
Lab 6: Child- Directed Speech Materials linked on Reminders: No Lab next week Lab Exam the following week (Nov. 26 th )
May 2006CLINT-LN Parsing1 Computational Linguistics Introduction Approaches to Parsing.
Grammatical Relations and Lexical Functional Grammar Grammar Formalisms Spring Term 2004.
SYNTAX 1 DAY 30 – NOV 6, 2013 Brain & Language LING NSCI Harry Howard Tulane University.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
1 Pertemuan 23 Syntatic Processing Matakuliah: T0264/Intelijensia Semu Tahun: 2005 Versi: 1/0.
NLP and Speech 2004 Feature Structures Feature Structures and Unification.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 26, 2011.
Features & Unification Ling 571 Deep Processing Techniques for NLP January 31, 2011.
Syllabus Text Books Classes Reading Material Assignments Grades Links Forum Text Books עיבוד שפות טבעיות - שיעור עשר Chart Parsing (cont) Features.
Artificial Intelligence 2005/06 From Syntax to Semantics.
Issues in Computational Linguistics: Parsing and Generation Dick Crouch and Tracy King.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Features and Unification
A modern approach input sentence syntax analysis (parsing) semantic analysis pragmatic analysis target representation grammar lexicon semantic rules contextual.
Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 1 LTI Grammars and Lexicons Grammar Writing Lecture.
Link Grammar ( by Davy Temperley, Daniel Sleator & John Lafferty ) Syed Toufeeq Ahmed ASU.
Semi-Automatic Learning of Transfer Rules for Machine Translation of Low-Density Languages Katharina Probst April 5, 2002.
CS 4705 Lecture 11 Feature Structures and Unification Parsing.
LING 388 Language and Computers Lecture 12 10/9/03 Sandiway FONG.
Context-Free Parsing Part 2 Features and Unification.
March 1, 2009 Dr. Muhammed Al-Mulhem 1 ICS 482 Natural Language Processing INTRODUCTION Muhammed Al-Mulhem March 1, 2009.
1 A Chart Parser for Analyzing Modern Standard Arabic Sentence Eman Othman Computer Science Dept., Institute of Statistical Studies and Research (ISSR),
Present Tense of Latin Verbs Magister Henderson Latin I.
October 2004csa4050: Semantics II1 CSA4050: Advanced Topics in NLP Semantics II The Lambda Calculus Semantic Representation Encoding in Prolog.
ICS611 Introduction to Compilers Set 1. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
LING 388: Language and Computers Sandiway Fong Lecture 17.
Chapter 16: Features and Unification Heshaam Faili University of Tehran.
Understanding Natural Language
Development of a German- English Translator Felix Zhang Period Thomas Jefferson High School for Science and Technology Computer Systems Research.
Fall 2004 Lecture Notes #4 EECS 595 / LING 541 / SI 661 Natural Language Processing.
PARSING David Kauchak CS159 – Spring 2011 some slides adapted from Ray Mooney.
Rule Learning - Overview Goal: Syntactic Transfer Rules 1) Flat Seed Generation: produce rules from word- aligned sentence pairs, abstracted only to POS.
Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 1 LTI Grammars and Lexicons Grammar Writing Grammars.
2007CLINT-LIN-FEATSTR1 Computational Linguistics for Linguists Feature Structures.
Ideas for 100K Word Data Set for Human and Machine Learning Lori Levin Alon Lavie Jaime Carbonell Language Technologies Institute Carnegie Mellon University.
November 2011CLINT-LN CFG1 Computational Linguistics Introduction Context Free Grammars.
Grammars Grammars can get quite complex, but are essential. Syntax: the form of the text that is valid Semantics: the meaning of the form – Sometimes semantics.
Artificial Intelligence: Natural Language
CSE573 Autumn /23/98 Natural Language Processing Administrative –PS3 due today –PS4 out Wednesday, due Friday 3/13 (last day of class) special.
csa3050: Parsing Algorithms 11 CSA350: NLP Algorithms Parsing Algorithms 1 Top Down Bottom-Up Left Corner.
CPSC 422, Lecture 27Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 27 Nov, 16, 2015.
October 2004CSA3050 NLP Algorithms1 CSA3050: Natural Language Algorithms Morphological Parsing.
Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 1 LTI Grammars and Lexicons Grammar Writing Lecture.
Eliciting a corpus of word- aligned phrases for MT Lori Levin, Alon Lavie, Erik Peterson Language Technologies Institute Carnegie Mellon University.
Chapter 11: Parsing with Unification Grammars Heshaam Faili University of Tehran.
CSE573 Autumn /04/98 Natural Language Processing Administrative –Example code available in code\ps4\sample directory Last time –using features.
Grammar and Sentence Writing ENG 111 Al-Huqail, Eman.
10/31/00 1 Introduction to Cognitive Science Linguistics Component Topic: Formal Grammars: Generating and Parsing Lecturer: Dr Bodomo.
Natural Language Processing Vasile Rus
Lecture – VIII Monojit Choudhury RS, CSE, IIT Kharagpur
Basic Parsing with Context Free Grammars Chapter 13
Lexical Functional Grammar
Natural Language Processing
CSCI 5832 Natural Language Processing
CSA2050 Introduction to Computational Linguistics
Artificial Intelligence 2004 Speech & Natural Language Processing
Presentation transcript:

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

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 2 LTI Grammars and Lexicons Schedule: November 19, 2007 Review of “bird.gra” Review of “bird2.gra” Character-based Parsing vs. Word-based Parsing Morphology Start a new grammar exercise (4)

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 3 LTI Grammars and Lexicons Bird.gra review General Problems Incomplete F-structure Incorrect F-structure Not enough constraints in the rule Unification problems

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 4 LTI Grammars and Lexicons Incomplete F-structures 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))

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

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) ))

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 7 LTI Grammars and Lexicons Not Enough Constraints The singular noun without determiner can become NP. “Bird flies” may parse. ( ( ) ((x0 = x1))) Problem: No constraint for number. ((x1 number) =c pl)

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 8 LTI Grammars and Lexicons Be Aware of Unification ( ( ) ((x0 = x1) (x0 = x2))) ( (t h e) (((x0 definiteness) = +))) ( (b i r d) (((x0 root) = bird) ((x0 number) = sg) ((x0 agreement) = 3sg)))

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 9 LTI Grammars and Lexicons Be Aware of Unification (cont.) ( ( ) ((x0 = x1) (x0 = x2))) ( (t h e) (((x0 definiteness) = +) ((x0 root) = the))) ( (b i r d) (((x0 root) = bird) ((x0 number) = sg) ((x0 agreement) = 3sg)))

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 10 LTI Grammars and Lexicons Frequently Seen Problems Test equations come before Action (x0 = x2) ;action ((x1 agreement) = (x2 agreement)) ;test No “root” info in f-structure When submitted: –Write your full name in the grammar –Write more comments in the grammar –Turn off (dmode 2) or trace Print out the grammar and results files. –lpr –P e.g. lpr –Pshakthi bird.gra

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 11 LTI Grammars and Lexicons Review: Bird 2 Grammar Goal: To learn more on unification Some Problems: –Not scalable semantic features ((x0 semclass) = Morris) –Incomplete f-structures –Incorrect f-structures

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 12 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"

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 13 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"

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 14 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"

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 15 LTI Grammars and Lexicons Semantic Category Bird fly, run, *meow Cat *fly, run, meow Penguin *fly, run, *meow

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 16 LTI Grammars and Lexicons Semantic Features (noun) Bird (sem-class bird) Cat (sem-class cat) Penguin (sem-class penguin) (animate +)

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 17 LTI Grammars and Lexicons Semantic Features (verb) Fly ((subj sem-class) = bird) Meow ((subj sem-class) = cat) Run ((subj animate) = +)

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 18 LTI Grammars and Lexicons Unification ( (c a t s) (((x0 root) = cat) ((x0 number) = pl) ((x0 animate) = +) ((x0 sem-class) = cat) ((x0 agreement) = pl))) ( (m e o w) (((x0 root) = meow) ((x0 agreement) = pl) ((x0 subj animate) = +) ((x0 subj sem-class) = cat) ((x0 form) = present)))

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 19 LTI Grammars and Lexicons Unification ( ( ) (((x1 agreement) = (x2 agreement)) ((x0 subj) = x1) (x0 = x2)))

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 20 LTI Grammars and Lexicons Character-based Parsing Morphological rules can be parsed Input string: tabeta eat-past taberu eat-present ( ( r u) ((x0 = x1) ((x0 tense) = present))) ( ( t a) ((x0 = x1) ((x0 tense) = past))) ( (t a b e) (((x0 root) = taberu))

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 21 LTI Grammars and Lexicons Japanese morphology tabe-sase-rare-ta eat-caus-pass-past ( (t a b e) (((x0 root) = taberu))) ( ( s a s e) (((x1 pass) = *undefined*) ((x1 tense) = *undefined*) (x0 = x1) ((x0 caus) = +))) ( ( r a r e) (((x1 tense) = *undefined*) (x0 = x1) ((x0 pass) = +))) ( ( t a) ((x0 = x1) ((x0 tense) = past))) Tabeta eat-past Tabe-sase-ta eat-caus-past Tabe-rare-ta eat-pass-past Tabe-sase-rare-ta eat-caus-pass-past *tabe-rare-sase-ta eat-pass-caus-past *tabe-ta-sase-rare eat-past-caus-pass *tabe-ta-rare-sase eat-past-pass-caus *tabe-rare-ta-sase eat-pass-past-caus *tabe-sase-ta-rare eat-caus-past-pass *tabe-rare-sase eat-pass-caus *tabe-ta-sase eat-past-caus

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 22 LTI Grammars and Lexicons Word-based Parsing ( (sushi) (((x0 = root) = sushi))) Instead of: ( (s u s h i) (((x0 = root) = sushi))) For parsing: (parse-list list of symbols $) e.g. (parse-list ‘(a bird flies $))

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 23 LTI Grammars and Lexicons Grammar Exercise (4) Start grammar exercise (4): mlb.gra Files are in /afs/cs/project/cmt-55/lti/Lab/Modules/ GNL-721/2007/ Test file: mlb-test.lisp

Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 24 LTI Grammars and Lexicons Next Class: Nov 26 Return bird2.gra Return Assignment #1 Grammar Writing Project Evaluation Criteria Finish mlb.gra Start a new exercise