15
Lecture 18: Semantic Role Labeling & Semantic Parsing Kai-Wei Chang CS @ University of Virginia [email protected] Couse webpage: http://kwchang.net/teaching/NLP16 1 CS6501-NLP

Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

  • Upload
    others

  • View
    14

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Lecture 18: Semantic Role Labeling &

Semantic Parsing

Kai-Wei ChangCS @ University of Virginia

[email protected]

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

1CS6501-NLP

Page 2: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Computational Semantics

vMany high-level applicationsvQuestion answeringv Information extractionv Internet botsvSiri/Cortana/Alexa/Google NowvTranslation

vShallow vs. deep semanticsvCheap, fast, low-level techniques v.s.

computational expensive, high-level techniques

CS6501-NLP 2

Page 3: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Semantic Roles

vPredicates: some words represent eventsvArguments: specific roles that involves in

the eventvPropBank

CS6501-NLP 3

Severalotheralternativerolelexicons

Page 4: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Semantic Roles

CS6501-NLP 4

Hisfatherwouldcomeupstairsandstandself-consciouslyAtthefootofthebedandlookathisson.

http://cogcomp.cs.illinois.edu/page/demo_view/srl

Page 5: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Semantic Role Labelling

vGive a sentence, identify predicate frames and annotate semantic roles

CS6501-NLP 5

Page 6: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Role Identification

CS6501-NLP 6

Wecanmodelitasmulti-classclassification

Page 7: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Role labeling

CS6501-NLP 7

Conductconstrainedinference

Page 8: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Semantic parsing

vMotivation: programming language vWhat is the meaning of 3+5*6

CS6501-NLP 8

ExamplesfromChrisManning’sNLPcourse

Page 9: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Semantic parsing

vMore complex meaningv3+5*x: we don’t know x at the compile time

v “Meaning” at a nodeis a piece of code

vForm is “rule-to-rule”translation

CS6501-NLP 9

Weprovideawaytoformthesemanticsfrombottom-up

Page 10: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Semantic Parsing

vParse a natural language narrative to a machine readable formatvLogic form:

John smokes.” “Everyone who smokes snores.”⇒∀x.smoke(x)→snore(x)

smoke(John) ⇒ snore(John)vEquations:

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

Page 11: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Logic

vBoolean: semantic values of sentencesvEntities: e.g., objects, times, etc.vFunction 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

Page 12: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Logic: 𝜆 terms

v𝜆 terms:square = 𝜆x x*x, square(3) = 3*3even = 𝜆x (x mod 2 == 0) a predicate

v Can take multiple arguments:𝜆x.[𝜆y.times(x,y)]

CS6501-NLP 12

Page 13: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Parse tree with associated semantics

CS6501-NLP 13

Page 14: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

CS6501-NLP 14

Page 15: Lecture 18: Semantic Role Labeling & Semantic Parsingkc2wc/teaching/NLP16/slides/18-Semantics.pdf · Semantic Roles vPredicates: some words represent events vArguments: specific roles

Paper presentations

vWe will learn recent NLP researchvTechniques and applications

vPeer reviewvGo to Collab →Select peer grading

CS6501-NLP 15