CSA4050: Advanced Topics in NLP - PowerPoint PPT Presentation

1 / 25
About This Presentation
Title:

CSA4050: Advanced Topics in NLP

Description:

Determiners and Quantifiers in Language and Logic. x dog(x) ( y cat(x) & chase(x,y) ... Need to reorganise the semantic rules (NP applies to VP not vice versa) ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 26
Provided by: MikeR2
Category:

less

Transcript and Presenter's Notes

Title: CSA4050: Advanced Topics in NLP


1
CSA4050Advanced Topics in NLP
  • Semantics III
  • Quantified Sentences

2
Outline
  • Language
  • Sentences
  • Determiners
  • Noun Phrases
  • Syntactic Structure
  • Logic
  • Generalised Quantifiers
  • Higher order functions
  • Translation into Prolog

Syntax-Semantics Interface
3
Determiners and Quantifiers in Language and Logic
4
Syntactic Shape vs.Semantic Shape
  • John walkssemanticswalk(suzie).
  • Every man talkssemanticsall(X, man(X) ?
    talk(X))
  • S
  • NP VP
  • Suzie walks
  • S
  • NP VP
  • Det N talks
  • Every man

5
Problem
  • Similar syntactic shape
  • Dissimilar semantic shape
  • How is this possible if the syntax drives the
    combination of semantic fragments as per
    rule-to-rule hypothesis?
  • Answer be creative about logical forms and
    semantic combination rules

6
Montague Solution
  • Reorganising the semantic combination rules
    operating between VP and NP in rules such ass(S)
    --gt np(NP), vp(VP).
  • We will be considering NP(VP) versus
    VP(NP).
  • NPs as higher order functions
  • Analyse LF of quantified sentences

7
LF of Quantified Sentences
  • LF of quantified sentences has a general shape
    involving
  • a restrictor predicate R
  • a scope predicate S
  • R restricts the set of things we are talking
    about
  • S says something further about set element(s)
  • a logical quantifier Q
  • a bound variable V
  • a logical operator O connecting R and S

8
Examples
  • All lecturers are lazy
  • ?x lecturer(x) ? lazy(x)
  • Restrictor lecturers
  • Scope lazy
  • Quantifier All
  • Operator implies
  • Bound Variable x

9
Examples
  • There is a lazy lecturer
  • ?x lecturer(x) lazy(x)
  • Restrictor lecturers
  • Scope lazy
  • Quantifier exist
  • Operator and
  • Bound Variable x

10
Anatomy of Quantified Sentences
11
Generalized Quantifiers
  • We adopt the following generalized quantifier
    representation for LF in which quantifier is a
    3-place predicateQ(ltvariablegt,ltrestrictorgt,ltscop
    egt)
  • Operator is omitted.
  • Examplesall(X,man(X),walk(X))exist(X,man(X),walk
    (X))the(X,man(X),climbed(X,everest))most(X,lectu
    rer(X),poor(X))

12
NP as higher order function
13
Encoding in Prolog
  • The VP remains as before, ieXwalks(X)
  • The quantified NP every man will be of the
    formQall(X,man(X),Q)
  • The semantic rule for S now ensures that the NP
    function is applied to the VP function.s(S)--gt
    np(NP),vp(VP), reduce(NP,VP,S)

14
DCG with QuantificationProgram 1
  • grammar
  • s(S) --gt np(NP), vp(VP), reduce(NP,VP,S)
  • vp(VP) --gt v(V).
  • lexicon
  • v(Xwalk(X)) --gt walks.
  • np(Qall(X,man(X),Q)) --gt every,man.

15
Result
  • ?- s(X,every,man,walks,).
  • X all(_G397, man(_G397), _G405walk(_G405))
  • all(x, man(x), ywalk(y))
  • What is wrong with this?
  • How can we fix it?
  • We need to force the variables to be identical
    using reduce

16
Result
  • ?- s(X,every,man,walks,).
  • X all(_G397, man(_G397), _G405walk(_G405))
  • all(x, man(x), ywalk(y))
  • What is wrong with this?
  • The variables _G397 and _G405 are distinct. They
    should be identical.
  • The consequent of the implication is a ?
    expression
  • How can we fix it?
  • We need to force the variables to be identical
    using reduce

17
DCG with QuantificationProgram 2
  • grammar
  • s(S) --gt np(NP), vp(VP), reduce(NP,VP,S)
  • vp(VP) --gt v(V).
  • lexicon
  • v(Xwalk(X)) --gt walks.
  • np(Qall(X,man(X),P)) --gt every,man,
  • reduce(Q,X,P).

18
Result
  • ?- s(X,every,man,walks,).
  • X all(_G397, man(_G397),walk(_G397))
  • The effect of the reduce clause is
  • to identify the appropriate variables
  • to remove the ? variable

19
Handling Quantified NPs
  • Before we cheated by having every man as a
    lexical item.np(Qall(X,man(X),P))--gt
    every,man, reduce(Q,X,P).
  • Now we see what is involved in analysing the NP
    from its parts.
  • Step 1 is to write a new syntactic rulenp(NP)
    --gt d(D), n(N).
  • How does the semantics work?

20
LF of determiners
  • Key idea is determiner has LF of a 2-argument
    function corresponding to R and S which become
    bound during processing.
  • ?R.?S.Q(V,R,S)
  • where Q is associated with the particular
    determiner
  • When we apply this function to the adjacent noun,
    we obtain the LF of the NP.

21
How NP is created
22
Fitting the Semantics Together
  • Handle the quantified NPnp(NP) --gt d(D), n(N),
    reduce(D,N,NP).
  • Add lexical entry for every
  • d(RLSLall(X,R,S)) --gtevery,
    reduce(RL,X,R), reduce(SL,X,S) .

23
DCG with QuantificationProgram 3
  • grammar
  • s(S) --gt np(NP), vp(VP), reduce(NP,VP,S).
  • np(NP) --gt d(D), n(N), reduce(D,N,NP) .
  • vp(VP) --gt v(VP).
  • lexicon
  • v(Xwalk(X)) --gt walks.
  • n(Xman(X)) --gt man.
  • d(RLSLall(X,R,S) --gt every,
    reduce(RL,X,R),
    reduce(SL,X,S) .

24
Trace
  • gt (7) s(_G510, every, man, walks, )
  • gt (8) np(_L183, every, man, walks, _L184)
  • gt (9) d(_L205, every, man, walks, _L206)
  • lt (9) d((XR) (XS)all(X, R, S), every, man,
    walks, man, walks)
  • gt (9) n(_L207, man, walks, _L208)
  • lt (9) n(Zman(Z), man, walks, walks)
  • gt (9) reduce((XR) (XS)all(X, R, S),
    Zman(Z), _L183)
  • lt (9) reduce((Xman(X)) (XS)all(X, man(X),
    S), Xman(X), (XS)all(X, man(X), S))
  • lt (8) np((XS)all(X, man(X), S), every, man,
    walks, walks)
  • gt (8) vp(_L185, walks, _L186)
  • gt (9) v(_L185, walks, _L186)
  • lt (9) v(Ywalk(Y), walks, )
  • lt (8) vp(Ywalk(Y), walks, )
  • gt (8) reduce((XS)all(X, man(X), S), Ywalk(Y),
    _G510)
  • lt (8) reduce((Xwalk(X))all(X, man(X),
    walk(X)), Xwalk(X), all(X, man(X), walk(X)))
  • lt (7) s(all(X, man(X), walk(X)), every, man,
    walks, )

25
Summary
  • Quantification crops up a lot in NL
  • To handle quantified sentences, there is a
    mismatch in shape between syntax and semantics
  • Need to reorganise the semantic rules (NP applies
    to VP not vice versa).
  • Representation of quantifier as a higher-order
    function.
Write a Comment
User Comments (0)
About PowerShow.com