You are on page 1of 15

Lecture 18:

Semantic Role Labeling &


Semantic Parsing

Kai-Wei Chang
CS @ University of Virginia
kw@kwchang.net

Couse webpage: http://kwchang.net/teaching/NLP16

CS6501-NLP 1
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Computational Semantics

v Many high-level applications


v Question answering
v Information extraction
v Internet bots
v Siri/Cortana/Alexa/Google Now
v Translation
v Shallow vs. deep semantics
v Cheap, fast, low-level techniques v.s.
computational expensive, high-level techniques

CS6501-NLP 2
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Semantic Roles

v Predicates: some words represent events


v Arguments: specific roles that involves in
the event
v PropBank Several other alternative role lexicons

CS6501-NLP 3
CuuDuongThanCong.com https://fb.com/tailieudientucntt
http://cogcomp.cs.illinois.edu/page/demo_view/srl

Semantic Roles
His father would come upstairs and stand self-consciously
At the foot of the bed and look at his son.

CS6501-NLP 4
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Semantic Role Labelling

v Give a sentence, identify predicate frames


and annotate semantic roles

CS6501-NLP 5
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Role Identification

We can model it as multi-class classification

CS6501-NLP 6
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Role labeling

Conduct constrained inference


CS6501-NLP 7
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Semantic parsing

v Motivation: programming language


v What is the meaning of 3+5*6

Examples from Chris Manning’s NLP course


CS6501-NLP 8
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Semantic parsing

v More complex meaning


v 3+5*x: we don’t know x at the compile time
v “Meaning” at a node
is a piece of code
v Form is “rule-to-rule”
translation

We provide a way to form the semantics from bottom-up


CS6501-NLP 9
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Semantic Parsing

v Parse a natural language narrative to a


machine readable format
v Logic form:
John smokes.” “Everyone who smokes snores.”
⇒ ∀x.smoke(x)→snore(x)
smoke(John) ⇒ snore(John)
v Equations:
Maria is now four times as old as Kate. Four years ago,
Maria was six times as old as Kate. Find their ages now.
m=4×n m − 4 = 6 × (n − 4)

CS6501-NLP 10
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Logic

v Boolean: semantic values of sentences


v Entities: e.g., objects, times, etc.
v Function of various types
A function returning a boolean called “predicate”
e.g., green (x)
Function can return other functions or take functions
as arguments

CS6501-NLP 11
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Logic: 𝜆 terms

v𝜆 terms:
square = 𝜆x x*x, square(3) = 3*3
even = 𝜆x (x mod 2 == 0) a predicate
v Can take multiple arguments:
𝜆 x.[𝜆 y.times(x,y)]

CS6501-NLP 12
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Parse tree with associated semantics

CS6501-NLP 13
CuuDuongThanCong.com https://fb.com/tailieudientucntt
CS6501-NLP 14
CuuDuongThanCong.com https://fb.com/tailieudientucntt
Paper presentations

v We will learn recent NLP research


v Techniques and applications
v Peer review
v Go to Collab → Select peer grading

CS6501-NLP 15
CuuDuongThanCong.com https://fb.com/tailieudientucntt

You might also like