Presentation is loading. Please wait.

Presentation is loading. Please wait.

FMZ Elaborazione del linguaggio naturale Fabio Massimo Zanzotto.

Similar presentations


Presentation on theme: "FMZ Elaborazione del linguaggio naturale Fabio Massimo Zanzotto."— Presentation transcript:

1 FMZ Elaborazione del linguaggio naturale Fabio Massimo Zanzotto

2 FMZ Part five Feature Structures

3 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

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

5 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

6 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

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

8 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...

9 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

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

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

12 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

13 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!!

14 FMZ Feature Structures

15 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

16 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

17 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

18 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

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

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

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

22 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

23 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

24 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

25 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!

26 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

27 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 = =

28 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.

29 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

30 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 | _ ] | _ ]

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

32 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


Download ppt "FMZ Elaborazione del linguaggio naturale Fabio Massimo Zanzotto."

Similar presentations


Ads by Google