24
1/24 Predicate Calculus Representing meaning

Predicate Calculus

  • Upload
    donar

  • View
    45

  • Download
    1

Embed Size (px)

DESCRIPTION

Predicate Calculus. Representing meaning. Revision. First-order predicate calculus Typical “semantic” representation Quite distant from syntax But still clearly a linguistic level of representation (it uses words, sort of). Types of representation. 5. Predicate calculus. - PowerPoint PPT Presentation

Citation preview

Page 1: Predicate Calculus

1/24

Predicate Calculus

Representing meaning

Page 2: Predicate Calculus

2/24

Revision• First-order predicate calculus• Typical “semantic” representation• Quite distant from syntax• But still clearly a linguistic level of

representation (it uses words, sort of)

Page 3: Predicate Calculus

3/24

Types of representation

The man owned the gun which he used to shoot an elephant

5. Predicate calculus

An elephant was shot by the man with his gunThe man used his gun to shoot an elephant

event(e) & time(e,past) & pred(e,shoot) & man(a) & the(a) & (b) & dog(b) & shoot(a,b) & (c) & gun(c) & own(a,c) & use(a,c,e)

The man shot an elephant with his gun

The man used the gun which he owned to shoot an elephant

Page 4: Predicate Calculus

4/24

First-order predicate calculus

• Computationally tractable• Well understood, mathematically sound• Therefore useful for inferencing,

expressing equivalence• Can be made quite shallow (almost like

a deep structure), or quite abstract• Good for expressing facts and relations• Therefore good for question-answering,

information retrieval

Page 5: Predicate Calculus

5/24

First-order predicate calculus

• Predicates – express relationships between objects, e.g. father(x,y), or properties of objects, e.g. man(x)

• Functions –can be evaluated to objects, e.g. fatherof(x)

• Constants – specific objects in the “world” being described

• Operators (and, or, implies, not) and quantifiers (, )

Page 6: Predicate Calculus

6/24

Logic operators and quantifiers

• Universal quantifier (‘all’)– All dogs are mammals:

x dog(x) mammal(x)– Dogs are mammals, The dog is a mammal– A dog is a mammal

• Existential quantifier (‘there exists’)– John has a car : x car(x) & own(john,x)

Page 7: Predicate Calculus

7/24

Quantifier scope• Every man loves a woman

– Ambiguous in natural languagex man(x) x woman(y) love(x,y)x woman(y) x man(x) love(x,y)

• Every farmer who owns a donkey beats it– What does ‘it’ refer to?x (farmer(x) & y donkey(y) own(x,y)) beat(x,y)

Page 8: Predicate Calculus

8/24

Quantifiers• Natural language has many and

various quantifiers, some of which are difficult to express in FOPC:– many, most, some, few, one, three, at

least one, ...– often, usually, might, ...

Page 9: Predicate Calculus

9/24

Ambiguity with negatives• Every student did not pass an exam

x student(x) x exam(y) pass(x,y)y exam(y) x student(x) pass(x,y)x student(x) x exam(y) pass(x,y)

• All women don’t love fur coats• No smoking seats are available• I don’t think he will come (neg raising)• I don’t know he will come ~ I know he won’t come

Page 10: Predicate Calculus

10/24

Combinatorial explosion• Quantifier ambiguities can

be compounded• “Many people feel that

most sentences exhibit too few quantifier scope ambiguities for much effort to be devoted to this problem, but a casual inspection of several sentences from any text should convince almost everyone otherwise.” (Jerry Hobbs)

• On top of other ambiguities (e.g. attachment)

Quantifiers

Readings

4 145 426 1327 4298 1430

Page 11: Predicate Calculus

11/24

First-order predicate calculus

• In a quite shallow FOPC representation we can closely map verbs, nouns and adjectives onto predicates– man(x), fat(x), standup(x), see(x,y), give(x,y,z)

– Proper names map onto objects, e.g. man(john), see(john,mary)

Page 12: Predicate Calculus

12/24

• Grammatical meanings can be expressed as predicates

• e.g. A man eats icecream with a spoon X man(x) & y icecream(y) & z spoon(z) & eats(x,y) & uses(x,z)

• A man shot an elephant in his pyjamasx man(x) & y elephant(y) & shot(x,y) & z pyjamas(z) & owns(x,z) & ...

wearing(x,z)loc(y,z)

(wearing(x,z) | wearing(y,z) | loc(y,z)) | loc(x,z))

wearing(y,z)loc(x,z)

Page 13: Predicate Calculus

13/24

First-order predicate calculus

• We can use operators of predicate calculus to express aspects of meaning that are implicit, and thereby extract new meaning from new utterancese.g. eats(x,_) & uses(x,y) holds(x,y)

• Or make inferences e.g. gives(x,y,z) has(x,z) & has(x,y)

Page 14: Predicate Calculus

14/24

Tense and time• Representing text, we need to

represent tense– John eats a cake

X cake(X) & eats(john,X)

– John ate a cakeX cake(X) & ate(john,X)X cake(X) & eats(john,X,past)X cake(X) & eats(john,X,pres)event(E) eating(E) & agent(E,john) & X cake(X) & object(E,X) &past(E)time(E,past)

Page 15: Predicate Calculus

15/24

Tense and time• Relationship between tense and time by no

means straightforward– I fly to Delhi on Monday– I fly to Delhi on Mondays– I fly to Delhi and find they have lost my luggage– I fly to Delhi if I win the competition– He will be in Delhi now

• You might want a deeper representation rather than just a mirror of the surface tense

Page 16: Predicate Calculus

16/24

Tense and time• Reichenbach’s approach• Tense is determined by three

perspectives:– Event time– Reference time– Utterance time

• These can be ordered relative to time• Also, they can be points or durations

Page 17: Predicate Calculus

17/24

Tense and timeI had eaten

E < R < U

I ate

E=R < U

I have eaten

E < R=U

I eat

E=R=U

I will eat

U=R < E

I will have eaten

U < E < R

I am eating

U=R E

I was eating

R E < U

I will have been eating

Page 18: Predicate Calculus

18/24

Linguistic issues• There are many other similarly tricky

linguistic phenomena– Modality (could, should, would, must,

may)– Aspect (completed, ongoing, resulting)– Determination (the, a, some, all, none)– Fuzzy sets (often, some, many, usually)

Page 19: Predicate Calculus

19/24

Semantic analysis• Syntax-driven semantic analysis

– Compositionality• Semantic grammars

– Procedural view of semantics

Page 20: Predicate Calculus

20/24

Syntax-driven semantic analysis

• Based on syntactic grammars• CFG rules augmented by semantic

annotations• Compositionality

– Meaning of the whole is the sum of the meaning of its parts

– But not just the parts, but also the way they fit together

Page 21: Predicate Calculus

21/24

Pipeline architectureinput

parser

semanticanalyzer

represent-ation

Page 22: Predicate Calculus

22/24

Semantic augmentations to PSG rules - example

NP det, adj, n {sem(NP,X) = qtf(det,X) sem(adj,X) & sem(n,X)}

a = det {qtf(X,exists(X))}fat = adj {sem(X,fat(X))}man = n {sem(X,male(X) & hum(X)}

a fat manexists(X) fat(X) & male(X) & hum(X)

Page 23: Predicate Calculus

23/24

Semantic augmentations to PSG rules - example

S NP, VP {sem(S,X,Y) = sem(NP,X) & sem(VP,X,Y)}NP det, adj, n {sem(NP,X) = qtf(det,X) sem(adj,X) & sem(n,X)}VP v, NP {sem(VP,X,Y) = sem(v,X,Y) sem(NP,Y)}eats = v {sem(X,Y,eats(X,Y) & tense(pres)}cake = n {sem(X,cake(X)}

a fat man eats a cakeexists(X) fat(X) & male(X) & hum(X) & exists(Y) &

cake(Y) & eats(X,Y) & tense(pres)

Page 24: Predicate Calculus

24/24

How to do this• Quite complex• Fortunately, there is a mechanism• Lambda calculus (Church 1940)• See J&M ;-)

• Such representations often called “quasi logical forms” because of their (too) close relation to syntax