MODULE 4: SEMANTICS
▪Computational Desiderata for
Representations
▪ Meaning Structure of Language CONTENTS
▪First Order Predicate Calculus
▪ Elements of FOPC
▪ The Semantics of FOPC
INTRODUCTION
▪ Semantics: Meaning for the text
▪ The text is checked for meaningfulness.
▪ Eg: Hot ice-cream, Colourless green idea – doesn’t give
proper meaning.
Semantics Labelling:
“The Keys, which were needed to access the building, were
locked in the car”
The Keys, which were needed to access the
building
Argument
Locked
Verb
In the car
Location
ASPECTS OF SEMANTICS ANALYSIS
▪ Lexical Processing – meaning of the word in the sentence
▪ Word sense disambiguation – understanding a word used
in which contest
Eg: Bank – Finance or River side
▪ Semantics Grammars – Parsing is done but there is no
meaning for the sentence.
▪ Eg: John is a Professor at London – Named Entity
Recognition
MEANING REPRESENTATIONS
▪ We’re going to take the same basic approach to
meaning that we took to syntax and morphology
▪ We’re going to create representations of linguistic
inputs that capture the meanings of those inputs.
▪ But unlike parse trees, these representations aren’t
primarily descriptions of the structure of the
inputs…
CONTD…
▪ The frameworks that are used to specify the syntax
and semantics of these representations will be
called meaning representation languages.
▪ Representations that can bridge the gap from
linguistic inputs to the kind of non-linguistic
knowledge
▪ Needed to perform a variety of tasks involving the
meaning of linguistic inputs.
CONTD…
Consider the following everyday language tasks that
require some form of semantic processing.
✓ Answering an essay question on an exam
✓ Deciding what to order at a restaurant by reading a menu
✓ Learning to use a new piece of software by reading the
manual
✓ Realizing that you’ve been insulted
✓ Following a recipe
CONTD…
▪ For example, some of the knowledge of the word needed to
perform the above tasks includes:
▪ Answering and grading essay questions requires
background knowledge about
➢ The topic of the question
➢ The desired knowledge level of the students
➢ How such questions are normally answered
CONTD…
Reading a menu and deciding what to order
➢ Giving advice about where to go to dinner
➢ Following a recipe
➢ Generating new recipes all require deep knowledge
about food, its preparation
➢ What people like to eat and what restaurants are like.
CONTD…
Learning to use a piece of software by reading a manual
➢ Giving advice about how to do the same
➢ Requires deep knowledge about current computers
➢ The specific software in question
➢ Similar software applications
➢ Knowledge about users in general
SEMATIC ANALYSIS
▪ In the representational approach being explored here,
▪ The linguistic inputs and construct meaning
representations that are made up of the same kind of stuff
that is used to represent this kind of everyday
commonsense knowledge of the world.
▪ The process whereby such representations are created and
assigned to linguistic inputs is called semantic analysis
Computational Desiderata for
Representations
▪ Representations that allow a system to
▪ Answer questions
▪ Determine truth
▪ Perform inference
✓ Verifiability
✓ Unambiguous Representations
✓ Canonical Form
✓ Inference and Variables
✓ Expressiveness
VERIFIABILITY
▪ Verifiability:The system’s ability to compare
representations to facts in memory.
▪ The most straightforward way to implement this notion is
make it possible for a system to compare, or match, the
representation of the meaning of an input against the
representations in its knowledge base, its store of
information about its world.
EXAMPLE
Does Maharani serve vegetarian food?
Serves(Maharani; Vegetarian Food)
▪ Input - matched against the knowledge base of facts about
a set of restaurants.
▪ matching - the input proposition in its knowledge base, it
can return an affirmative answer.
▪ Otherwise, it must either say No, if its knowledge of local
restaurants is complete, or say that it does not know.
UNAMBIGUOUS REPRESENTATIONS
▪ The domain of semantics - is subject to ambiguity.
▪ Single linguistic inputs can legitimately have different
meaning representations assigned to them based on the
circumstances in which they occur.
CONTD…
▪ Example
I wanna eat someplace that’s close to ICSI
▪ The answer generated by the system for this request will
depend on which interpretation is chosen as the correct
one.
▪ The various linguistic phenomenon that give rise to such
ambiguities.
CONTD…
▪ A concept closely related to ambiguity is vagueness.
▪ Likeambiguity, vagueness can make it difficult to
determine what to do with a particular input based on its
meaning representation.
▪ Vagueness, however, does not give rise to multiple
representations.
▪ Consider the following request as an example.
I want to eat Italian food
CONTD…
▪ use of the phrase Italian food may provide enough information for a
restaurant advisor to provide reasonable recommendations.
▪ It is nevertheless quite vague as to what the user really wants to eat.
▪ A vague representation of the meaning of this phrase may be
appropriate for some purposes, while a more specific representation
may be needed for other purposes.
CANONICAL FORM
▪ The notion that single sentences can be assigned multiple
meanings leads to the related phenomenon of distinct
inputs that should be assigned the same meaning
representation.
▪ Does Maharani have vegetarian dishes?
▪ Do they have vegetarian food at Maharani?
▪ Are vegetarian dishes served at Maharani?
▪ Does Maharani serve vegetarian fare?
CONTD…
▪ Canonical form: inputs that mean the same thing should have the
same meaning representations
▪ Simplifies reasoning
▪ Makes representations more compact (fewer different
representations)
▪ BUT: makes semantic analysis harder
▪ Need to figure out that “have” and “serve” mean the same thing
in the previous examples; same for the various phrases for
vegetarian food
▪ BUT: can perform word sense disambiguation; use a single
representation for all senses in a synset
CONTD…
▪ Consider the issue of the meanings of the words food, dish and fare in
these examples.
▪ A little introspection, or a glance at a dictionary, reveals that these
words have a fair number of distinct uses.
▪ These words all have various word senses and that some of the senses
are synonymous with one another.
▪ The process of choosing the right sense in context is called word sense
disambiguation, or word sense tagging by analogy to part-of-speech
tagging.
CONTD…
▪ Alternative syntactic analyses often have meanings that are, if
not identical, at least systematically related to one another.
▪ Consider the following pair of examples.
Maharani serves vegetarian dishes
Vegetarian dishes are served by Maharani
▪ use knowledge of where grammatical subjects and direct
objects appear in these constructions
▪ to assign Maharani - to the role of the server
▪ vegetarian dishes - to the role of thing being served in both
of these examples
INFERENCE AND VARIABLES
Can vegetarians eat at Maharani?
▪ The term inference to refer generically to a system’s ability
to draw valid conclusions based on the meaning
representation of inputs and its store of background
knowledge.
▪ It must be possible for the system to draw conclusions
about the truth of propositions that are not explicitly
represented in the knowledge base, but are nevertheless
logically derivable from the propositions that are present.
CONTD…
I’d like to find a restaurant where I can get vegetarian food.
▪ In this examples, this request does not make reference to
any particular restaurant.
▪ The user is stating that they would like information about an
unknown and unnamed entity that is a restaurant that
serves vegetarian food.
▪ Answering this request requires a more complex kind of
matching that involves the use of variables.
▪ A representation containing such variables as follows.
Serves(x; Vegetarian Food)
EXPRESSIVENESS
▪ A meaning representation scheme must be expressive
enough to handle an extremely wide range of subject
matter.
▪ First Order Predicate Calculus is expressive enough to
handle quite a lot of what needs to be represented.
▪ [Link]
TASK IN SEMANTIC ANALYSIS
MEANING STRUCTURE
OF LANGUAGE
CONTD…
▪ These include a variety of conventional form
➢ Meaning associations
➢ Word-order regularities
➢ Tense systems
➢ Conjunctions and quantifiers
➢ A fundamental predicate-argument structure
CONTD…
▪ Predicate-argument structure, which is the mechanism that
has had the greatest practical influence on the nature of
meaning representation languages.
▪ Events, actions and relationships can be captured with
representations that consist of predicates and arguments to
those predicates.
▪ Languages display a division of labor where some words
and constituents (typically) function as predicates and
some as arguments.
CONTD…
▪ Predicates
▪ Primarily Verbs, VPs, Sentences
▪ Sometimes Nouns and NPs
▪ Arguments
▪ Primarily Nouns, Nominals, NPs, PPs
CONTD…
▪ These examples can be classified as having one of the
three syntactic argument frames.
I want Italian food - NP want NP
I want to spend less than five dollars - NP want Inf-VP
I want it to be close by here - NP want NP Inf-VP
▪ These syntactic frames specify the number, position and
syntactic category of the arguments that are expected.
CONTD…
The frame for the variety of want that appears in Example 1
specifies the following facts:
▪ There are two arguments to this predicate.
▪ Both arguments must be NPs.
▪ The first argument is pre-verbal and plays the role of the
subject.
▪ The second argument is post-verbal and plays the role of
the direct object
CONTD…
Semantic roles and Semantic restrictions on these roles
▪ The notion of a semantic role can be understood by
looking at the similarities among the arguments in
Examples 1 to 4.
▪ The study of roles associated with specific verbs and
across classes of verbs is usually referred to as thematic
role or case role.
▪ The notion of semantic restrictions arises directly from
these semantic roles.
CONTD…
Consider the following phrases from the BERP corpus.
An Italian restaurant under fifteen dollars
▪ In this example, the meaning representation associated
with the preposition under can be seen as having
something like the following structure.
Under(Italian Restaurant ; $15)
▪ Prepositions can be characterized as two-argument
predicates where the first argument is an object that is
being placed in some relation to the second argument.
CONTD…
▪ Another non-verb based predicate-argument structure
example.
Make a reservation for this evening for a table for
two persons at 8.
▪ The predicate-argument structure is based on the concept
underlying the noun reservation, rather than make, the main
verb in the phrase.
▪ This example gives rise to a four argument predicate structure
like the following.
Reservation(Hearer; Today; 8PM ; 2)
CONTD…
▪ Any useful meaning representation language must be
organized - supports the specification of semantic
predicate-argument structures.
▪ This support must include support for the kind of semantic
information that languages present:
➢ Variable arity predicate-argument structures.
➢ The semantic labeling of arguments to predicates.
➢ The statement of semantic constraints on the fillers of
argument roles.
FIRST ORDER PREDICATE
CALCULUS
CONTD…
▪ First Order Predicate Calculus (FOPC) is a flexible, well-
understood, and computationally tractable approach to the
representation of knowledge that satisfies many of the
requirements.
▪ Terms refer to elements of the domain: constants, functions,
and variables
Martin, Spouse Of (Karen), X
CONSTANTS
▪ Constants in FOPC refer to specific objects in the word
being described.
▪ Such constants are conventionally depicted - as A and B or
single capitalized words that are often indicative of proper
nouns such as Maharani and Harry.
▪ Like programming language constants, FOPC constants
refer to exactly one object.
FUNCTIONS
▪ Functions in FOPC correspond to concepts that which are often
expressed in English as genitives such as the location of
Maharani or Maharani’s location.
▪ A FOPC translation of such an expression
Location Of (Maharani)
▪ FOPC functions are syntactically the same as single argument
predicates.
▪ Functions provide a convenient way to refer to specific objects
without having to associate a named constant with them.
▪ Restaurants, location associated with them.
VARIABLE
▪ The notion of a variable is our final FOPC mechanism for referring to
objects.
▪ Variables, which are normally depicted as single lower-case letters,
give us the ability to make assertions and draw inferences about
objects without having to make reference to any particular named
object.
▪ This ability to make statements about anonymous objects comes in
two flavors:
▪ making statements about a particular unknown object
▪ making statements about all the objects in some arbitrary word of objects
FOPC
▪ FOPC representation for Maharani serves vegetarian food might look
like the following formula.
Serves(Maharani; Vegetarian Food)
▪ This FOPC sentence asserts that Serves, a two-place predicate, holds
between the objects denoted by the constants Maharani and
Vegetarian Food.
▪ Different use of predicates is illustrated - Maharani is a restaurant.
▪ Restaurant(Maharani) - example of a one-place predicate that is used,
not to relate multiple objects, but rather to assert a property of a
single object.
CONTD…
▪ From Figure 14.2, logical connectives give us the ability to create
larger representations by conjoining logical formulas using one of
three operators
I only have five dollars and I don’t have a lot of time.
Have(Speaker; Five Dollars) ^ ¬ Have(Speaker; Lot Of Time)
▪ The semantic representation for this example is built up in a
straightforward way from semantics of the individual clauses through
the use of the ^ and ¬ operators.
SEMANTICS OF FOPC
CONTD…
▪ The various objects, properties, and relations represented
in a FOPC knowledge base acquire their meanings by
virtue of their correspondence to objects, properties, and
relations out in the external word being modeled by the
knowledge base.
▪ FOPC sentences - assigned a value of True or False based
on whether the propositions they encode are in accord with
the word or not.
CONTD…
▪ Consider the following example.
Ay Caramba is near ICSI.
For this example, such an effort might yield something like the
following.
Near(Location of (AyCaramba); Location of (ICSI))
The meaning of this logical formula then arises from the relationship
between the terms
Location of (AyCaramba), Location of (ICSI)
The predicate Near, and the objects and relation they correspond to in
the word being modeled.
CONTD…
▪ This sentence can be assigned a value of True or False.
▪ For our current purposes, we will adopt what is known as a
database semantics for determining the truth of our logical
formulas.
▪ The interpretations of formulas involving logical
connectives is based on the meaning of the components in
the formulas combined with the meanings of the
connectives they contain.
▪ Figure gives interpretations for each of the logical
operators.
The semantics of the ^ (and), and ¬ (not) operators
V (or) operator and =>(implies) operator
VARIABLES AND QUANTIFIERS
▪ variables are used in two ways in FOPC: to refer to particular
anonymous objects and to refer generically to all objects in a
collection.
▪ These two uses are made possible through the use of operators
known as quantifiers.
▪ The two operators that are basic to FOPC are the existential
quantifier, which is denoted , and is pronounced as “there exists”,
and the universal quantifier, which is denoted , and is pronounced
as “for all”.
CONTD…
▪ Consider the following example.
A restaurant that serves Mexican food near ICSI.
The following would be a reasonable representation of the
meaning of such a phrase.
xRestaurant(x)
^Serves(x; Mexican Food)
^Near((Location of (x); Location of (ICSI))
CONTD…
▪ For example, if AyCaramba is a Mexican restaurant near ICSI,
then substituting AyCaramba for x results in the following
logical formula.
Restaurant(AyCaramba)
^Serves(AyCaramba; Mexican Food)
^Near((Location Of (AyCaramba); Location Of (ICSI))
▪ Based on the semantics of the ^ operator, this sentence will be
true if all of its three component atomic formulas are true.
CONTD…
▪ The use of the universal quantifier also has an
interpretation based on substitution of known objects for
variables.
▪ The substitution semantics for the universal quantifier takes
the expression for all quite literally;
▪ The operator states that for the logical formula in question
to be true the substitution of any object in the knowledge
base for the universally quantified variable should result in
a true formula.
CONTD…
▪ Consider the following example.
All vegetarian restaurants serve vegetarian food
▪ A reasonable representation for this sentence would be
something like the following.
CONTD…
▪ Case where the substituted object actually is a vegetarian
restaurant; one such substitution would result in the following
sentence.
Vegetarian Restaurant(Maharani)
=> Serves(Maharani; Vegetarian Food)
▪ WKT the consequent clause,
Serves(Maharani; Vegetarian Food)
is true then this sentence as a whole must be true
CONTD…
▪ Consider the substitution of a non-vegetarian
restaurant such as Ay Caramba’s for the variable x.
Vegetarian Restaurant (AyCaramba)
=> Serves (AyCaramba; Vegetarian Food)
CONTD…
Since the antecedent of the implication is False.
Consider the following substitution.
Vegetarian Restaurant(Carburetor) )
=> Serves(Carburetor; Vegetarian Food)
Here the antecedent is still false and hence the rule remains
true under this kind of irrelevant substitution.
INFERENCE
▪ The ability to add valid new propositions to a knowledge base.
▪ Modus ponens is a familiar form of inference that corresponds to
what is informally known as if-then reasoning.
▪ The modus ponens is defined as follows, where α and β should be
taken as FOPC formulas.
▪ schemas like this indicate that the formula below the line can be
inferred from the formulas above the line by some form of inference.
CONTD…
▪ Modus ponens simply states that if the left-hand side of an implication rule
is present in the knowledge base, then the right-hand side of the rule can
be inferred.
▪ The left hand side of an implication as the antecedent, and the right-hand
side as the consequent.
▪ consider the following example
▪ The formula Vegetarian Restaurant (Rudys) matches the antecedent of the
rule, thus allowing us to use modus ponens to conclude
Serves(Rudys; Vegetarian Food)
CONTD…
▪ Modus ponens used practically in two ways
▪ Forward Chaining
▪ Backward Chaining
▪ The forward chaining approach has
Advantage
▪ present in the knowledge base when needed, since in a sense all
inference is performed in advance.
▪ This substantially reduce the time needed to answer subsequent
queries.
Disadvantage of this approach
▪ Facts may be inferred and stored that will never be needed.
▪ Production systems, which are heavily used in cognitive modeling
work, are forward chaining inference systems.
CONTD…
▪ In backward chaining, modus ponens is run in reverse to prove
specific propositions, called queries.
▪ The first step is to see if the query formula is true by determining if it
is present in the knowledge base.
▪ If it is not, then the next step is to search for applicable implication
rules present in the knowledge base.
▪ An applicable rule is one where the consequent of the rule matches
the query formula.
▪ If there are any such rules, then the query can be proved - to be true.
▪ The Prolog programming language is a backward chaining system
that implements this strategy.