FMZ Elaborazione del linguaggio naturale Fabio Massimo Zanzotto.

Slides:



Advertisements
Similar presentations
FMZ Elaborazione del linguaggio naturale Fabio Massimo Zanzotto.
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.
Natural Language Processing Syntax. Syntactic structure John likes Mary PN VtVt NP VP S DetPNVtVt NP VP S Every man likes Mary Noun.
 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.
Natural Language Processing Lecture 2: Semantics.
1 Unification Grammars Allen ’ s Chapter 4 J&M ’ s Chapter 11.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
BİL711 Natural Language Processing1 Problems with CFGs We know that CFGs cannot handle certain things which are available in natural languages. In particular,
1 Natural Language Processing Lecture 7 Unification Grammars Reading: James Allen NLU (Chapter 4)
1 Grammars and Parsing Allen ’ s Chapters 3, Jurafski & Martin ’ s Chapters 8-9.
PSY 369: Psycholinguistics Some basic linguistic theory part2.
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.
Parsing: Features & ATN & Prolog By
Syllabus Text Books Classes Reading Material Assignments Grades Links Forum Text Books עיבוד שפות טבעיות - שיעור עשר Chart Parsing (cont) Features.
Parsing I Miriam Butt May 2005 Jurafsky and Martin, Chapters 10, 13.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Feature Structures and Unification.
Features and Unification
1 CONTEXT-FREE GRAMMARS. NLE 2 Syntactic analysis (Parsing) S NPVP ATNNSVBD NP AT NNthechildrenate thecake.
Unification-based algorithms We have seen that treating features, such as person-number agreement, as part of the category of a phrase results in a large.
Context Free Grammar S -> NP VP NP -> det (adj) N
CS 4705 Lecture 11 Feature Structures and Unification Parsing.
Probabilistic Parsing Ling 571 Fei Xia Week 4: 10/18-10/20/05.
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.
Syntax Nuha AlWadaani.
11 CS 388: Natural Language Processing: Syntactic Parsing Raymond J. Mooney University of Texas at Austin.
Latin Grammar: Singular and Plural Magister Henderson Latin I.
1 Features and Unification Chapter 15 October 2012 Lecture #10.
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,
For Monday Read chapter 23, sections 1-2 FOIL exercise due.
For Friday Finish chapter 23 Homework: –Chapter 22, exercise 9.
Chapter 16: Features and Unification Heshaam Faili University of Tehran.
THE BIG PICTURE Basic Assumptions Linguistics is the empirical science that studies language (or linguistic behavior) Linguistics proposes theories (models)
GRAMMARS David Kauchak CS159 – Fall 2014 some slides adapted from Ray Mooney.
Natural Language Processing Artificial Intelligence CMSC February 28, 2002.
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.
2007CLINT-LIN-FEATSTR1 Computational Linguistics for Linguists Feature Structures.
Syntax Why is the structure of language (syntax) important? How do we represent syntax? What does an example grammar for English look like? What strategies.
For Wednesday Read chapter 23 Homework: –Chapter 22, exercises 1,4, 7, and 14.
Rules, Movement, Ambiguity
CSA2050 Introduction to Computational Linguistics Parsing I.
For Friday No reading Program 4 due. Program 4 Any questions?
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,
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
LING 6520: Comparative Topics in Linguistics (from a computational perspective) Martha Palmer Jan 15,
English Syntax Read J & M Chapter 9.. Two Kinds of Issues Linguistic – what are the facts about language? The rules of syntax (grammar) Algorithmic –
1 Natural Language Processing Lecture 6 Features and Augmented Grammars Reading: James Allen NLU (Chapter 4)
CSC312 Automata Theory Lecture # 26 Chapter # 12 by Cohen Context Free Grammars.
CSA3050: NLP Algorithms Sentence Grammar NLP Algorithms.
October 10, 2003BLTS Kickoff Meeting1 Transfer with Strong Decoding Learning Module Transfer Rules {PP,4894} ;;Score: PP::PP [NP POSTP] -> [PREP.
Chapter 11: Parsing with Unification Grammars Heshaam Faili University of Tehran.
Lecturer : Ms. Abrar Mujaddidi S YNTAX. I NTRODUCTION  In the previous chapter, we moved from the general categories and concepts of traditional grammar,
SYNTAX.
Natural Language Processing Vasile Rus
General Information on Context-free and Probabilistic Context-free Grammars İbrahim Hoça CENG784, Fall 2013.
Lecture – VIII Monojit Choudhury RS, CSE, IIT Kharagpur
Modeling Grammaticality
SYNTAX.
Los sustantivos (Nouns)
CS 388: Natural Language Processing: Syntactic Parsing
Natural Language - General
David Kauchak CS159 – Spring 2019
Modeling Grammaticality
Artificial Intelligence 2004 Speech & Natural Language Processing
Presentation transcript:

FMZ Elaborazione del linguaggio naturale Fabio Massimo Zanzotto

FMZ Part five Feature Structures

FMZ Where we are? Target of the analysis: –interpret NL sentences with respect to a sort of anambiguos internal laguage Natural Languages is a ambiguous and social beast vs. Formal Languages is unambiguous and top-down decided Whats a language model: –treating infinite sentences with generative machinaries with a finite set of rules

FMZ How we proceeded so far... ASSIOM: A syntactic interpretation of a sentence helps in understanding its semantics Lets build a syntactic model for NL!! Analysis of the chomsky hierarchy Use of Context-free formalisms and related parsing algoritms –CYK –DCG (in prolog)

FMZ How we proceeded so far... OBSERVATION: NL is more difficult that what we may think Let us renounce to the total grammaticality!!! Model offering Partial Analysis –CYK –Chart parsing and early algorithm

FMZ Our Aim Lines of development Grammatical Representation Power: Build a formalism/model able to give the possibility of reducing the unnecessary interpretations Grammar Use: Build a formalism (and an associated algorithm) able to represent partial analysis

FMZ Our Aim Lines of development Grammatical Representation Power: CFG (context free grammars) DCG Grammar Use: CYK Chart and Early Algorithm

FMZ Observing natural language Toy Examples:... La vecchia porta la sbarra Il vecchio porta la sbarra Flying planes can be dangerous Flying planes is dangerous...

FMZ A sample Grammar (introspectively produced) S NP VP | S SBAR | SBAR S SBAR CongSub S S S CongCoord S | S, S CongCoord S NP NP SBAR VP VerbX NP | VerbX NP PP VerbX Verb | Modal Verb NP Art Noun | Art Adj Noun | Noun | Verb Noun | NP PP PP Prep NP

FMZ Observations The sample grammar is insufficient!! Spurious interpretations are produced for unambiguous sentences Loosing the eternal struggle between coverage and induced ambiguity NP Art Noun | Art Adj Noun | Noun | Verb Noun | NP PP... the old man carries apples... A) the old man (VP carries apples) B) the old man (NP carries apples)

FMZ Necessary extensions Introducing notions like: –gender: masculine, feminine –number: singular, plural –person (for verbs) –time (for verbs) –mood (for verbs)

FMZ Grammar Adding number (Sing, Plur) NPSing ArtSing NounSing NPPlur ArtPlur NounPlur VPSing VerbXSing NP | VerbXSing NP PP VPPlur VerbXPlur NP | VerbXPlur NP PP S NPSing VPSing | NPPlur VPPlur

FMZ Grammar Adding number (Sing, Plur) and gender (Mas, Fem) NPMasSing ArtMasSing NounMasSing NPFemSing ArtFemSing NounFemSing NPMasPlur ArtMasPlur NounMasPlur NPFemPlur ArtFemPlur NounFemPlur VPSing VerbXSing NP | VerbXSing NP PP VPPlur VerbXPlur NP | VerbXPlur NP PP S NPMasSing VPSing | NPFemSing VPSing | NPMasPlur VPPlur | NPFemPlur VPPlur !!Rules are uncontrollably proliferating!!

FMZ Feature Structures

FMZ What do we desire? Adding number (Sing, Plur) and gender (Mas, Fem) NPMasSing ArtMasSing NounMasSing NPFemSing ArtFemSing NounFemSing NPMasPlur ArtMasPlur NounMasPlur NPFemPlur ArtFemPlur NounFemPlur NP_Gen:X_Num:Y Art_Gen:X_Num:Y Noun_Gen:X_Num:Y

FMZ Feature Structures Feature structures (information containers) are: Sets of attribute-value pairs a value of an attribute may be: –a final value (i.e., an element from a set) –a feature structure Agreement: npCat: Gen: mas Num: sing

FMZ Feature Structures Formally if F is a feature structure, F is a set of pairs (f,v) given (f,v) F –v is a final value –v is a feature structure

FMZ Feature Structures: Lexicon nouns –forma_superficiale –lemma –genere –numero verbs –forma_superficiale –radice –coniugazione: are, ere, ire –genere: mas, fem –numero: sing, plur –persona: 1,2,3 –modo: indicativo, congiuntivo, imperativo –tempo: presente, passato,... –verso: attivo, passivo

FMZ Lexicon: examples forma_superficiale: mangeremo radice: mangi coniugazione: are numero: plur persona: 2 modo: indicativo tempo: futuro

FMZ Lexicon: examples forma_superficiale: mangerebbe radice: mangi lemma:mangiare coniugazione: are numero: sing persona: 3 modo: condizionale tempo: presente

FMZ Lexicon: examples forma_superficiale: uomini lemma:uomo numero: plur genere: mas

FMZ How to use the lexicon? luomo mangierebbe pere that may be seen: [forma_supericiale: l] [forma_supericiale: uomo] [forma_supericiale: mangierebbe] [forma_supericiale: pere] forma_superficiale: mangierebbe radice: mangi lemma:mangiare coniugazione: are numero:sing persona: 3 modo: condizionale tempo: presente

FMZ Comparing feature structures: subsumption A Feature Structure F 1 subsumes F 2 (F 1 F 2 ) if all the information that is in the F 1 is also in F 2 Formally, F 1 F 2 se e solo se v = v oppure (f,v) F 1 (f,v) F 2. v v

FMZ After the lexicon and the subsumption luomo mangierebbe pere that may be seen: [forma_supericiale: l] [forma_supericiale: uomo] [forma_supericiale: mangierebbe] [forma_supericiale: pere] forma_superficiale: mangierebbe radice: mangi lemma:mangiare coniugazione: are numero:sing persona: 3 modo: condizionale tempo: presente forma_superficiale:uomo lemma: uomo numero:sing genere:mas

FMZ What if? luomo mangierebbe pere that may be seen: [ forma_supericiale: l] [ forma_supericiale: uomo] [ forma_supericiale: mangierebbe, forma_fonologica: xxxx ] [ forma_supericiale: pere] forma_superficiale: mangierebbe radice: mangi lemma:mangiare coniugazione: are numero:sing persona: 3 modo: condizionale tempo: presente Subsumption is not sufficient!

FMZ Unification Unification is a partial operation between two feature structures so that the new feature structure contain all the information of the two F 1 F 2 is so that: –F 1 F 1 F 2 –F 2 F 1 F 2 –if H has the property F 1 H and F 2 H then F 1 F 2 H

FMZ Unification Example forma_superficiale: mangierebbe radice: mangi lemma:mangiare cat:verbo coniugazione: are numero:sing persona: 3 modo: condizionale tempo: presente forma_superficiale:mangierebbe forma_fonologica:xxx forma_superficiale: mangierebbe radice: mangi forma_fonologica:xxx lemma:mangiare cat:verbo coniugazione: are numero:sing persona: 3 modo: condizionale tempo: presente = =

FMZ Unification forma_superficiale: mangierebbe radice: mangi lemma:mangiare cat:verbo coniugazione: are numero:sing persona: 3 modo: condizionale tempo: presente forma_superficiale:mangia forma_fonologica:xxx Unification between two feature structures may not exist.

FMZ Coindexing What if we want to apply this rule? forma_superficiale: mangierebbe radice: mangi lemma:mangiare cat:verbo coniugazione: are numero:sing persona: 3 modo: condizionale tempo: presente forma_superficiale:uomo lemma: uomo cat:nome numero:sing genere:mas cat:scat:nome numero: [1] cat:verbo numero:[1] persona:3

FMZ Feature Structures in Prolog feature structures will be represented as a open list of attribute value pairs : (the colon) will be used to form attribute value pairs es. [number:sg, person:3 | _ ] [cat:np, agr:[number:sg, person:3 | _ ] | _ ]

FMZ Unification in Prolog unify0(Dag,Dag) :- !. unify0([Feature:Value|Rest],Dag) :- val(Feature,Value,Dag,StripDag), unify0(Rest,StripDag). val(Feature,Value1,[Feature:Value2|Rest],Rest) :- !, unify0(Value1,Value2). val(Feature,Value,[Dag|Rest],[Dag|NewRest]) :- !, val(Feature,Value,Rest,NewRest).

FMZ Where we worked today? Lines of development Grammatical Representation Power: Build a formalism/model able to give the possibility of reducing the unnecessary interpretations Grammar Use: Build a formalism (and an associated algorithm) able to represent partial analysis