0% found this document useful (0 votes)
33 views47 pages

NLP - Unit-4 Semantic

The document discusses the relationship between semantics and logical form, highlighting the distinction between context-independent and context-dependent meanings. It covers various concepts such as word senses, ambiguity, thematic roles, and the processes of semantic and contextual interpretation, emphasizing the importance of logical representation in AI. Additionally, it addresses challenges in compositionality, particularly with idiomatic expressions.

Uploaded by

Mithun B N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views47 pages

NLP - Unit-4 Semantic

The document discusses the relationship between semantics and logical form, highlighting the distinction between context-independent and context-dependent meanings. It covers various concepts such as word senses, ambiguity, thematic roles, and the processes of semantic and contextual interpretation, emphasizing the importance of logical representation in AI. Additionally, it addresses challenges in compositionality, particularly with idiomatic expressions.

Uploaded by

Mithun B N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Semantics and Logical Form

Till Now

Identify words as part of


speech-Lexical Analysis

Construct sentences using


CFG-Syntax Analysis

Parse the sentence using


different parsers
Semantics
• Meaning of the word is called Semantics.
• An Concepts contain two types of properties
1. Context-independent properties -:form the core
meanings of words.
2. Context-dependent properties are a source of
semantic encoding variability.

Reference
https://link.springer.com/article/10.3758/BF03197629
Semantics V logical Form
• Context independent meaning is basically
called logical form.
• Notion of semantics and meaning is
surprisingly difficult.
• Eg: Seeing the campfire that is still warm
This fire means someone camped here last
night(conclusion)
Amble means to walk slowly(meaning of word)
Definitions
• Context Independent Aspects meaning
• Context Dependent Aspects usage
• Representation of context-independent meaning 
Logical Form.
• Process of mapping sentence to its logical form
Semantic Interpretation
• Process of mapping the logical form to final knowledge
representation  Contextual Interpretation.
• Knowledge Representation language  FOPC
(First order predicate calculus)
Current AI
• Logical form Literal meaning of the utterance.
• Logical form Final Knowledge Representation

Modification is required
• Logical form should must allow indexical terms.
• Terms are defined by context
Eg: I and you.
Current status
• They deal with situation.
• Situation-particular set of circumstances in the
world.
• Eg:
When you are attending the class Situation is
Fellow being, Teacher objects like black board
chalk, chairs
Situation->set of objects and relationship between
objects.
Example
Consider two objects,
A ball(B0005) and a person(P86)

Include relationship that the person owns the ball

This will be encoded as


(BALL B0005),(PERSON P86),(OWNS P86 B0005)
BALL has a property RED
(BALL B0005),(PERSON P86),(OWNS P86 B0005)
(RED B0005)
Word senses and Ambiguity
• Word-basic semantic unit
• Go-there are more than 40 entries in the
dictionary -40 senses of word go
• Synonyms of go  move, depart, pass, vanish,
reach , exend , set out
• Different senses can be classified into a set of
broad classes of objects by which we classify
world problemsontology
The major classes
• Aristotle suggested some main class
• Substance  physical objects
• Quantity numbers
• Quality
• Relation
• Place
• Time
• Position,state,events,idea,concept,plan
Action and Events
• Events are things that happen in the world
• Action are things that agents do causing the
event
• Eg: We lifted the box, it was so hard.
• ‘It’ refers to the action of lifting box
Semantically Ambiguous
• A word is semantically Ambiguous if it maps to
more than one senses.
Eg
Word kid is ambiguous between baby goat and
human child
Eg:I have two kids and George has three kids
Implies to George and I are goat farmers
but not combination of humans and goats.
if say child, it can be girl or a boy vagueness
Same with verbs….
• I ran last year and George did too
• Run1:situation of running race
• Run2:situation of election
Structural Ambiguity
• Eg 1:Happy cats and dogs live on the farm
Cats were happy
Whether Dogs were happy:?
Cont..
Eg2:Every Boy like a dog.
A single dog that every boy like or
Each boy might love different dogs.
How can we define it by means of Quantifiers
There exist
For all
The basic logical form language
• Two representation
• First order predicate logic
• Network based representation
Two possible network representation

Sue loves Jack

LOVES LOVES
1
2
Pred
SUE JACK 11
Agent Theme

sue1 jack1
cont..
• Atoms word senses are called as atoms or
constants
• Terms constants that describe objects
• Predicates  constants that describe relations
and properties
Fido is a Dog
Term  fido
Predicate dog
(Dog1 Fido1)
Proposition
• Proposition in a language is formed from a
predicate followed by an appropriate number
of arguments
• Predicate that takes single argument-unary
• Predicate that takes two arguments –binary
Eg:
Sue loves jack
(Loves1 sue1 jack1)
Logical Operators
• Complex proposition we use logical operators
Eg:NOT
(NOT(LOVES1 SUE1 JACK1))
• Combine two or more propostion
Disjunction(or)
Conjunction(and)
implication
Quantifiers
Quantifier in English
• A quantifier is a word or phrase which is used before a noun to
indicate the amount or quantity:
'Some', 'many', 'a lot of' and 'a few' are examples of quantifiers.
• Quantifiers can be used with both
countable and uncountable nouns.
• Examples:
• There are some books on the desk
He's got only a few dollars.
How much money have you got?
There is a large quantity of fish in this river.
He's got more friends than his sister.
Ref:
https://www.myenglishpages.com/site_php_files/
Quantifiers in FOPC
Two variables that represents Quantifiers:
– universal quantifier and
– existential quantifier.

The universal quantifier


for example, the statement x > 1 to "for every object x in the
universe, x > 1", which is expressed as "∀x x > 1".
This new statement is true or false in the universe of discourse.
Hence it is a proposition once the universe is specified.

The existential quantifier


for example, the statement x > 1 to "for some object x in the
universe, x > 1", which is expressed as "∃ x x > 1."
Again, it is true or false in the universe of discourse, and hence it is
a proposition once the universe is specified.
Example in FOPC
• ∃ x . P(X) and ∃ x . Q(x)
• These are completely different variables with
no relation with each other.
But natural language ,its completely different
Consider the sentence
“A man entered the room. He walked over to the
table”
Consider the sentence
“A man entered the room. He walked over to the table”

First sentence introduces a new object , namely


some man
“Some man” in FOPC is existential variable which
should end its scope in the first sentence, but
surprisingly scope does not end there in first
line ,but carried to second sentence by
pronoun he.
So to allow this we use discourse variable, which
can be referred back if situation permits.
Universe of discourse
• Px is true ,if it is true for every possible object
in the domain.
• But in natural language true for all objects is
rare
• So we use general Quantifiers
• Form of statement:
• Quantifier variable: restriction –proposition
body proposition
General Quantifiers
• Quantifier variable: restriction –proposition
body proposition
• Most dog barks
• (Most1 d1:(Dog1 d1)(Barks1 d1)
• Most of the objects d1 that satisfy (Dog1
d1)also satisfy (barks1 d1)
• (Most d2:(barks1 d2)(dog1 d2)
• Most of the barking things are dogs.
Some common Quantifiers
Quantifier Use
Example
THE definite reference the dog
A indefinite reference a dog
Bare Bare singular NP water,
food
Bare Bare plural NP dogs
General Quantifiers
The dog Barks
(THE x :(Dog1 x)(Barks1 x))
If there is a uniquely determined dog in the
context and that dog barks
The happy dog barks
(THE x : (& (DOG1 x)(HAPPY x))(BARKS1 x))
This will be true only if there is unique x such that
(& (DOG1 x)(HAPPY x)) is true and this x barks.
Predicate operator
• To handle plural forms we use predicate
operator
• DOG1 is predicate that is true for any set of
dogs.
• (PLUR DOG1) is a predicate that is true for any
set of dogs .PLUR IS A PREDICATE OPERATOR.
(The x: ((PLUR DOG1) X)(BARKS1 X))
(The x: ((PLUR DOG1) X)(BARKS1 X))

• The dogs bark


• There is specific set of dogs and each of them
barks.(Distributive reading)(bark is distributed)
• The dogs met at the corner
• Meeting is true for entire set of dogs.
(collective reading).
Modal operator
• Modal operators looks similar to logical
operators .
• These are needed to represent meaning of the
verbs such as believe and want.
• An important class of modal operators for
natural languages are the tense operators
• PAST,PRES AND FUT
Encoding Ambiguity in the logical form
• Ambiguity encoding is a separate level of
representation from the logical form and is
called quasi logical form.
• Most word have multiple senses
(they can be eliminated given context)
Words have different senses that have identical
structural constraints.
Example
• Noun ball has two senses
• Ball1:object used in games
• Ball2:social event involving dancing

• Sue watched the ball is ambiguous out of


context
• (THE b1: ({BALL1 BALL2} b1)(PAST (WATCH
SUE1 b1)))
Thematic roles
• John broke the window with the hammer
• John  actor
• Window  object
• Hammer  Instrument.
We introduce AGENT, THEME and INSTR to
capture these intuitions
Thematic Roles
• A noun phrase fills the AGENT role if it describes the
instigator of the action described by the sentence.
– John intentionally broke the window
– John broke the window in order to let in some air
• But next two statements are not allowed:
– The hammer intentionally broke the window
– The window broke in order to let in some air
BENEFICIARY ROLE
• This role is filled to animate person for whom
a certain event is performed
– I rolled on the floor for Lucy
– I gave the book to Jack for Susan
INSTR ROLES
• The INSTR role describes a tool , material , or
force used to perform some event.
• The harry broke the glass with the Telescope.
• I made a cake with some flour.
The agent and instr roles could be combined in
to a more general role named Casual -Agent
Theme role
• Jack paid $1 to the man for the book.
$1 is the theme

Jack bought the book from man for $1


Book is the theme.

In the first sentence there should be an option to


accommodate second object as co-theme.
Semantic Interpretation and
Compositionality
• Process of computing logical form while parsing
there by linking it with syntactic structure is called
semantic interpretation.
• Semantic tree to be generated from specified logical
form is called semantic realization.
• There must be a well formed meaning expression for
every constituent.
• Then meaning of a constituent and sub constituent
can then be specified in the grammar using
features(rule by rule style of semantic interpretation)
Semantic Interpretation
• Semantic interpretation is a compositional process
• Meaning of constituent meaning of sub
constituent
• Context free grammar model is a compositional
theory of syntax.
• SNPVP
• NPPRO(we will be building constituent by
constituent)
Compositional Models
• Compositional model tend to make a grammar
easier to extend and maintain.
• Jill loves every dog
• Syntactic structure clusters the word in to
phrases.
• ((jill )(loves(every dog)))
• (Every d : (Dog1 d)(loves1 l1(name j1 “jill”)d)))
• For every dog d there is an event l1 that
consist of Jill loving d.
challenges
• Another challenge to compositional theories is
the presence of idioms.
• Jack kicked the Bucket->Which means jack died.
• This does not have any relation with any relation
with meaning kicked and the bucket.
• One way to handle this semantic meaning
assigned to entire phrase rather than build the
meaning compositionally.
• (DIE1 d1 (NAME j1 “Jack”))
.

THANK YOU

You might also like