460 likes | 472 Views
Dive into the world of computational linguistics semantics, exploring logical representations and algorithms for inference applications. Learn about collocational semantics and the challenges of syntax-semantics interfaces.
E N D
Issues in Computational Linguistics:Semantics Dick Crouch & Tracy King
Overview • What is semantics?: • Aims & challenges of syntax-semantics interface • Introduction to Glue Semantics: • Linear logic for meaning assembly • Topics in Glue • The glue logic • Quantified NPs • Type raising & intensional verbs • Coordination • Control • Skeletons and modifiers
All men are mortal Socrates is a man Socrates is mortal x. man(x) mortal(x)man(socrates) mortal(socrates) What is Semantics? • Traditional Definition: • Study of logical relations between sentences • Formal Semantics: • Map sentences onto logical representations making relations explicit • Computational Semantics • Algorithms for inference/knowledge-based applications
Logical & Collocational Semantics • Logical Semantics • Map sentences to logical representations of meaning • Enables inference & reasoning • Collocational semantics • Represent word meanings as feature vectors • Typically obtained by statistical corpus analysis • Good for indexing, classification, language modeling, word sense disambiguation • Currently does not enable inference • Complementary, not conflicting, approaches
What does semantics have that f-structure doesn’t? • Repackaged information, e.g: • Logical formulas instead of AVMs • Adjuncts wrap around modifiees • Extra information, e.g: • Aspectual decomposition of eventsbreak(e,x,y) & functional(y,start(e)) & functional(y,end(e)) • Argument role assignmentsbreak(e) & cause_of_change(e,x) & object_of_change(e,y) • Extra ambiguity, e.g: • Scope • Modification of semantic event decompositionse.g. Ed was observedputting up a deckchair for 5 minutes
Syntax (f-structure) Semantics (logical form) PRED break<SUBJ> w. wire(w) & w=part25 & t. interval(t) & t<now & e. break_event(e) & occurs_during(e,t) & object_of_change(e,w) & c. cause_of_change(e,c) SUBJ PRED wire SPEC def TENSE past NUM sg Example Semantic Representation The wire broke • F-structure gives basic predicate-argument structure, but lacks: • Standard logical machinery (variables, connectives, etc) • Implicit arguments (events, causes) • Contextual dependencies (the wire = part25) • Mapping from f-structure to logical form is systematic, but can introduce ambiguity (not illustrated here)
parse Object Code Execution Computer Program compile parse Logical Form Inference NL Utterance interpret Mapping sentences to logical forms • Borrow ideas from compositional compilation of programming languages (with adaptations)
The Challenge to CompositionalityAmbiguity & context dependence • Strict compositionality (e.g. Montague) • Meaning is a function of (a) syntactic structure, (b) lexical choice, and (c) nothing else • Implies that there should be no ambiguity in absence of syntactic or lexical ambiguity • Counter-examples? (no syntactic or lexical ambiguity) • Contextual ambiguity • John came in. He sat down. So did Bill. • Semantic ambiguity • Every man loves a woman. • Put up a deckchair for 5 minutes • Pets must be carried on escalator • Clothes must be worn in public
Semantic Ambiguity • Syntactic & lexical ambiguity in formal languages • Practical problem for program compilation • Picking the intended interpretation • But not a theoretical problem • Strict compositionality generates alternate meanings • Semantic ambiguity a theoretical problem, leading to • Ad hoc additions to syntax (e.g. Chomskyan LF) • Ad hoc additions to semantics (e.g. underspecification) • Ad hoc additions to interface (e.g. quantifier storage)
Weak Compositionality • Weak compositionality • Meaning of the whole is a function of (a) the meaning of its parts, and (b) the way those parts are combined • But (a) and (b) are not completely fixed by lexical choice and syntactic structure, e.g. • Pronouns: incomplete lexical meanings • Quantifier scope: combination not fixed by syntax • Glue semantics • Gives formally precise account of weak compositionality
Modular Syntax-Semantics Interfaces • Different grammatical formalisms • LFG, HPSG, Categorial grammar, TAG, minimalism, … • Different semantic formalisms • DRT, Situation semantics, Intensional logic, … • Need for modular syntax-semantics interface • Pair different grammatical & semantic formalisms • Possible modular frameworks • Montague’s use of lambda-calculus • Unification-based semantics • Glue semantics (interpretation as deduction)
Some Claims • Glue is a general approach to the syntax-semantics interface • Alternative to unification-based semantics, Montagovian λ-calculus • Glue addresses semantic ambiguity/weak compositionality • Glue addresses syntactic & semantic modularity • (Glue may address context dependence & update)
Glue Semantics Dalrymple, Lamping & Saraswat 1993 and subsequently • Syntax-semantics mapping as linear logic inference • Two logics in semantics: • Meaning Logic (target semantic representation) any suitable semantic representation • Glue Logic (deductively assembles target meaning) fragment of linear logic • Syntactic analysis produces lexical glue premises • Semantic interpretation uses deduction to assemble final meaning from these premises
Linear Logic • Influential development in theoretical computer science (Girard 87) • Premises are resources consumed in inference (Traditional logic: premises are non-resourced) Traditional Linear A, AB |= B A, A -o B |= B A, AB |= A&B A, A -o B |= AB A re-usedA consumed A, B|= B A, B|= B A discarded Cannot discard A / / • Linguistic processing typically resource sensitive • Words used exactly once
Glue Interpretation (Outline) • Parsing sentence instantiates lexical entries to produce lexical glue premises • Example lexical premise (verb “saw” in “John saw Fred”): see : g -o (h -o f) Meaning Term Glue Formula 2-place predicate g, h, f: constituents in parse “consume meanings of g and h to produce meaning of f” • Glue derivation |= M : f • Consume all lexical premises , • to produce meaning, M, for entire sentence, f
Syntactic Analysis: S see PRED NP VP g: PRED John f: SUBJ NP V h: OBJ PRED Fred John saw Fred Glue Interpretation Getting the premises Lexicon: John NP john: Fred NP fred: saw V see: SUBJ-o (OBJ-o) Premises: john: g fred: h see: g -o(h -of)
Linear Logic Derivation g -o(h -of) g h -of h f Using linear modus ponens Derivation with Meaning Terms see: g -o(h -of)john: g see(john) : h -of fred: h see(john)(fred): f Linear modus ponens = function application Glue InterpretationDeduction with premises Premises john: g fred: h see: g -o(h -of)
Fun: Arg: Fun(Arg): g -o f g f Modus Ponens = Function ApplicationThe Curry-Howard Isomorphism Curry Howard Isomorphism: Pairs LL inference rules with operations on meaning terms Propositional linear logic inference constructs meanings LL inference completely independent of meaning language (Modularity of meaning representation)
Alleged criminal from London PRED criminal f: alleged ADJS from London Semantic AmbiguityMultiple derivations from single set of premises Premises criminal: f alleged: f -o f from-London: f -o f Two distinct derivations: 1. from-London(alleged(criminal)) 2. alleged(from-London(criminal))
Quantifier Scope Ambiguity • Every cable is attached to a base-plate • Has 2 distinct readings • x cable(x) y plate(y) & attached(x,y) • y plate(y) & x cable(x) attached(x,y) • Quantifier scope ambiguity accounted for by mechanism just shown • Multiple derivations from single set of premises • More on this later
Semantic Ambiguity & Modifiers • Multiple derivations from single premise set • Arises through different ways of permuting -omodifiers around an skeleton • Modifiers given formal representation in glue as -ological identities • E.g. an adjective is a noun -onounmodifier • Modifiers prevalent in natural language, and lead to combinatorial explosion • Given N -omodifiers, N! ways of permuting them around an skeleton
Packing & Ambiguity Management • Exploit explicit skeleton-modifier of glue derivations to implement efficient theorem provers that manage combinatorial explosion • Packing of N! analyses • Represent all N! analyses in polynomial space • Compute representation in polynomial time • Read off any given analysis in linear time • Packing through structure re-use • N! analyses through combinations of N sub-analyses • Compute each sub-analysis once, and re-use • Combine with packed output from XLE
Summary • Glue: semantic interpretation as (linear logic) deduction • Syntactic analysis yields lexical glue premises • Standard inference combines premises to construct sentence meaning • Resource sensitivity of linear logic reflects resource sensitivity of semantic interpretation • Gives modular & general syntax-semantics interface • Models semantic ambiguity / weak compositionality • Leads to efficient implementations
Topics in Glue • The glue logic • Quantified NPs and scope ambiguity • Type raising and intensionality • Coordination • Control • Why glue is a good computational theory
Hypothetical reasoning /-o elimination Assume aand thusprove b a implies b(discharging assumption) x: F(x): λx.F(x): [ a] : b a –o b a a-o b b Two Rules of Inference Modus ponens /-o elimination A: F: F(A): Have shown that there is some functiontaking arguments, x, of type ato give results, F(x), of type b.Call this function λx.F(x), of type a –o b F is a function of type a –o bthat takes arguments of type ato give results of type b
A roundabout proof of f from g -o f and g A direct proof of ffrom g –o f and g [g] g -o f f g –o f g f g g –o f f λ-terms describe propositional proofs • Intimate relation between λ-calculus and propositional inference (Curry-Howard) • λ-terms are descriptions of proofs • Equivalent λ-terms mean equivalent proofs x: F: F(x): λx.F(x): A: (λx.F(x))(A): A: F: F(A): By λ-reduction: (λx.F(x))(A) = F(A)
Digression: Structured Meanings • Glue proofs as an intermediate level of structure in semantic theory • Identity conditions given by λ-equivalence • Used to explore notions of semantic parallelism (Asudeh & Crouch) • Unlike Montague semantics • MS allows nothing between syntax and model theory. • Logical formulas are not linguistic structures; cannot build theories off arbitrary aspects of their notation • Unlike Minimal Recursion Semantics • MRS uses partial descriptions of logical formulas • A theory built off aspects of logical notation
Two kinds of semantic resource • Some nodes, n, in f-structure gives rise to entity-denoting semantic resources, e(n) • e(n) is a proposition stating that n has an entity-denoting resource • Other nodes, n, give rise to proposition/truth-value denoting semantic resources, t(n) • t(n) is a proposition stating that n has a truth-denoting resource • Notational convenience: • Write e(n) as ne, or just n (when kind of resource is unimportant) • Write t(n) as nt, or just n (when kind of resource is unimportant)
Variables over f-structure nodes • The glue logic allows universal quantification over f-structure nodes, e.g.N. (e(g) –o t(N)) –o t(N) • Important for dealing with quantified NPs • But the logic is still essentially propositional • Quantification allows matching of variable propositions with atomic propositions, e.g. t(N) with t(f) • Notational Convenience: • Drop explicit quantifiers, and write variables over nodes as upper case letters, e.g. (ge –o Nt) –o Nt
sleep PRED f: sleep PRED g: PRED John f: SUBJ PRED everyoneQUANT + g: SUBJ sleep: ge –o fteveryone: (ge –o Xt) –o Xt everyone(sleep): ft john: g sleep: g –o f sleep(john): f Non-Quantified and Quantified NPs sleep: ge –o ft john: ge sleep: ge –o ft everyone: (ge –o Xt) –o Xt everyone = λP.x.person(x)P(x)everyone(sleep) = λP.x.person(x)P(x)[sleep] = x.person(x)sleep(x)
see PRED g: everyone SUBJ h: someone f: OBJ see:g –o h –o f [x:g]see(x): h –o f [y:h] see(x,y): f f(g –o X) –o X g –o f f (h –o Y) –o Y h –o f see:f fh –o f (h –o Y) –o Y f g –o f (g –o X) –o X see:f Quantifier Scope AmbiguityTwo derivations see: g –o h –o f:(g –o X) –o X :(h –o Y) –o Y
see PRED g: everyone SUBJ h: someone f: OBJ Quantifier Scope AmbiguityTwo derivations see: g –o h –o f:(g –o X) –o X :(h –o Y) –o Y see:g –o h –o f [x:g]see(x): h –o f [y:h] see(x,y): f see(x,y): f:(g-oX)-oX λx.see(x,y): g-o f λx.see(x,y): f :(h-oY)-oYλyλx.see(x,y): h-of λyλx.see(x,y): f see(x,y): fλy.see(x,y): h-o f :(h-oY)-oY λy.see(x,y): f λxλy.see(x,y): h-of :(g-oX)-oX λxλy.see(x,y): f
No Additional Scoping Machinery • Scope ambiguities arise simply through application of the two standard rules of inference for implication • Glue theorem prover automatically finds all possible derivations / scopings • Very simple and elegant account of scope variation.
Type Raising and Intensionality • Intensional verbs (seek, want, dream about) • Do not take entities as arguments * x. unicorn(x) & seek(ed, x) • But rather quantified NP denotationsseek(ed, λP.x unicorn(x) & P(x)) • Glue lexical entry for seek λxλQ. seek(x,Q): SUBJ –o (subject entity, x) ((OBJ –o Nt) –o Nt) –o (object quant, Q) (clause meaning)
seek PRED g: Ed SUBJ h: a unicorn f: OBJ Derivation (without meanings) g g –o ((h –o Y) –o Y) –o f ((h –o Y) –o Y) –o f (h –o X) –o X f Derivation (with meanings) ed: g λxλQ.seek(x,Q): g –o ((h –o Y) –o Y) –o f λQ.seek(ed,Q):((h –oY)–oY)–of λP.x unicorn(x) & P(x):(h–oX)–oX seek(ed, λP.x unicorn(x) & P(x)): f Ed seeks a unicorn ed: g λP.x unicorn(x) & P(x)) : (h –o X) –o XλxλQ. seek(x,Q): g –o ((h –o Y) –o Y) –o f
seek PRED g: Ed SUBJ h: Santa f: OBJ Ed seeks Santa Claus ed: g santa: h λxλQ. seek(x,Q): g –o ((h –o Y) –o Y) –o f • Looks problematic • “seek” expects a quantifier from its object • But we only have a proper name • Traditional solution (Montague) • Uniformly give all proper names a more complicated, type-raised, quantifier-like semanticsλP.P(santa) : (h –o X) –o X • Glue doesn’t force you to do this • Or rather, it does it for you
santa: h [P: h –o X] P(santa): X λP. P(santa):(h –o X) –o X Type Raising in Glue h [h –o X] X (h –o X) –o X Propositional tautology h |- (h –o X) –o X
seek PRED g: Ed SUBJ h: Santa f: OBJ g g –o ((h –o Y) –o Y) –o f ((h –o Y) –o Y) –o f seek(ed, λP. P(santa)):f santa: h [P: h –o X] P(santa): X λP. P(santa):(h –o X) –o X Ed seeks Santa Claus ed: g santa: h λxλQ. seek(x,Q): g –o [(h –o Y) –o Y] –o f Glue derivations will automatically type raise, when needed
PRED eat SUBJ Ed PRED drink SUBJ CoordinationIncorrect Treatment ed: g eat: g –o f1 drink: g –o f2 and: f1 –o f2 –o f Resource deficit: There aren’t enough g’s to go round
PRED eat SUBJ Ed PRED drink SUBJ λP1P2x. P1(x)&P2(x):(g–o f1) –o (g–o f2) –o (g–o f)eat:g –o f1 λP2x.eat(x)&P2(x):(g–o f2) –o (g–o f) drink: g –o f2 ed: g λx.eat(x)&drink(x): (g–of) eat(ed)&drink(ed): f Coordination: Correct Treatment ed: g eat: g –o f1 drink: g –o f2 λP1 λP2 λx. P1(x)&P2(x): (g –o f1) –o (g –o f2) –o (g –o f)
Resolving Apparent Resource Deficits • Deficit: • Multiple consumers for some resource g • But only one instance of g • Resolution • Consume the consumers of g, until there is only one • Applies to coordination, and also control
PRED want<SUBJ, XCOMP>SUBJ Ed XCOMP PRED sleep<SUBJ>SUBJ Control: Apparent resource deficit want: e –o s –o wsleep: e –o s ed: e Resource Deficit: Not enough e’s to go round Resolve in same way as for coordination
PRED want<SUBJ, XCOMP>SUBJ Ed XCOMP PRED sleep<SUBJ>SUBJ ed: e want: e –o (e –o s) –o wwant(ed): (e –o s) –o w sleep: e –o s want(ed,sleep): w Control: Deficit resolved want: e –o (e –o s) –o wsleep: e –o s ed: e Does this commit you to a property analysis of control? i.e. want takes a property as its second argument
ed: e λxλP.want(x,P): e –o (e –o s) –o wλP.want(ed,P): (e –o s) –o w sleep: e –o s want(ed,sleep): w Property and/or Propositional Control Property Control λxλP.want(x,P): SUBJ –o (SUBJ –o XCOMP) –o Propositional Control λxλP. want(x, P(x)): SUBJ –o (SUBJ –o XCOMP) –o ed: e λxλP.want(x,P(x)): e –o (e –o s) –o wλP.want(ed,P(ed)): (e –o s) –o w sleep: e –o s want(ed,sleep(ed)): w
Lexical Variation in Control • Glue does not commit you to either a propositional or a property-based analysis of controlled XCOMPs (Asudeh) • The type of analysis can be lexically specified • Some verbs get property control • Some verbs get propositional control
Why Glue Makes Computational Sense • The backbone of glue is the construction of propositional linear logic derivations • This can be done efficiently • Combinations of lexical meanings determined solely by this propositional backbone • Algorithms can factor out idiosyncracies of meaning expressions • Search for propositional backbone can further factor out skeleton (α) from modifier (α –o α) contributions, leading to efficient free choice packing of scope ambiguities • Work still in progress