88-680 1
Text Books
Text Books
עיבוד שפות טבעיות - שיעור אחד עשר
Unification (cont.)Semantics
עידו דגן
המחלקה למדעי המחשב
אוניברסיטת בר אילן
88-680 2
Text Books
Text Books
Feature structures in the grammar
• CF grammar rules can be augmented with feature structures and with unification operations to express constraints on the constituents of a rule
• An example notation (the PATR-II formalism):β 0 β 1... β n {set of constraints}– Where the constraints have one of the following two
forms:• < βi feature path> =(unify) atomic value
• < βi feature path> =(unify) < βj feature path>
– e.g.S NP VP<NP NUMBER> = <VP NUMBER>
88-680 3
Text Books
Text Books
Feature structures in the grammar
• S NP VP{NP AGREEMENT} = {VP AGREEMENT}– This flight serves breakfast– These flights serve breakfast
• S Aux NP VP{Aux AGREEMENT} = {NP AGREEMENT}– Does this flight serve breakfast?– Do these flights serve breakfast?
88-680 4
Text Books
Text Books
Feature structures in the grammar
• NP Det Nominal<Det AGREEMENT> = <Nominal AGREEMENT><NP AGREEMENT> = <Nominal AGREEMENT>– this flight vs. these flights
88-680 5
Text Books
Text Books
Feature structures in the grammar
• Lexical constituents receive their agreement features directly from the lexicon– Aux does
<Aux AGREEMENT NUMBER> = sg<Aux AGREEMENT PERSON> = 3
– Det this<Aux AGREEMENT NUMBER> = sg
– Det these<Aux AGREEMENT NUMBER> = pl
88-680 6
Text Books
Text Books
Feature structures in the grammar
• Verb serve<Verb AGREEMENT NUMBER> = pl
• Verb serves<Verb AGREEMENT NUMBER> = sg<Verb AGREEMENT PERSON> = 3
• Non-lexical constituents(e.g. VPs) receive agreement values from their constituents
• VP Verb NP<VP AGREEMENT> = <Verb AGREEMENT>
88-680 7
Text Books
Text Books
Feature structures in the grammar
• Agreement (NP and Nominal)– Noun flight
<Noun AGREEMENT NUMBER> = sg– Noun flights
<Noun AGREEMENT NUMBER> = pl– Nominal Noun
<Nominal AGREEMENT> = <Noun AGREEMENT>
88-680 8
Text Books
Text Books
Feature structures in the grammar• For most grammatical categories, the features are
copied from one child to the parent• The child that provides the features is called the head
of the phrase (the features are the head features)– VP Verb NP
<VP AGREEMENT> = <Verb AGREEMENT>– NP Det Nominal
<Det AGREEMENT> = <Nominal AGREEMENT><NP AGREEMENT> = <Nominal AGREEMENT>
– Nominal Noun<Nominal AGREEMENT> = <Noun AGREEMENT>
88-680 9
Text Books
Text Books
Subcategorization
• VP Verb {VP SUBCAT} = INTRANS
• VP Verb NP {VP SUBCAT} = TRANS
• VP Verb NP NP {VP SUBCAT} = DITRANS
88-680 10
Text Books
Text Books
88-680 11
Text Books
Text Books
Semantics
88-680 12
Text Books
Text Books
Representing Meaning
• Up to now, we have not focussed at all on what things mean.
• How does one represent meaning?
• meaning representations:representations that bridge that gap from linguistic forms to knowledge of the world.
88-680 13
Text Books
Text Books
Meaning Representations
• What can serve as a meaning representation...
• Anything that serves the core practical purposes of a program that is doing semantic processing: – Answering questions– Determining truth– Making inferences
88-680 14
Text Books
Text Books
semantic analysis
הפעולה של השמת מבני משמעות לרכיבים • semanticלשוניים נקראת ניתוח סמנטי
analysis
88-680 15
Text Books
Text Books
The architectureSentence
Parsing
Parse Tree
Semantic Analysis
Semantic Representation
Syntactic Structure
88-680 16
Text Books
Text Books
Applications
• Ideally, applications would interact with the semantic representation of texts.
• Need a representation which is unambiguous, even though the text is ambiguous.
88-680 17
Text Books
Text Books
Problem of Ambiguity
אין התאמה חח“ע בין משפט ובין הייצוג •הסמנטי שלו (רב משמעות) וגם לא להפך:
88-680 18
Text Books
Text Books
Canonical Form
• Inputs that mean the same thing should have the same meaning representation!
ייצוג משמעות אחיד לקלטים שונים נקרא •canonical form
מאפשר פישוט של תהליך ההסקה, אם •המערכת צריכה להתמודד רק עם ייצוג
יחיד.
88-680 19
Text Books
Text Books
Canonical Form
• John gave a car to Mary
• Mary was given a car by John
• give(John, Mary, a car)
• ∃x y : give(x) ∃ ∧ agent(x, John) ∧ recipient(x,Mary) ∧ object(x,y) ∧ car(y)
88-680 20
Text Books
Text Books
Example
• Every bird lives on a tree
• Quantifier and word sense ambiguities.
• ∀x bird(x) y : tree∃ 1(y) ∧ live_ on(x,y)
• ∃y tree1(y): x bird(x) ∀ live_on(x,y)
88-680 21
Text Books
Text Books
FOPC – First Order Predicate Logic
• Meaning Structure of Language • Choice of FOPC isn't completely arbitrary or
driven by the needs of applications... • Human languages:
– display a basic predicate-argument structure– make use of variables – make use of quantifers – display a partially compositional semantics
88-680 22
Text Books
Text Books
Predicate Argument Structure
בכל השפות המדוברות מבנה הפרדיקט-ארגומנטים •הוא הגרעין והיסוד של המשמעות בשפה.
ההנחה הגסה הראשונה היא, אם כן, שבמשפט קיים •יחס כלשהו בין המושגים המובעים במילים שבו
וברכיביו השונים.אותו יחס הוא הבסיס לייצוג הסמנטי שיש למשפט.•אחד התפקידים החשובים של התחביר הוא לתת •
מסגרת שתאפשר בנייה של אותו ייצוג, והייצוג צריך שיהיה לו קשר הדוק עם אותו מבנה תחבירי.
88-680 23
Text Books
Text Books
Predicate Argument Structure
• Predicate-like elements: – Verbs, VPs, prepositions, adjectives, some
nouns.
• Argument-like elements: – Nouns, Nominals, NPs, etc
88-680 24
Text Books
Text Books
Example
• “John gave Mary the book”
• Giving(John, Mary, book)
• ∃x,y: Giving(x) Giver(John,x) ∧ ∧Givee(Mary,x) Given(y,x) ∧ ∧ Book(y)
88-680 25
Text Books
Text Books
Semantic Analysis
• Syntax driven semantics:– Most methods rely in some way on a prior or
concurrent syntactic analysis (parse).
• Compositional Semantics:– at the core of most methods is the principle of
compositionality which states that the meaning of the whole is based on the meaning of parts.
– What are the parts?
Words and syntactic constructs
88-680 26
Text Books
Text Books
Augmented CF Rules
• Verb serves{x y e IsA(e, serving) ∃ ∧ server(e,y) ∧ served(e,x) }
• S NP VP {VP.sem(NP.sem) }
• VP Verb NP {Verb.sem(NP.sem)}
• MassNoun Meat {Meat}• ProperNoun AyCaramba {AyCaramba}
88-680 27
Text Books
Text Books
88-680 28
Text Books
Text Books
88-680 29
Text Books
Text Books
Determiners
88-680 30
Text Books
Text Books
Issues
• How to represent tense and aspect?
• Idioms (are not compositional)!
• Pragmatics (extra-syntactic)!
• Inference
• And much more…
88-680 31
Text Books
Text Books
Ambiguity Resolution
• Still have problem of ambiguity resolution:– Word sense disambiguation– Attachment ambiguity resolution
88-680 32
Text Books
Text Books
WSD
• Problem: many words have different meanings or senses, i.e., there is ambiguity about how they are to be specifically interpreted (e.g., differentiate).
• Task: to determine which of the senses of an ambiguous word is invoked in a particular use of the word by looking at the context of its use.
88-680 33
Text Books
Text Books
Word Senses
• Bank – The rising ground bordering a lake, river, or sea – An establishment for the custody, loan exchange, or issue of money,
for the extension of credit, and for facilitating the transmission of funds
• Title – Name/heading of a book, statue, work of art or music, etc.– Material at the start of a film – The right of legal ownership (of land) – The document that is evidence of the right – An appellation of respect attached to a person’s name – A written work (synecdoche: part stands for the whole)
88-680 34
Text Books
Text Books
Solution
• look at the words around an ambiguous word in a large context window. Each word contributes potentially useful information about which sense of the ambiguous word is likely to be used with it.
• Apply a supervised learning mechanism
88-680 35
Text Books
Text Books
WordNet
• on-line lexical reference system, linguistically motivated
• nouns, verbs, adjectives, adverbs are organized into synonym sets (lexical concepts),
• contains a taxonomy of about 100,000 words
88-680 36
Text Books
Text Books
WordNet
• semantic relationships represented– Synonymy: similarity of work meaning, concepts
as sets of words– Antonymy: dichotomy in meaning of words, used
for organizing adjectives and adverbs– Hyponymy: IS-A relationships Superconcept to
Subconcepts– Meronymy: Part-Of relationships between
concepts– Morphological Relationships: used to reduce
word forms