Feature-based Grammar Ling 571 Deep Techniques for NLP February 2, 2001.

Slides:



Advertisements
Similar presentations
English relative pronouns are Which Who Whom Whose That
Advertisements

FMZ Elaborazione del linguaggio naturale Fabio Massimo Zanzotto.
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.
Notes on TAG (LTAG) and Feature Structures September AKJ.
Basic Parsing with Context-Free Grammars CS 4705 Julia Hirschberg 1 Some slides adapted from Kathy McKeown and Dan Jurafsky.
BİL711 Natural Language Processing1 Problems with CFGs We know that CFGs cannot handle certain things which are available in natural languages. In particular,
Grammar Development Platform Miriam Butt October 2002.
1 Features and Augmented Grammars Allen ’ s Chapter 4 J&M ’ s Chapter 11.
Natural Language Processing - Feature Structures - Feature Structures and Unification.
NLP and Speech Course Review. Morphological Analyzer Lexicon Part-of-Speech (POS) Tagging Grammar Rules Parser thethe – determiner Det NP → Det.
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.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Features and Unification
Ch.11 Features and Unification Ling 538, 2006 Fall Jiyoung Kim.
CS 4705 Lecture 11 Feature Structures and Unification Parsing.
Features and Unification Read J & M Chapter 11.. Solving the Agreement Problem Number agreement: S  NP VP * Mary walk. [NP NUMBER] [VP NUMBER] NP  det.
Basic Parsing with Context- Free Grammars 1 Some slides adapted from Julia Hirschberg and Dan Jurafsky.
Feature structures and unification Attributes and values.
1 Features and Unification Chapter 15 October 2012 Lecture #10.
Phonological Rules Rules about how sounds may or may not go together in a language English: Words may not start with two stop consonants German: Devoicing.
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
Chapter 16: Features and Unification Heshaam Faili University of Tehran.
1 st declension 2 nd declension (masc) 2 nd declension (neut) Nominative Genitive Dative Accusative Ablative Sg. Pl. Sg. Pl. Sg. Pl. -A -AE -AE -ARUM -AE.
Chapter 15 Natural Language Processing (cont)
Development of a German- English Translator Felix Zhang Period Thomas Jefferson High School for Science and Technology Computer Systems Research.
1 Natural Language Processing Lecture Notes 11 Chapter 15 (part 1)
Parsing I: Earley Parser CMSC Natural Language Processing May 1, 2003.
Rule Learning - Overview Goal: Syntactic Transfer Rules 1) Flat Seed Generation: produce rules from word- aligned sentence pairs, abstracted only to POS.
6/2/2016CPSC503 Winter CPSC 503 Computational Linguistics Lecture 9 Giuseppe Carenini.
2007CLINT-LIN-FEATSTR1 Computational Linguistics for Linguists Feature Structures.
Head-driven Phrase Structure Grammar (HPSG)
NLP. Introduction to NLP Background –Developed by Jay Earley in 1970 –No need to convert the grammar to CNF –Left to right Complexity –Faster than O(n.
1 Context Free Grammars October Syntactic Grammaticality Doesn’t depend on Having heard the sentence before The sentence being true –I saw a unicorn.
Section 11.3 Features structures in the Grammar ─ Jin Wang.
Parsing and Translating
Artificial Intelligence 2004
Computing Science, University of Aberdeen1 CS4025: Grammars l Grammars for English l Features l Definite Clause Grammars See J&M Chapter 9 in 1 st ed,
1 Natural Language Processing Lecture 6 Features and Augmented Grammars Reading: James Allen NLU (Chapter 4)
LING/C SC/PSYC 438/538 Lecture 20 Sandiway Fong 1.
The 3 lines Deutsch 1 Herr Reierstad 9/11/13. Wichtige Fragen: What are the 3 lines? Why is it important for us to learn them?
Carnegie Mellon School of Computer Science Copyright © 2007, Carnegie Mellon. All Rights Reserved. 1 LTI Grammars and Lexicons Grammar Writing Lecture.
Chapter 11: Parsing with Unification Grammars Heshaam Faili University of Tehran.
ENGLISH LANGUAGE – 2° YEAR A HISTORY OF THE ENGLISH LANGUAGE Annalisa Federici, Ph.D. Textbook: J. Culpeper, History of English, Routledge (unit.
 Three grammatical categories are represented in the OE substantives, just as in many other Germanic and Indo-European languages: gender, number, and.
Learning to Generate Complex Morphology for Machine Translation Einat Minkov †, Kristina Toutanova* and Hisami Suzuki* *Microsoft Research † Carnegie Mellon.
SYNTAX.
Natural Language Processing Vasile Rus
Lecture – VIII Monojit Choudhury RS, CSE, IIT Kharagpur
Basic Parsing with Context Free Grammars Chapter 13
BELL WORK THE DATIVE CASE
Макет заголовкаМакет заголовка Підзаголовок. The noun is the central lexical unit of language. It is the main nominative unit of speech. As any other.
Dependency Parsing & Feature-based Parsing
Syntax.
Case Names and Uses Nominative - Subject Genitive - Possessive
Adjektive Endungen Notizen
CSC 594 Topics in AI – Applied Natural Language Processing
Dative: 4. Indirect Object (to/for after verbs of giving, telling,
Agenda diēs Martis, a.d. vi Non. Oct. A.D. MMXVIII
CSCI 5832 Natural Language Processing
CPSC 503 Computational Linguistics
Agenda diēs Mercuriī, prid. Id. Sept. A.D. MMXVIII
ACC CASE REVIEW AND DOGFU
Artificial Intelligence 2004 Speech & Natural Language Processing
Guarded Constraints in Natural Language Processing
Cambridge Latin Course Unit 2, Stage 18
NLP.
Presentation transcript:

Feature-based Grammar Ling 571 Deep Techniques for NLP February 2, 2001

Roadmap Implementing feature-based grammars Features in NLTK Designing feature grammars A Complex Agreement Example Semantic features

Summary Features defined Modeling features: Attribute-Value Matrices (AVM) Directed Acyclic Graph (DAG) Mechanisms for features: Subsumption Unification Parsing with features: Augmenting the Earley parser

Feature Grammar in NLTK NLTK supports feature-based grammars Includes ways of associating features with CFG rules Includes readers for feature grammars.fcfg files Includes parsers Nltk.parse.FeatureEarleyChartParse

Creating and Accessing NLTK Feature Structures Create with FeatStruct

Creating and Accessing NLTK Feature Structures Create with FeatStruct >>> fs1 = nltk.FeatStruct(NUMBER=pl,PERSON=3) >>>print fs1 [ NUMBER = pl] [ PERSON = 3 ] >>> print fs1[NUMBER] pl >> fs1[NUMBER] = sg

Creating and Accessing NLTK Feature Structures Create with FeatStruct >>> fs1 = nltk.FeatStruct(NUMBER=pl,PERSON=3)

Creating and Accessing NLTK Feature Structures Create with FeatStruct >>> fs1 = nltk.FeatStruct(NUMBER=pl,PERSON=3) >>>print fs1 [ NUMBER = pl] [ PERSON = 3 ]

Creating and Accessing NLTK Feature Structures Create with FeatStruct >>> fs1 = nltk.FeatStruct(NUMBER=pl,PERSON=3) >>>print fs1 [ NUMBER = pl] [ PERSON = 3 ] >>> print fs1[NUMBER] pl

Creating and Accessing NLTK Feature Structures Create with FeatStruct >>> fs1 = nltk.FeatStruct(NUMBER=pl,PERSON=3) >>>print fs1 [ NUMBER = pl] [ PERSON = 3 ] >>> print fs1[NUMBER] pl >> fs1[NUMBER] = sg

Complex Feature Structures >>>fs2 = nltk.FeatStruct(POS=N,AGR=fs1)

Complex Feature Structures >>>fs2 = nltk.FeatStruct(POS=N,AGR=fs1) >>>print fs2 [ POS = N ] [ [ NUMBER = sg ] ] [ AGR = [ PERSON = 3 ] ]

Complex Feature Structures >>>fs2 = nltk.FeatStruct(POS=N,AGR=fs1) >>>print fs2 [ POS = N ] [ [ NUMBER = sg ] ] [ AGR = [ PERSON = 3 ] ] Alternatively, >>> fs3 = nltk.FeatStruct([POS=N, AGR=[NUM=pl,PER=3]])

Reentrant Feature Structures First instance Parenthesized integer: (1)

Reentrant Feature Structures First instance Parenthesized integer: (1) Subsequent instances: Pointer: -> (1)

Reentrant Feature Structures First instance Parenthesized integer: (1) Subsequent instances: Pointer: -> (1) >>> print nltk.FeatStruct("[A='a', B=(1)[C='c'], D->(1)]

Reentrant Feature Structures First instance Parenthesized integer: (1) Subsequent instances: Pointer: -> (1) >>> print nltk.FeatStruct("[A='a', B=(1)[C='c'], D->(1)] [ A = a ] [ B = (1) [ C = c]] [ D -> (1) ]

Augmenting Grammars Attach feature information to non-terminals, on N[AGR=[NUM='pl']] -> 'students N[AGR=[NUM=sg']] -> 'student

Augmenting Grammars Attach feature information to non-terminals, on N[AGR=[NUM='pl']] -> 'students N[AGR=[NUM=sg']] -> 'student So far, all values are literal or reentrant

Augmenting Grammars Attach feature information to non-terminals, on N[AGR=[NUM='pl']] -> 'students N[AGR=[NUM=sg']] -> 'student So far, all values are literal or reentrant Variables allow generalization: ?a Allows underspecification, e.g. Det[GEN=?a]

Augmenting Grammars Attach feature information to non-terminals, on N[AGR=[NUM='pl']] -> 'students N[AGR=[NUM=sg']] -> 'student So far, all values are literal or reentrant Variables allow generalization: ?a Allows underspecification, e.g. Det[GEN=?a] NP[AGR=?a] -> Det[AGR=?a] N[AGR=?a]

Mechanics >>> fs3 = nltk.FeatStruct(NUM=pl,PER=3) >>> fs4 = nltk.FeatStruct(NUM=pl) >>> print fs4.unify(fs3) [NUM = pl] [PER = 3 ]

Morphosyntactic Features Grammatical feature that influences morphological or syntactic behavior English: Number: Dog, dogs Person: Am; are; is Case: I – me; he – him; etc Countability:

More Complex German Example Subject – singular, masc der Hund The dog Subject –plural, masc die Hunde The dogs

More Complex German Example Objects – determined by verb Dative – singular, masc dem Hund The dog Accusative –plural, masc die Hunde The dogs

Contrast Subject: Die Katze The cat Subject: plural Die Katze The cats

Contrast Object: Die Katze The cat Object: Der Katze The cat

Analysis What are the key contrasts? Number Singular, plural Gender Masc, Fem, …. Case: Subject (nom), dative, accusative, …. + Interactions

Feature Interaction Interactions of German case, number, gender CaseMascFemNeutPL NomDerDieDasDie GenDesDerDesDen DatDemDerDemDen AccDenDieDasDie

Examples of Interaction Die The.Nom.Fem.sg The cat sees the dog Katze Cat.3.FEM.SG Sieht See.3.sg Den The.Acc.Masc.sg Hund Dog.3.Masc.sg

Examples of Interaction Die The.Nom.Fem.sg The cat sees the dog Katze Cat.3.FEM.SG Sieht See.3.sg Den The.Acc.Masc.sg Hund Dog.3.Masc.sg *Die The.Nom.Fem.sg The cat sees the dog Katze Cat.3.FEM.SG Sieht See.3.sg Dem The.Dat.Masc.sg Hund Dog.3.Masc.sg

Examples of Interaction Die The.Nom.Fem.sg The cat sees the dog Katze Cat.3.FEM.SG Sieht See.3.sg Den The.Acc.Masc.sg Hund Dog.3.Masc.sg *Die The.Nom.Fem.sg The cat sees the dog Katze Cat.3.FEM.SG Sieht See.3.sg Dem The.Dat.Masc.sg Hund Dog.3.Masc.sg Die The.Nom.Fem.sg The cat helps the dog Katze Cat.3.FEM.SG hilft help.3.sg Dem The.Dat.Masc.sg Hund Dog.3.Masc.sg

Examples of Interaction Die The.Nom.Fem.sg The cat sees the dog Katze Cat.3.FEM.SG Sieht See.3.sg Den The.Acc.Masc.sg Hund Dog.3.Masc.sg *Die The.Nom.Fem.sg The cat sees the dog Katze Cat.3.FEM.SG Sieht See.3.sg Dem The.Dat.Masc.sg Hund Dog.3.Masc.sg Die The.Nom.Fem.sg The cat helps the dog Katze Cat.3.FEM.SG hilft help.3.sg Dem The.Dat.Masc.sg Hund Dog.3.Masc.sg *Die The.Nom.Fem.sg The cat sees the dog Katze Cat.3.FEM.SG hilft help.3.sg Dem The.Acc.Masc.sg Hund Dog.3.Masc.sg German verbs in, at least, 2 classes: assign difft object case

Semantic Features Grammatical features that influence semantic(meaning) behavior of associated units E.g.:

Semantic Features Grammatical features that influence semantic(meaning) behavior of associated units E.g.: ?The rocks slept.

Semantic Features Grammatical features that influence semantic(meaning) behavior of associated units E.g.: ?The rocks slept. ?Colorless green ideas sleep furiously.

Semantic Features Many proposed: Animacy: +/- Natural gender: masculine, feminine, neuter Human: +/- Adult: +/- Liquid: +/- Etc. The milk spilled. ?The cat spilled.

Examples The climber hiked for six hours.

Examples The climber hiked for six hours. The climber hiked on Saturday.

Examples The climber hiked for six hours. The climber hiked on Saturday. The climber reached the summit on Saturday.

Examples The climber hiked for six hours. The climber hiked on Saturday. The climber reached the summit on Saturday. *The climber reached the summit for six hours. Contrast:

Examples The climber hiked for six hours. The climber hiked on Saturday. The climber reached the summit on Saturday. *The climber reached the summit for six hours. Contrast: Achievement vs activity

Semantic features & Parsing Can filter some classes of ambiguity Old men and women slept.

Semantic features & Parsing Can filter some classes of ambiguity Old men and women slept. (Old men) and (women) slept.

Semantic features & Parsing Can filter some classes of ambiguity Old men and women slept. (Old men) and (women) slept. (Old (men and women)) slept.

Semantic features & Parsing Can filter some classes of ambiguity Old men and women slept. (Old men) and (women) slept. (Old (men and women)) slept. Sleeping people and books lie flat.

Semantic features & Parsing Can filter some classes of ambiguity Old men and women slept. (Old men) and (women) slept. (Old (men and women)) slept. Sleeping people and books lie flat. (Sleeping people) and (books) lie flat.

Semantic features & Parsing Can filter some classes of ambiguity Old men and women slept. (Old men) and (women) slept. (Old (men and women)) slept. Sleeping people and books lie flat. (Sleeping people) and (books) lie flat. (Sleeping (people and books ))lie flat.

Semantic features & Parsing Can filter some classes of ambiguity Old men and women slept. (Old men) and (women) slept. (Old (men and women)) slept. Sleeping people and books lie flat. (Sleeping people) and (books) lie flat. *(Sleeping (people and books ))lie flat.

Summary Features Enable compact representation of grammatical constraints Capture basic linguistic patterns Unification Creates and maintains consistency over features Integration with parsing allows filtering of ill-formed analyses