UNIT IV: Semantics and Logical Form: Word senses and Ambiguity, Encoding Ambiguity
in the Logical Form, Verbs and States in Logical Form, Speech Acts and Embedded
Sentences, Defining Semantic Structure: Model Theory
● Semantic Interpretation-Semantic & Logical form
● Precisely defining the notions of semantics and meaning is surprisingly difficult because
the terms are used for several different purposes in natural and technical usage. For
instance, there is a use of the verb "mean" that has nothing to do with language. Say
you are walking in the woods and come across a campfire that is just noticeably warm.
You might say "This fire means someone camped here last night". By this you mean that
the fire is evidence for the conclusion or implies the conclusion.
● This is related to, but different from, the notion of meaning that will be the focus of the
next few chapters. The meaning we want is closer to the usage when defining a word,
such as in the sentence "'Amble' means to walk slowly". This defines the meaning of a
word in terms of other words.
● To make this more precise, we will have to develop a more formally specified language
in which we can specify meaning without having to refer back to natural language itself.
But even if we can do this, defining a notion of sentence meaning is difficult.
● For example, I was at an airport recently and while I was walking towards my departure
gate, a guard at the entrance asked, "Do you know what gate you are going to?" I
interpreted this as asking whether I knew where I was going and answered yes. But this
response was based on a misunderstanding of what the guard meant, as he then asked,
"Which gate is it?" He clearly had wanted me to tell him the gate number. Thus the
sentence "Do you know what gate you are going to?" appears to mean different things in
different contexts.
8.2 differ in that the latter might not include a single identifiable expression in the knowledge
representation that fully captures the ‖meaning‖ of the sentence. Rather, the logical form might
make a variety of changes to produce the updated situation. This allows other implications to be
derived from an utterance that are not directly captured in the semantic content of the sentence.
Such issues will become important later when we discuss contextual interpretation.
Word senses & ambiguity
Natural language processing (NLP), may be defined as the ability to determine which
meaning of word is activated by the use of word in a particular context. Lexical ambiguity,
syntactic or semantic, is one of the very first problem that any NLP system faces. Part-of-
speech (POS) taggers with high level of accuracy can solve Word’s syntactic ambiguity. On
the other hand, the problem of resolving semantic ambiguity is called WSD (word sense
disambiguation). Resolving semantic ambiguity is harder than resolving syntactic ambiguity.
For example, consider the two examples of the distinct sense that exist for the
word “bass” −
I can hear bass sound.
He likes to eat grilled bass.
The occurrence of the word bass clearly denotes the distinct meaning. In first
sentence, it means frequency and in second, it means fish. Hence, if it would
be disambiguated by WSD then the correct meaning to the above sentences can
be assigned as follows −
I can hear bass/frequency sound.
He likes to eat grilled bass/fish.
Ambiguity in Natural Language Processing (NLP) happens because human
language can have multiple meanings. Computers sometimes confuse to
understand exactly what we mean unlike humans, who can use intuition and
background knowledge to infer meaning, computers rely on precise
algorithms and statistical patterns.
The sentence "The chicken is ready to eat" is ambiguous because it can be
interpreted in two different ways:
1. The chicken is cooked and ready to be eaten.
2. The chicken is hungry and ready to eat food.
This dual meaning arises from the structure of the sentence, which does not
clarify the subject's role (the eater or the one being eaten). Resolving such
ambiguities is essential for accurate NLP applications like chatbots,
translation, and sentiment analysis.
This article explores types of ambiguity in NLP and methods to address
them effectively.
Types of Ambiguity in NLP
The meaning of an ambiguous expression often depends on the situation,
prior knowledge, or surrounding words. For example: He is cool. This could
mean he is calm under pressure or he is fashionable depending on the
context.
1. Lexical Ambiguity
Lexical ambiguity occurs when a single word has multiple meanings, making
it unclear which meaning is intended in a particular context. This is a common
challenge in language.
For example, the word "bat" can have two different meanings. It could refer
to a flying mammal, like the kind you might see at night. Alternatively, "bat"
could also refer to a piece of sports equipment used in games like baseball
or cricket.
2. Syntactic Ambiguity
Syntactic ambiguity occurs when the structure or grammar of a sentence
allows for more than one interpretation. This happens because the sentence
can be understood in different ways depending on how it is put together.
For example, take the sentence, “The boy kicked the ball in his jeans.” This
sentence can be interpreted in two different ways: one possibility is that the
boy was wearing jeans and he kicked the ball while he was wearing them.
Another possibility is that the ball was inside the boy’s jeans, and he kicked
the ball out of his jeans.
3. Semantic Ambiguity
Semantic ambiguity occurs when a sentence has more than one possible
meaning because of how the words are combined. This type of ambiguity
makes it unclear what the sentence is truly trying to say.
For example, take the sentence, “Visiting relatives can be annoying.” This
sentence could be understood in two different ways. One meaning could be
that relatives who are visiting you are annoying, implying that the relatives
themselves cause annoyance. Another meaning could be that the act of
visiting relatives is what is annoying, suggesting that the experience of
going to see relatives is unpleasant.
4. Pragmatic Ambiguity
Pragmatic ambiguity occurs when the meaning of a sentence depends on the
speaker’s intent, tone, or the situation in which it is said. This type of
ambiguity is common in everyday conversations, and it can be tricky for
computers to understand because it often requires knowing the broader
context.
For example, consider the sentence, “Can you open the window?” In one
situation, it could be understood as a literal question asking if the person is
physically able to open the window. However, in another context, it could be
a polite request, where the speaker is asking the listener to open the
window, even though they’re not directly giving an order.
5. Referential Ambiguity
Referential ambiguity occurs when a pronoun (like "he," "she," "it," or "they")
or a phrase is unclear about what or who it is referring to. This type of
ambiguity happens when the sentence doesn’t provide enough information
to determine which person, object, or idea the pronoun is referring to.
For example, consider the sentence, “Alice told Jane that she would win the
prize.” In this case, it’s unclear whether the pronoun "she" refers to Alice or
Jane. Both could be possible interpretations, and without further context, we
can’t be sure. If the sentence was about a competition, "she" could be
referring to Alice, meaning Alice is telling Jane that she would win the prize.
However, it could also mean that Alice is telling Jane that Jane would win
the prize.
Encoding Ambiguity in the Logical Form
Ambiguity in computational linguistics is a situation where a word or a sentencemay have
more than one meaning. That is, a sentence may be interpreted in more than one way. This
leads to uncertainty in choosing the right meaning of a sentence especially while
processing natural languages by computer.
● Ambiguity is a challenging task in natural language understanding (NLU).
○ The process of handling the ambiguity is called as disambiguation.
○ Ambiguity presents in almost all the steps of natural language processing.
(Steps of NLP-lexical analysis, syntactic analysis, semantic analysis, discourse
analysis, and pragmatic analysis).
Consider the following sentence for an example;"Raj tried to reach his friend on the mobile, but
he didn't attend"In this sentence, we have the presence of lexical, syntactic, and anaphoric
Ambiguities.
● Lexical ambiguity-The word "tried" means "attempted" not "judged" or "tested". Also,
the word "reach" means "establish communication" not "gain" or "pass" or "strive".
● Syntactic ambiguity-The phrase "on the mobile" attached to "reach" and thus means
"using the mobile". It is not attached to "friend".
● Anaphoric ambiguity-The anaphor "he" refers the "friend" not "Raj".
Encoding Ambiguity in the Logical Form
● The basic logical form language defines a language in which you can combine word
senses elements to form meanings for more complex expressions. The Logical form
language will follow First-Order Predicative Calculus (FOPC) to represent the given
corpus of the NLP.
● First-Order Predicate Logic (FOPL), also known as First-Order Logic (FOL), is a formal
system used in mathematics, philosophy, linguistics, and computer science. In the
context of Natural Language Processing (NLP), FOPL provides a powerful framework
for representing and reasoning about the semantics of natural language.
Key Concepts of FOPL
1. 1. Predicates: Functions that denote properties or relationships among objects. For
example, Likes(Alice, Bob) can represent "Alice likes Bob".
2. 2. Quantifiers: Symbols that specify the quantity of specimens in
the domain of discourse that satisfy a predicate. The two main
quantifiers are: o Universal Quantifier (∀): Indicates that a
predicate is true for all elements in the domain. ▪ Example: ∀x
(Human(x) → Mortal(x)), meaning "All humans are mortal." o
Existential Quantifier (∃): Indicates that there is at least one
element in the domain for which the predicate is true. ▪ Example:
∃x (Cat(x) ∧ Black(x)), meaning "There exists a black cat."
3. Variables: Symbols representing elements of the domain of discourse. For example,
x, y, z.
4. Functions: Mappings from tuples of objects to objects within the domain. For
instance, MotherOf(x) could denote the mother of x.
5. Logical Connectives: Symbols used to connect statements. The primary
connectives are:
a. Conjunction (∧): Logical AND
b. Disjunction (∨): Logical OR
c. Negation (¬): Logical NOT
d. Implication (→): Logical implication
e. Biconditional (↔): Logical equivalence
Terms: Variables, constants, and functions. For example, Alice, Bob, and FatherOf(Charlie).
Applications of FOPL in NLP
● Semantic Representation: FOPL can be used to represent the meaning of sentences in
a structured form. This is crucial for tasks like semantic parsing, where natural language
is converted into a logical form that machines can understand and reason about.
● Knowledge Representation: In NLP, FOPL is used to encode knowledge bases, allowing
systems to perform logical reasoning. This is useful in expert systems and knowledge-
based applications.
● Inference and Reasoning: FOPL allows for logical inference, enabling systems to draw
conclusions from known facts. For example, given the statements "All humans are
mortal" and "Socrates is a human," a system can infer that "Socrates is mortal."
● Question Answering: FOPL can be applied to answer questions by querying a
knowledge base. For example, to answer "Is there a black cat?" the system
checks if the predicate ∃x (Cat(x) ∧ Black(x)) is satisfied.
● Natural Language Understanding: By converting natural language into FOPL
expressions, systems can better understand and process complex language structures,
enabling more accurate comprehension and response generation.
Example of FOPL in NLP
Consider the sentence: "Every student loves some book."
Identify predicates and constants:
● Student(x): x is a student
● Book(y): y is a book
● Loves(x, y): x loves y
Convert to FOPL:
● ∀x (Student(x) → ∃y (Book(y) ∧ Loves(x, y))) This logical form expresses that
for every x, if x is a student, then there exists some y such that y is a book
and x loves y.
● Challenges of Using FOPL in NLP
○ Complexity: Natural language is often ambiguous and context-dependent,
making it challenging to represent accurately with FOPL.
○ Scalability: Large-scale reasoning with FOPL can be computationally intensive.
○ Expressiveness: While FOPL is powerful, it may not capture all nuances of
natural language, especially pragmatic and contextual aspects.
Verbs and States in Logical Form
The verbs have mapped to appropriate senses acting as predicates in the logical form. This
treatment can handle all the different forms but loses some generalities that could be captured.
It also has some annoying properties. Consider the following sentences, all using the verb
―break":
John broke the window with the hammer.
The hammer broke the window.
The window broke.
The verb "break" mapped to the same sense in each case. The first seems to be a ternary
relation between John, the window, and the hammer, the second a binary relation between the
hammer and the window, and the third a unary relation involving the window. It seems you
would need three different senses of break, BREAK1, BREAK2, and BREAK3, that differ in their
arity and produce logical forms such as
Speech Acts and Embedded Sentences
Sentences are used for many different purposes. Each sentential mood indicates a different
relation between the speaker and the propositional content of the context. The logical form
language is extended to capture the distinctions. Each of the major sentence types has a
corresponding operator that takes the sentence interpretation as an argument is called a
surface speech act.
They are indicated by new operators as follows:
● ASSERT - the proposition is being asserted.
● Y/N-QUERY - the proposition is being queried.
● COMMAND - the proposition describes an action to perform.
● WH-QUERY - the proposition describes an object to be identified.
○ For ASSERT declarative sentences, such as "The man ate a peach", the
complete LF is (logical form) (ASSERT ( e1 [AGENT ]))
○ For YES/NO questions, such as "Did the man eat a peach?", the LF is (Y/N-
QUERY ( e1 [AGENT ] [THEME ]))
○ For COMMAND, such as "Eat the peach", the LF is (COMMAND (EAT e1
[THEME ]))
○ For WH-QUERY, the logical form of the sentence "What did the man eat?" is
(WH-QUERY ( e1 (AGENT ] [THEME ]))
Embedded sentences Embedded sentences, such as relative clauses, end up as complex
restrictions within the noun phrase construction and thus do not need any new notation.
For example, the logical form of the sentence "The man who ate a peach left" would be
Defining Semantic Structure: Model Theory
The basic building block for defining semantic properties is known as a model. A model theory
can be thought of as a set of objects and their properties and relationships, together with a
specification of how the language being studied relates to those objects and relationships. A
model can be thought of as representing a particular context in which a sentence is to be
evaluated. For instance, the standard models for logic, called Tarskian models, are complete in
that they must map every legal term in the language into the domain and assign every
statement to be true or false. Model theory is an excellent method for studying context-
independent meaning, because the meanings of sentences are not defined with respect to one
specific model but rather by how they relate to any possible model.
Formally, a model m is a tuple , where Dm is the domain of interpretation (that is, a set of
primitive objects), and I is the interpretation function.
● To handle natural language, the domain of interpretation would have to allow objects of
all the different types of things that can be referred to, including physical objects, times,
Locations, events, and situations.
● The interpretation function maps senses and larger structures into structures defined on
the domain. For example, the following describe how an interpretation function will
interpret the senses based on some lexical classes:
○ Senses of noun phrases - refer to specific objects; the interpretation function
maps each to an element of Dm.
○ Senses of singular common nouns (such as "dog", "idea", "party") - identify
classes of objects in the domain; the interpretation function maps them to sets of
elements from Dm (that is, subsets of Dm).
○ Senses of verbs - identify sets of n-ary relations between objects in D. The arity
depends on the verb.