NLP Module 4
NLP Module 4
Subject In-charge
Ms. Pradnya Sawant
Assistant Professor
Room No. 405
email: [email protected]
Module 4
Semantic Analysis
Contents
▪ Introduction, meaning representation; Lexical
Semantics; Corpus study
▪ Study of Various language dictionaries like WorldNet,
Babelnet
▪ Relations among lexemes & their senses –
Homonymy, Polysemy, Synonymy, Hyponymy
▪ Semantic Ambiguity
▪ Word Sense Disambiguation (WSD); Knowledge
based approach(Lesk‘s Algorithm)
▪ Supervised (Naïve Bayes, Decision List)
▪ Introduction to Semi-supervised method (Yarowsky)
and Unsupervised (Hyperlex)
Module 4
Lecture 1
▪ Lexical Semantics
▪ Relations among lexemes & their senses –
Homonymy, Polysemy, Synonymy, Hyponymy
Lexical Semantics
● Lexical Semantics is the study of word meaning.
● Lexeme is a pair of a particular form (orthographic or
phonological) with its meaning.
● Lexicon is a finite list of lexemes.
● A lexeme is represented by a lemma.
● A lemma or citation form is the grammatical form that is used
to represent a lexeme.
○ Carpets → lemma : carpet
Lexical Semantics
● The specific forms sung or sing are called
wordforms.
● The process of mapping from a wordform to a
lemma is called lemmatization.
● Lemmatization is not always deterministic, since
it may depend on the context.
● E.g. the wordform found can map to the lemma
find (meaning ‘to locate’) or the lemma found (‘to
create an institution’).
Lexical Semantics
● Lemmas are Part-of-Speech specific; thus the
wordform tables has two possible lemmas, the noun
table and the verb table.
● One way to do lemmatization is via the
morphological parsing algorithms.
● But a lemma is not necessarily the same as the stem
from the morphological parse.
● E.g. celebrations →
stem : celebrate ; lemma : celebration.
Word Senses
● The meaning of a lemma can vary enormously given
the context.
● Consider two uses of the lemma bank, meaning
something like ‘financial institution’ and ‘River
bank’, respectively:
○ E.g. Instead, a bank can hold the investments in a
custodial account in the client’s name.
○ But as agriculture burgeons on the east bank, the river
will shrink even more.
Homonymy
• A sense (or word sense) is a discrete
representation of one aspect of the meaning of a
word.
• We will represent each sense by placing a
superscript on the orthographic form of the lemma
as in bank1 and bank2.
• The two senses are homonyms, and the relation
between the senses is one of homonymy.
Homonymy
Polysemy
Polysemy
Metonymy
Zeugma
Zeugma
Homophones
Homographs
• This problem is related to homophones in speech synthesis.
• Homographs are distinct senses linked to lemmas with the
same orthographic form but different pronunciations:
• E.g.
• She let him lead her into the center of the room.
• He lead the people into the room.
sense?
• Can we just look in a dictionary?
sense?
• One approach to define a word sense is to make use of a
similar approach to the dictionary definitions; defining a
sense via its relationship with other senses.
• The second computational approach to meaning
representation is to create a small finite set of semantic
primitives, atomic units of meaning, and then create each
sense definition out of these primitives.
Synonymy
• Synonymy is a relation between word senses rather than
between words.
• E.g. big and large.
• These may seem to be synonyms in the following sentences:
• How big is that plane?
• Would I be flying on a large or small plane?
• But note the following sentence where we cannot substitute
large for big:
• Miss Nelson became a kind of big sister to Benjamin.
• Miss Nelson became a kind of large sister to Benjamin.
Antonym
Antonym
● From one perspective, antonyms have very different
meanings, since they are opposite.
● From another perspective, they have very similar
meanings, since they share almost all aspects of their
meaning except their position on a scale, or their
direction. Thus automatically distinguishing
synonyms from antonyms can be difficult.
Hyponymy
• One sense is a hyponym of another sense if the first
sense is more specific, denoting a subclass of the
other.
• car is a hyponym of vehicle
• dog is a hyponym of animal
• mango is a hyponym of fruit.
• We can define hypernymy more formally by saying
that the class denoted by the superordinate
extensionally includes the class denoted by the
hyponym.
Hyponymy
Meronymy, Holynymy
Module 4
Lecture 2
▪ WordNet
▪ Robust Word Sense Disambiguation (WSD)
WordNet
• It is a database of Lexical Relations.
• The most commonly used resource for English sense
relations is the WordNet lexical database.
• WordNet consists of three separate databases:
• For nouns
• For verbs
• For adjectives and adverbs;
• NB: closed class words are not included.
WordNet
● Each database consists of a set of lemmas, each one
annotated with a set of senses.
● The WordNet 3.0 release has
○ 1,17,097 nouns
○ 11,488 verbs
○ 22,141 adjectives
○ 4,601 adverbs.
● WordNet can be accessed via the web or downloaded
and accessed locally.
Synset
• The set of near-synonyms for a WordNet sense is
called a synset (for synonym set)
• Synsets are an important primitive in WordNet.
• Synsets actually constitute the senses associated with
WordNet entries
• It is synsets, not wordforms, lemmas or individual
senses, that participate in most of the lexical sense
relations in WordNet.
Synset
Synset
BabelNet
• BabelNet groups words in different languages into
collections of synonyms known as Babel phrases . For
each Babel set, BabelNet provides short definitions in many
languages obtained from WordNet and Wikipedia.
• BabelNet is automatically created by linking the largest
multilingual Web encyclopedia, Wikipedia , with the most
popular computer lexicon for English, WordNet.
• The integration is carried out by means of an automatic
mapping in which lexical gaps in resource-poor
languages are filled with the help of statistical machine
translation.
Module 4
Lecture 3
▪ Robust Word Sense Disambiguation (WSD)
▪ Dictionary based approach
Approaches to WSD
Approaches to WSD
2. Supervised Methods
● ML methods make use of sense-annotated corpora
to train.
● These methods assume that context can provide
enough evidence to disambiguate the sense.
● Context is represented as a set of “features” of
words.
● These methods rely on a substantial amount of
manually sense-tagged corpora.
Approaches to WSD
Approaches to WSD
4. Unsupervised Methods
● The senses can be induced from text by clustering
word occurrences by using some measure of
similarity of the context.
● This task is called word sense induction or
discrimination.
● They have potential to overcome knowledge
acquisition bottleneck due to non-dependency on
manual efforts.
Module 4
Lecture 4
▪ Knowledge based approach(Lesk‘s Algorithm)
Lesk Algorithm
Lesk Algorithm
● E.g. Finding the appropriate sense of cone in the
phrase pine cone given the following definitions:
● Pine:
a. Kind of evergreen tree
b. Waste away through sorrow or illness
● Cone:
a. Solid body which narrows to a point
b. Something of this shape whether solid or hollow
c. Fruit of certain evergreen trees
Lesk Algorithm
● The lesk algorithm will select cone(c) as the
correct sense since two of the words in its entry:
evergreen and tree, overlaps with the words in the
entry for pine.
● Neither of the other entries have any overlap with
words in the definition of pine.
● Disadvantage of Lesk Algorithm : The dictionary
entries for the target words are relatively short and
may not provide sufficient material to create
adequate classifiers.
Module 4
Lecture 5
▪ Dictionary based approach
Stand-alone Approach
• In this approach, sense disambiguation is
performed independent of compositional
semantic analysis.
Example:
● Which airline serve NewYork?
● Which airlines serve breakfast?
● Disambiguation : by the selectional restrictions imposed
by ‘NewYork’ and ‘breakfast’ along with the semantic
type information associated with it.
● The predicate selects the correct sense of an
ambiguous argument by eliminating the senses that
fails to match one of its selectional restrictions.
Module 4
Lecture 6
▪ Dictionary based approach
Collocational Features
Collocational Features
● E.g. An electric guitar and bass player stand off to
one side which is not really part of the scene.
● A feature vector consisting of two words to the right
and left of the target word, along with their
respective POS is:
guitar(NN1) and (CJC) player(NN1) stand(VVB)
Co-occurrence Feature
Co-occurrence Feature
● Thus features are small number of frequently used
content words.
● This feature is effective in capturing general topic of
discourse in which target word has occurred.
● E.g. co-occurrence vector for the word bass would
have the following words as features:
○ fishing, big, sound, player, fly, rod, pound,
double, playing, guitar
● Using these words as features with a window size of
10 would be represented by the following vector:
Example: An electric guitar and bass player stand off
to one side which is not really part of the scene.
[0,0,0,1,0,0,0,0,0,1]
St. Francis Institute of Technology NLP
Department of Computer Engineering Ms. Pradnya Sawant 77
The material in this presentation belongs to St. Francis Institute of Technology and is solely for educational purposes. Distribution and modifications of the content is prohibited.
Module 4
Lecture 7
▪ Supervised (Naïve Bayes, Decision List)
▪ Introduction to Semi-supervised method
(Yarowsky) and Unsupervised (Hyperlex)
Bootstrapping Approaches
Bootstrapping Approaches
Unsupervised Methods