Professional Documents
Culture Documents
NLP 4
NLP 4
NLP 4
out u
Seranics involves figure
ia uage to procuce com
lang
mon -sense knowledge abo
TEESE and process world) j
®
t mode ls ofth e
construc
and
the word a eta
antning of leng G uege. General idea of semantic
one ccs isis assocetedtod wh with the mea
uage Sem et ces or utterances and map the
nten
sicis toto take naturel lanq G
aeerpretation
an sema mantic anay
ntic sis is concemed with Creating
analysis
monior some representati ‘ai on OF meenng ning
Cie} ter deals with the me
tus chap
tic inputs this - ics is inapieed by the aes
oui , ons fora = mea
the nng
naarinn Enquis
= ofof Engu isic approach to Semantics within linguistics. Model §
| esemtati
repr
es follo ws:
tics into two parts
of writen text we can civice seman semantics that logicians used for formal logical languages. Logicians focus on logical
mean ing ci incivi ual words (lexical semantics) and words (and, or, not, if, all, some, only, etc.) and do not pay attention to nomiogical
& We
«a The study of
yi ae 4 —
words
r
to give meaning to a sentence (or large (most nouns,verbs and adjectives). The primary advantage of this theory is its ability to
the study of how individual words combine
=
° .
A —_!
— s
units}|
=
mbine
ee to combine
i we need them meani of
into meaning
them into the meaning ofits parts. One important aspect of meaning is that it related
Once we have the meaning of the words sentences to
ionality someum the outside world. However, we do not know the world is. A model theoretic @pproach to
the whole sentence the principle-of semantic composit
ed of the meaning of semantics attemptto create a mode!of the worid and determine the truth of a sentance
principle states that the meaning of the whole sentence is compris
of fi
the sentenc e cen be n
compos edA tre
from ¢ sninn wf
the meaningof its using this model. In this theory, the truth of a sentence does not mean that sentence
ts parts thet is the meaning
7
is actually true; it simply means that the sentence is true in the worid being modeled.
constituent words. Netural languegesdo not obeythis principle of compositionality. Often,
a ‘the meaning of the whole is only partially dependent on th = meaning of Its constituents Model theoretic semantics is effective in studying pregmatic as well as semantics.
Le = = = £ + ji £ tnsingdiiale
\Z_y fesin collocates) and sometimes entirely different from the meanings of individuals (e.g., Amongthe source of knowledgetypically used are
in idioms).| e the meaningsof words, .
Hence, this decomposition of semantics may notbe realistic.W/ord meaning is just one e the meanings associated with grammatical structures,
component of semantics.The relationships that exist between words, the domain, the
* knowledge aboutthe structure of the discourse,
word order, the semantic structure, the underiying context and the real-world knowledge,
* Knowledge about the context in which the discourse is occurring, and
ail contribute to the meaning ofa sentencé.Still, compositional and lexical word semantics
remain the dominant approach to semantics in compositional linguistics. There are * Common-sense knowledge about the topic at hand
theories supporting the idea that linguistic knowledge is knowledge about words. This
means that the lexicon containsall the knowledge aboutlanguage. ,
{y_fi Ga)enerec
~ compositional semantics
involves how words combineto for ;
PEE oe
SP
of each word's !
Shee So, * hoowhedge
nani isn't enough for batitahitahe
understood, howis the overall compositional ws“aLephrase asi is meant to be
meaning must havesomething to do with the ibe ila he OES
the phrase. “I don't eat” and “I don't drink’, for example, expressreatdonate
— .
Semantic analysis ES : |e
of the differencein lexical meaning between “ear and “drink.” an een,
Language
generation (or, understanding) way in which the sentenceis constructed . Plays a role as well, as a
demonstra ted beiow. 4.
Ronaldo scored a beautiful
|like you. 2. You like me. Both sentence
S expresstotally different propositions. however
they have tha same words and each word has a clearly understood
goal! meaning. How is #-
——— a5 Syntactic parsing that the meaning has changed?In sentence.1, ‘I”= subject, "you" = object, while in the
NP a —~ (NP nounphrase, * second sentence these are reversed. This means that Overall meaning reles not only
Verb NP ~~ VP verb phrase)
7 | ~ on the meaning of each part, but additionally on syntacihe composition. This premuse is
Det Adjective Noun known as the principle of compositionality. All lanquages contain an infirete number of
f I N
Ronaldo scored a beautiful goal Morphology: score-d word combinations, so memorization of each separate phrasal meaning is mmpessbie.
Figure 1; Understanding Semantics This means that in order to understand the meanings of new phrases, one must rety
on individual word meanings ‘combined with the specific syntachc stucture The roles
Syntax-driven semantic analysis played by lexical and compositional semantics ere equally necessary with regard to
Assigning meaning representations to input based solely on static knowledge from the total understanding of a phrase or sentence. Knowledge of one without the other will
lexicon and the grammar,| _ invariably lead to miscommunication, and an understanding of denotaton, connotation.
and syntactical structure is necessary for compositional understanding of the whole.
1. Lexical semantics ines ee Understanding the difference between these terms and how the ideas they represent
So far, we have focused on the creation of meaning representation of whole sentence. interact is paramountto understanding the meaning of a phrase or sentence.
The approach we took supports the view that words contribute to the meaning of a
sentence but do not themselves have meaning. It is perhaps this view that has led some
an utterance?
to consider the lexicon as a simplelist of words. However,this is narrow concept, too What exactly is meant by “understanding”
a the utteeerance the case of coneneiy
far from reality. Words have meanings; they haveinternal structure, and are involved in * Extracting knowledge about the world from physica! and geometrical
linguis tic inpu
Physical things: ultimately translatng
.: fr ¢
different relationship with other words. All this information can be captured in a systematic
.
structure by lexicon. In this section, we focus on this and other issues related to words. terms... uh huh sage
%
ing how to use! |
More precisely, we focus on lexical semantics, which is concerned with the linguistic means knowing
: "Understanding language is presented with:a
ret
; examination:
ation: the :
studen t
study of systematic, meaning related structure of words or lexemes (the minimal unit and matriculabon
To master a technique. At
ae te
erie Bp
ee Pe
“= emt
mates)
>
| : (30) natura Language Processing
: ofreal )\ : a,
ric definition ransiated by matching SoU rce fragments against a database
“tis difficult to give one gene Way of
sis is probably the best
application of semantic analy’ the corresponding translation fragments, and then recombining —a3
e s Thinking of a concrete
text :
defining the problem
information retrieval
areas of natural language
Semantic analysis vs. other Google solves a Certain part of the problem iin a Statistical way: answers to “trivial kind
processing .
of questions can be located using a web search engine assumes a database (intemet) Be
ds oem
Phonetics: the study of linguistic soun and a clever page ranking system
components‘of words 7
Morphology: the study.of the meaning
e , Domain knowledge driven analysis
scored = score —d = Verb score + past tens expect certain “slots” of information to befilled in football example in the beginning:
employ, employee, employment, .. hearer is aware of missing details and may expect to hear them another example: _
ip een words
Syntax: a study ofthe structural relationsh betw booking a flight restricting to a certain domain allows the useof specific pattems, rules,
Semantics:the study of meaning ” expectations, etc. customer at a restaurant buyingtrain tickets .
discourse
Pragmatics: the study of how language is used to accomplish goals; Applications of semantic analysis
conventions (turn taking, politeness, etc.); relation between language and context-of-
Information extraction : extract small amounts of pertient information from large bodies :
use oO
of text to find an answerto a question for example €4°rdoc seoedy
Semantic analysis often requires syntactic parsing, pragmatics etc. too (in some form; n
not necessarily formallinguistics) Text su mmarization : Information retrieval (cf. Google) and documentclassificatio
Machine translation
JApproaches to semantic analysis for a
for
book plane tickets,query
Human-computer interaction : conversational agents.
Predicate logic restaurant
.
document”
The sentence "a restaurant that serves Chinese food near TUT” corresponds to the >: "please show mehowto widen the margins of my
Expert systems : free help:
meaning representation 3x Restaurant( x) A Serves( x, ChineseFood) A Near( LocationOf(
Surveillance
x), LocationOf( TUT) semantic analysis is equivalentto creating meaning representations
_and
Several well-defined problems unsolved
applicat ions yet
from language.
A few remaining problems
scalability problem (large vocabulary or unrestricted domain) List on the rightiis from Jim Gray s Turing talk: “What next?
in IT"
Statistical approach |
Statistical machine translation (as an example)
find a bilingual database(e.g. parliamentary proceedings in two languages)
learn an alignment: words and phrasesthat correspond to each
other
earn wordorderin
lea i the target , language (probabilities of target word strings)
,
Semantic Analysis
(122) Natural Language Processing
properties of the phrase. Thus,if the head is anoun,the phraseIscalled afeun phrase,
if head is a verb.then the phrase is a verb phrase andso onfor other lexical categories
such as adjective and prepositions. Figure below shows the sentences with the noun
Dhrase verb phrase and preposition phrase.
s32-5-
= r constituents.
~si4 fe 2
ey
Srees =Ts= and
e . et MS= O80,
Je
The
aed
fo
Wimb ihe rein.i
The roin
oY ledo
Hi. n Court , The
-
beautiful garden
ate
on at
NIG
yin + Wetec4
Poweses het can occur in
-_ =
z — — os 4 ow
“VP one at adjective. For example, it may include a PreDRs “ional phrase (PP). More than one
rr adjective is handled byallowing an adjecti '
ve phrase (AP) for the adjective in the rule.
after incorporating PP and AP in the phrase structure rule. we ce* the fo!
i
) [|
Qa
nyttlehae a Se
Cold banana shake.... (5)
Noun phrase
Let's see how the abovephrases can be generated using phrase structure tues. The (7)
fA noun phrase is a phrase whose head is a noun or a pronoun, optionally accompanied
phrase consists only of a pronoun. The (2) phrase consists of 8 cetermner. an anpect
Bes
by a set of modifiers. It can function as a subject, object or compliment. The modifiers of
(foggy) that stands foran entire adjective phrase. anc a noun The (3} ptrase comanses
a noun phrase can we determine hoursor adjective phrase. The obligatory constituentof
sists ofof 2 determiner
and adjective phrase and noun, (4) phrase comsists (ws an :acecine
Cetermines (he). ‘
a noun phraseis the noun head-all other constituents are optional. These structures can
onai phrase
phrase (beautiful), a noun (lake) and a prepostone ph (in Kashrs} anc (5) atres®
be represented using the phrasestructure rule. As discussed earlier, phrase structure a . suence of nouns. A noun sentenne = fermec 2
rules are of the form A —-BC, which states that constituent A can be rewritten as two
consists of an adjective followed by a sequence oF DOUrS. “ - .
as nominal. None of the phrase structure Tees oscusse
: un, ? discussed =
so fat ae ale hanoe :4
constitutes B and C. These rules specify the element can occur in a phrase and in what ver thes Sftuaton. Ba
nominals.So, we modify our rulesCover
order. Using this notation, we can representthe phrasestructure rules for a noun phrase
as follows. NP — (Det) (AP) Nom (PP)
NP —+ Pronoun Nom — Noun | Noun Nom
bect orSS %
a predicate. The way
i,” — 2 Say lesS
SSL ae
subjej ct. 29 Come
NP — Det Noun Anoun phrase can act as a
NP — Noun demonstrate eachof these uses.
natch. wee
the mea
her disturbed ine
pabey
NP —- Adj Noun The fiOggy damped weat
2hti —— (2)
cold banana5 sh3s |
NP — Det Adj Noun ! Would like
j a nice
ji
caLOM. -.- a
feat [OCA 3)
aytify
. & beau
We can combineall theserule in a single phrase structure rule as follows: Kula botanical gardenIs ai ¥ ; anim Glass
aS subject. In (
n 2) fs
+ aya ae
ah
Sy
ate
7
a)
Ub
vt
a
ope
,
3.
‘Tt
1
4
>]
a
1
,
4
2
a
}
@4
oe
we
As you can see from these examples a verb phrase can have a verb {VP —+ Verbin (1)},
is an example.
@ verb followed by an NP {VP — Verb NP in (2)}, a verb followed by a PP {VP —+ Verb
Time passes very quickly.
PP in (3)}, a verb followed by two NPs (VP — Verb NP NP in (4)}, or a verb followed by
two NPs and a PP {VP — Verb NP NP PP in (5)}. In general, the number of NPs in BP is AdvP — (Intens) Adv
limited to two, whereasit is possible to add more than two PPs. Sentences
VP — Verb (NP) (NP) (PP)* Having discussed phraseStructures, sentences A secterce can Neve bearng structure
Things are further complicated by the fact that gbjects mayalso be entire clausesyas in commonly known structures are Ceciaratve structure. mperstwe stuchure yesne
the sentence, / knowthat Taj is one of the seven wonders. Hence, we mustalso allow for question structure and WH question structure
2n alternative phrase statement rule, in with NP is replaced by S. 5 <= yec* Islet rahe tee Taam
Sentences with a declarative structure have 2 Sufnect towet ty = Ore
VP — Verb S predicate of a declarative sentenceis a noun Dorase anc ofeticate G3 ve"> Sees. & B..
Prepositional Phrase ! like horse riding. The phrase structure tule for ceciaraive Sentences are Sem tenonsS
Prepositional phrases are headed by a preposition, They consist of a preposition, possibly S— NP VP
followed by someother constituent, usually a noun phrase, trocture usually
Sentences with an imperative simecture Ususey begin
Sey with the werd ptrase anc lack
: . mac pi cantances 5 ircokcst and s understood ip he “yeu
We played volleyball on the beach. Subject. The subjectof these types of sentences S maid
ca fy commands and $uggesiors, as See we
We can have a preposition phrasethat consists
of just a preposition.
These types of sentences are used SF cymes *
John went outside.
Called imperative. The grammar+ mie
mole for
OF this
SS kind
© of sentence struchre S
ee OF
.
© Show methelatest design s tions which can be answered ° Lexical semantics information iis usefulfor
wide variety of NLP applications. This
question structure ask que
Sentences with the yes -no ver b, followed by a subject NP. discusses a variety of relationship that holds among lexemes and their senses.
begin with an auxil iary
ences
using yes or no. These sent
examples Homonym _~-
followed by a VP. Here are some
my which is perhaps the simpieat™
The first relationship that we discuss is homony
Do you have a Red pen?
relationship that exists among lexemes. Homonyms are wordsthat have the same form ;
Is awake and cotter? onymy iBaniriver|:
but have different, unrelated meanings. A classic example of hom
bank orfinancial institution). A related idea isthat of homophones that 'refers to words:
Is the game over?
~Can you show me your album? that are pronounced in the same way butdifferent meaning or spelling of both
isg.. be
rule for the expansion of as, as follows: bie
We expand our grammarby adding another and bee, bear and bare ).
“S — Aux NP VP
Polysemy . a
complex. These sentences begin with polysemes |are es
Sentences with WH question structure are more
question may have a WH Many words have more than one meaningof sense. Unlike homonyms,
WHwords (who, which, where, what why and how). A WH §
phenomenon is called polysemy or lexical a
the following WH questions: words with related meanings. This linguistic
Consider
phraseas a subject or mayinclu de another subject. ambiguous andcalled polysemous. For oo
ambiguity. Words that have several senses are as
Which team won the match? of furniture, a person, the act of presiding
example, the word “chair” can refer to a piece
a WH word. How oy"Is a-poly semy asiits two meaning- to hire —
This sentence is similar to a declarative sentence except it contains over a discussion etc. The word “
empl
use, only -
simple rule to handle this typeof sentencestructureis y2an idea)are related. In a particular
(employ a person) and to accept (emplo
S — Wh-NP VP one of these meanings is correct. .
Another type of WH questions structure is one that involves more than one NP.In this
Hyponymy ~~ ree
hypemym ohiae
type of questions, the auxiliary verb comes before the subject NP, just as in yes-no generalsense. The word automobileisa
The hypernymiisa word with the more . In the
questions structure. is a wordw ithth e most specific meaning
for a car and a truck. The hyponym
is a hyponymof automobile.Antonymis;
Which cameras can you show mein your shop?
relationship between car and automobile, car : The ce
ings.
ess opposite mean
Therule for this type of WH questionsis holds betwee n words that expr og
a semantic relationship that nym of Blac k.
is an anto
of Bad, and Wh ite
word Good is an antonym
e S$ —> Wh-NP Aux NP VP
SemanticAnalysis
| 4(hard movefastorto direct and manage). But this does not create :3
: —
Automatic Query Expansion: WordNet semantic relations can be involved in the automatic interpretation of natural languages. si a
used to expand
queries so that the search for a documentis not confined to the Ambiguity is the property oflinguistic expressions. Ambiguity means capable of being ~
pattern-matching of
query terms, but also covers synonyms. understood in more. than one way of having more than one- meaning. It refers to a 4
Document Summarization: WordNethas found useful situation where an expression can have more thanonepartition. Ambiguity can occur at a: :
application in text summarization.
Few approachesutilize information from WordNet four different levels: ; %
to computelexical chains.
~ Lexical
5. Robust Word Sense Disambiguation (WSD
)-
Dictionary based approach to its internal structure or to its syntactic class. For example in the sentence, look at the
_. aoe
Mostofusfind it difficult to understand screen, look is verb where as in she gave me a stem look,itis a noun. However this type sy
by computers are not able to under
stand language
the way people are. This is because
we do not realise how weight and ambig
of ambiguity is viewed as part of speech tagging in NLP andis considered to have been oe
uous natural
languagesare. Ambiguity that is Solved with reasonable accuracy.
having more than one meaning,
can be result of syntax.
Or semantics. Vaguenessis not
the same as amb iguity. In vague
have only one meaning but theyla
ness, words or phrases _
ckclarity, which makes it diffic
meaning. ult to arrive at a precise
.
In many cases, a single
. word in a | anguage corr
ta esponds to more than
a
= for example the noun Bank one thought,
(financia | institution of
bank of a river) and the ver
b run (to
‘Asthe name suggests,for disambiguation, these methods primarily rely on dictionateg cone:
Solid body which
faites {0 a point
treasures and lexical knowledge base. They do not use corpora evidencg ie
~ disambiguation. The Lesk methodis the seminal dictionary-based method introducead . something of this shape whether
Solid or hollow
2 byMichael Lesk in 1986. The Lesk definition, on which the Lesk algorithm is based, jg Fruit of certain evergreen trees
“measure overlap between sensedefinitions for all words in context”. Howe As can be seen,
in 2000, Kilgarriff and Rosensweig gave the simplified Lesk definition as ‘‘Measure pine#1 ¢ Cone#1 = 0
overlap between sense definitions of word and current context”, which furthe, pine#2 G Cone#1 =0
meansidentify the correct sense for one word ata time. Here the current contextjis the pine#1 G Cone#2 = 1
set of words in the surrounding sentence or paragraph.
pine#2 ¢ Cone#2= 0
The Leskalgorithm is based on the assumption that words in a given “neighbourhoog: Pine#1 © Cone#3 = 2°
(section of text) will tend to share a commontopic. A simplified version of the Lesk
Pine#2 ¢ Cone#3 = 0
algorithm is to compare the dictionary definition of an ambiguous wordwith the terms
contained in its neighbourhood. the best intersection is Pine #1 C Cone #3 = 2.
Versions have been adapted to use WordNet. An implementation might look like this: -
1. for every sense of the word being disambiguated one should count the amountof
wordsthat are in both neighbourhoodof that word and in the dictionary definition of
that sense ,
2. the sense that is to be chosen is the sense which has the biggest number ofthis
count
A frequently used example illustrating this algorithm is for the context “pine cone”. The
following dictionary definitions are used:
Pine:
e Kinds of evergreen tree with needle-shapedleaves
¢ Waste away through sorroworillness
4 ye