Unit4 Final
Unit4 Final
Unit4 Final
Example:
The correct sense depends on the context in which the word is used.
Illustration of syntactic tree:
PROPOSITION BANK:
Information extraction (IE)
The task of automatically extracting structured information from
unstructured and/or semi-structured machine-readable documents and
other electronically represented sources is known as information
extraction (IE).
When there are a significant number of customers, manually assessing
Customer Feedback, for example, can be tedious, error-prone, and time-
consuming. There's a good chance we'll overlook a dissatisfied consumer.
Fortunately, sentiment analysis can aid in the improvement of customer
support interactions' speed and efficacy. By doing sentiment analysis on
all the incoming tickets and prioritizing them above the others, one can
quickly identify the most dissatisfied customers or the most important
issues. One might also allocate tickets to the appropriate individual or
team to handle them. As a result, Consumer satisfaction will improve
dramatically.
1. Initial processing.
3. Parsing.
5. Anaphora resolution.
The first step is to break down a text into fragments such as zones,
phrases, segments, and tokens. This function can be performed by
tokenizers, text zoners, segmenters, and splitters, among other
components. In the initial processing stage, part-of-speech tagging, and
phrasal unit identification (noun or verb phrases) are usually the next
tasks.
3. Parsing
The syntactic analysis of the sentences in the texts is done at this step.
After recognizing the fundamental entities in the previous stage, the
sentences are processed to find the noun groups that surround some of
those entities and verb groups. At the pattern matching step, the noun and
verb groupings are utilized as sections to begin working on.
This stage entails converting the structures collected during the preceding
processes into output templates that follow the format defined by the user.
It might comprise a variety of normalization processes.
Spacy:
1. Regular Expression.
2. Part-of-speech tagging.
4. Topic Modeling.
5. Rule-Based Matching.
1. Regular Expression:
Any word or group of words that consistently refers to the same item is
considered an entity.
4. Topic Modeling:
5. Rule-Based Matching:
This enables easy access to and examination of the tokens in the area, as
well as the merging of spans into single tokens and the addition of entries
to defined entities.
Token-based matching
Token annotations can be referred to by rules in this case. You can also
use the rule matcher to pass in a custom callback to act on matches. You
may also attach patterns to entity IDs to provide basic entity linking and
disambiguation. You may utilize the PhraseMatcher, which takes Doc
objects as match patterns, to match big terminology lists.
Phrase Matching
Conclusion
Several methods can be used for template filling, ranging from rule-based
systems to more advanced machine learning and deep learning
approaches:
4
Selectional restrictions
vary
in
specificity
I
often
ask
the
musicians
to
imagine
a
tennis
game.
To
diagonalize a
matrix
is
to
find
its
eigenvalues.
Radon
is
an
odorless
gas
that
can’t
be
detected
by
human
senses.
5
t consists of a single variable that stands for the event, a predicat
ntribution of a verb like=>eat might look like the following:
dish
f event, and variables=>and relations
nutriment, for the event
nourishment, roles. Ignoring t
nutrition...
ctures andRepresenting
using thematic=> sroles
9e, x, y rather
=> food, nutrient
Eating(e) Agent(e, x) than
T deep
heme(e,
electional restrictions
^
substance
^ y)event roles, the
on of a verb like eat might look like
=> matter
th this representation, all we know about y, the
the following:
filler
=> physical entity
of the THEME role, is th
Instead
owith
s associated f
representing
an Eating “event
eat”
athrough
s: => entity
the Theme relation. To stipulate t
ectional restriction
9e, x, y Eating(e)
that y must be ^ Agent(e,
something x)
edible,
^
Figure 22.6 Evidence from WordNet that hamburgers are edible.
T
weheme(e, y)
simply add a new term
t effect:
Just
add:
representation, all we know about y, the filler
9e, x, y Eating(e) ^ Agent(e, x) ^ T heme(e, y) ^ EdibleT hing(y)of the THEME
When a phrase like ate a hamburger is encountered, a semantic analyzer can
ro
iatedformwith an Eating
the following kind of event through the Theme relation. To
representation: sti
And
“eat
a
hamburger”
becomes
l restriction that y must be something edible, we simply add a ne
9e, x, y Eating(e) ^ Eater(e, x) ^ T heme(e, y) ^ EdibleT hing(y) ^ Hamburger(y)
:
But
this
assumes
This representation we
reasonable
is perfectly have
a
large
sincekthenowledge
membership base
of yoinf
the
facts
category
9e,6x, y Eating(e)
Hamburger
about
iseconsistent Agent(e,
dible
^things
with its hx)
membership
and
^ T inheme(e,
amburgers
and
wy)
the category ^ EdibleT
EdibleThing,
hatnot. hing(y)
assuming
Let’s
use
WordNet synsets to
specify
selectional restrictions
• The
THEME of
eat
must
be WordNet synset {food,
nutrient}
“any
substance
that
can
be
metabolized
by
an
animal
to
give
energy
and
build
tissue”
• Similarly
THEME of
imagine:
synset {entity}
THEME of
lift:
synset {physical
entity}
THEME of
diagonalize:
synset {matrix}
• This
allows
imagine
a
hamburger
and
lift
a
hamburger,
• Correctly
rules
out
7 diagonalize a
hamburger.
Selectional
Restrictions
Selectional Preferences
Selectional Preferences
• In
early
implementations,
selectional restrictions
were
strict
constraints
(Katz
and
Fodor
1963)
• Eat
[+FOOD]
• But
it
was
quickly
realized
selectional constraints
are
really
preferences (Wilks 1975)
• But
it
fell
apart
in
1931,
perhaps
because
people
realized
you
can’t
eat
gold
for
lunch
if
you’re
hungry.
• In
his
two
championship
trials,
Mr.
Kulkarni
ate
glass
on
an
empty
stomach,
accompanied
only
by
water
and
tea.
9
Selectional Association
(Resnik 1993)
• Selectional preference
strength:
amount
of
information
that
a
predicate
tells
us
about
the
semantic
class
of
its
arguments.
• eat
tells
us
a
lot
about
the
semantic
class
of
its
direct
objects
• be
doesn’t
tell
us
much
• The
selectional preference
strength
• difference
in
information
between
two
distributions:
P(c)
the
distribution
of
expected
semantic
classes
for
any
direct
object
P(c|v)
the
distribution
of
expected
semantic
classes
for
this
verb
• The
greater
the
difference,
the
more
the
verb
is
constraining
its
object
10
it that the direct object of the specific verb v will fall into semantic class c). The
greater
greater the the differencebetween
difference between these
these distributions,
distributions,thethe
more
moreinformation the verb
information the isverb is
giving us about possible objects. The difference between these two distributions can
giving us about possible objects. The difference between these two distributions can
relative entropy
ve entropy
KL divergence
Selectional preference
strength
be quantified by relative entropy, or the Kullback-Leibler divergence (Kullback and
be quantified by relative
Leibler, 1951). entropy, or the
The Kullback-Leibler Kullback-Leibler
or KL divergence D(P||Q)divergence
expresses(Kullback
the dif- and
divergence Leibler, 1951).
ference Thetwo
between Kullback-Leibler or KL Pdivergence
probability distributions and Q (we’llD(P||Q)
return to expresses
this when wethe dif-
ference between
discuss two probability
distributional models of distributions
meaning in P and17).
Chapter Q (we’ll return to this when we
• Relative
entropy,
or
the
Kullback-‐Leibler divergence
is
the
difference
discuss distributional models of meaning in Chapter 17).
between
two
distributions X P(x)
D(P||Q) = P(x) log (22.38)
X Q(x)
P(x)
x
D(P||Q) = P(x) log (22.38)
Q(x)
The selectional preference SR (v) usesxthe KL divergence to express how much
information, in bits, the verb v expresses about the possible semantic class of its
• Selectional
The preference:
selectional
argument.
How
SRm(v)
preference uch
information
uses (in
bits)
the KL divergence the
verb
to express howexpresses
much
about
the
semantic
information, class
in bits, the verb of
vits
argument
expresses about the possible semantic class of its
argument. SR (v) = D(P(c|v)||P(c))
X P(c|v)
22.7 • S ELECTIONAL R ESTRICTIONS 15
= P(c|v) log (22.39)
SR (v) = D(P(c|v)||P(c))
c
P(c)
X to the general P(c|v)
Selectional
•selectional Association
as the relative o
contribution f
a
of
vthat
erb
= w
class ith
a
c lass:
T he
r elative
contribution
selectional preference of the of
the
P(c|v) log a particular class and verb(22.39)
association verb:Resnik then defines the selectional association of
class
to
the
general
preference
of
c the
verb P(c)
1 P(c|v)
11
selectional AR (v,
Resnik then defines the c) =
selectional P(c|v) log of a particular class and
association (22.40)
verb
association SR (v) P(c)
22.7 • S ELECTIONAL R ESTRICTI
Conclusion
Summary:
Selectional Restrictions
• Two
classes
of
models
of
the
semantic
type
constraint
that
a
predicate
places
on
its
argument:
• Represent
the
constraint
between
predicate
and
WordNet class
• Represent
the
constraint
between
predicate
and
a
word
• One
fun
recent
use
case:
detecting
metonomy (type
coercion)
• Coherent
with
selectional restrictions: Pustejovsky et
al
(2010)
The
spokesman
denied
the
statement
(PROPOSITION).
The
child
threw
the
stone
(PHYSICAL
OBJECT)
• Coercion:
The
president
denied
the
attack
(EVENT
→
PROPOSITION).
17
The
White
House
(LOCATION
→
HUMAN)
denied
the
statement.