| Aim: |
|
To describe an interpretation algorithm that uses the syntactic
analysis of a sentence together with grammar rules augmented by
feature information describing how the semantic analysis of a phrase
is derived from the semantic analyses of its constituents. We shall
show how this works for a simple grammar and then investigate a
few more complicated examples, including the handling of auxiliary
verbs, and prepositional phrases. The concepts of lambda-expression and lambda-reduction are central to the handling of certain grammar rules. |
| Reference: Chapter 9 of Allen, J.: Natural Language Understanding, 2nd ed., Benjamin Cummings, 1995. |
| Keywords: CNP, common noun phrase, lambda reduction, VAR feature |
| Plan: |
|
(KISS1 k1 (NAME j1 "Jack") (NAME s1 "Sue"))
is a predicate that takes one argument.
(lambda X (KISS1 k1 X (NAME s1 "Sue"))) (NAME j1 "Jack") *
(KISS1 k1 (NAME j1 "Jack") (NAME s1 "Sue"))
(lambda x (AT-LOC x <THE s1 STORE1>)).
(AT-LOC <THE m1 MAN1> <THE s1 STORE1>).
(S SEM (?semvp ?semnp)) → (NP SEM ?semnp) (VP SEM ?semvp)
The whole of the parse/semantic tree for this sentence (Mary sees Jack) is shown below (= Fig. 9.1 of Allen):
| 1 | (S SEM (?semvp ?semnp) → (NP SEM ?semnp) (VP SEM ?semvp) |
| 2 | (VP VAR ?v SEM (lambda a2 (?semv ?v a2)))→ (V[_none] SEM ?semv) |
| 3 | (VP VAR ?v SEM (lambda a3 (?semv ?v a3 ?semnp))) → (V[_np] SEM ?semv) (NP SEM ?semnp) |
| 4 | (NP WH - VAR ?v SEM (PRO ?v ?sempro)) → (PRO SEM ?sempro) |
| 5 | (NP VAR ?v SEM (NAME ?v ?semname)) → (NAME SEM ?semname) |
| 6 | (NP VAR ?v SEM (?semdet ?v : (?semcnp ?v)) → (DET SEM ?semdet) (CNP SEM ?semcnp)) |
| 7 | (CNP SEM ?semn) → (N SEM ?semn) |
Head_feature(S, VP, NP, CNP) = VAR
| a | (det AGR 3s SEM A) |
| can | (det SUBCAT base SEM CAN1) |
| car | (n SEM CAR1 AGR 3s) |
| cry | (v SEM CRY1 VFORM base SUBCAT _none) |
| decide | (v SEM DECIDES1 VFORM base SUBCAT _none) |
| decide | (v SEM DECIDES-ON1 VFORM base SUBCAT _pp:on) |
| dog | (n SEM DOG1 AGR 3s) |
| fish | (n SEM FISH1 AGR 3s) |
| fish | (n SEM (PLUR FISH1) AGR 3p) |
| house | (n SEM HOUSE1 AGR 3s) |
| has | (aux VFORM pres AGR 3s SUBCAT pastprt SEM perf) |
| he | (pro SEM HE1 AGR 3s) |
| in | (p PFORM { LOC MOT} SEM AT-LOC1) |
| Jill | (name AGR 3s SEM "Jill") |
| man | (n SEM MAN1 AGR 3s) |
| men | (n SEM (PLUR MAN1) AGR 3p) |
| on | (p PFORM {LOC, on} SEM ON-LOC1) |
| saw | (v SEM SEES1 VFORM past SUBCAT _np) |
| see | (v SEM SEES1 VFORM base SUBCAT _np IRREG-PAST + EN-PASTPRT +) |
| she | (pro SEM SHE1 AGR 3s) |
| the | (DET SEM THE AGR { 3s 3p} ) |
| to | <(to AGR - VFORM inf) |
The chart parser can be modified so that it handles semantic interpretation as follows:
Interpreting an example sentence: Jill saw the dog
(lambda x (<PAST SEES1> ev1 x (THE d1 (DOG1 d1))))
(<PAST SEES1> ev1 (NAME j1 "Jill") <THE d1 (DOG1 d1)>)
and VAR ev1 (after lambda-reduction).
Completed Parse Tree for Jill saw the dog (Fig. 9.5 Allen)

Auxiliary Verbs
(VP SEM (lambda a1 (?semaux (?semvp a1)))) →
(AUX SUBCAT ?v SEM ?semaux) (VP VFORM ?v SEM ?semvp)
(lambda a1 (CAN1 ( (lambda x (LAUGHS1 e3 x)) a1)))
Examples:
| The man | in the corner ate lunch. |
| PP modifies NP the man | |
| The dog barked | in the alley. |
| PP modifies VP barked | |
| She is ready to take | up the challenge. |
| up flags object of "take-up" |
(PP SEM (lambda y (?semp y ?semnp))) → (P SEM ?semp) (NP SEM ?semnp)
(lambda y (AT-LOC1 y <THE c1 CORNER1>))
(CNP SEM (lambda n1 (& (?semcnp n1) (?sempp n1)))) →
(CNP SEM ?semcnp) (PP SEM ?sempp)
[Here & means "and". It is used here as a prefix operator. Thus &(happy(fido), dog(fido)) would mean "Fido is happy and Fido is a dog". &(MAN1(x), IN_LOC1(x, <THE c1 CORNER1>)) means "x is a man and (&) x is in the corner".
cnp(P1, P3, cnp(SynCNP, SynPP),
lambda(N1, &(SemCNPN1, LR_Result)),
VarCNP) :-
SemCNPN1 =.. [SemCNP, N1],
cnp(P1, P2, SynCNP, SemCNP, VarCNP),
pP(P2, P3, SynPP, SemPP, VarPP),
lambda_reduce(SemPP,N1,LR_Result).
(lambda n1 (& (MAN1 n1) ((lambda y (AT-LOC1 y <THE c1 CORNER1>)) n1)))
(lambda n1 (& (MAN1 n1) (AT-LOC1 n1 <THE c1 CORNER1>)))
(THE m2 : ((lambda n1 (& MAN1 n1) (AT-LOC1 n1 <THE c1 CORNER1>))) m2))
which simplifies to
(THE m2 : (& (MAN1 m2) (AT-LOC1 m2 <THE c1 CORNER1>)))
(lambda a (& CRIES1 e1 a) (AT-LOC1 e1 <THE c1 CORNER1>))) and e1
(VP VAR ?v SEM (lambda x (& (?semvp x) (?sempp ?v)))) →
(VP VAR ?v SEM ?semvp) (PP SEM ?sempp)
[NB: This VP rule will be superseded by two more specific ones soon.]
You are now in a position to do all of the exercises at http://www.cse.unsw.edu.au/~cs9414/Exercises/semantics.html
Parse tree for cry in the corner using this rule: (Allen Fig. 9.6, corrected):
VP → V[_pp:on] PP[on]
(lambda s (DECIDES-ON1 d1 s <A c1 COUCH1>))
with <A c1 COUCH1> appearing as an argument.
| predicate: decide (while sitting) on a couch | = PRED + |
| argument: decide on (e.g. to buy) a couch | = PRED – |
(PP PRED + SEM (lambda x (?semp x ?semnp))) → (P SEM ?semp) (NP SEM ?semnp)
- interprets preposition as predicate
(PP PRED – PFORM ?pf SEM ?semnp) → (P ROOT ?pf) (NP SEM ?semnp)
- interprets the NP in the PP as an argument of the verb
(VP VAR ?v SEM (lambda x1 (& (?semvp x1) (?sempp ?v)))) →
(VP SEM ?semvp) (PP PRED + SEM ?sempp)
(VP VAR ?v SEM (lambda x2 (?semv ?v x2 ?sempp))) →
(V[_pp:on] SEM ?semvp) (PP PRED – PFORM on SEM ?sempp)


| Summary: Semantic Interpretation |
| The semantic interpretation algorithm is feature-driven: reading the augmented grammar rules right to left provides a description of how to build the SEM feature of the phrase described by the grammar rule. When the semantic description has a gap (as with VP), the SEM feature is a lambda-expression. |
CRICOS Provider Code No. 00098G
Copyright (C) Bill Wilson, 2006, except where another source is acknowledged.