Semantic Parsing Converting natural language to a logical form eg executable code for a specific application Example Airline reservations Geographical query systems Stages of Semantic Parsing ID: 759681
Download Presentation The PPT/PDF document "NLP Introduction to NLP Semantic Parsing" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
NLP
Slide2Introduction to NLP
Semantic Parsing
Slide3Semantic Parsing
Converting natural language to a logical form
e.g., executable code for a specific application
Example:
Airline reservations
Geographical query systems
Slide4Stages of Semantic Parsing
Input
Sentence
Syntactic Analysis
Syntactic structure
Semantic Analysis
Semantic representation
Slide5Compositional Semantics
Add semantic attachments to CFG rules
Compositional semantics
Parse the sentence syntactically
Associate some semantics to each word
Combine the semantics of words and non-terminals recursively
Until the root of the sentence
Slide6Example
Input
Javier likes pizza
Output
like(Javier
, pizza
)
Slide7Example
S -> NP VP {
VP.Sem
(
NP.Sem
)} t
VP -> V NP {
V.Sem
(
NP.Sem
)} <
e,t
>
NP -> N {
N.Sem
} e
V ->
likes
{
λ
x,y
likes(
x,y
) <e,<
e
,t
>>
N -> Javier {Javier} e
N -> pizza {pizza} e
Slide8Semantic Parsing
Associate a semantic expression with each node
Javier
likes
pizza
V: λ x,y likes(x,y)
N: pizza
VP: λx likes(x,pizza)
N: Javier
S: likes(Javier, pizza)
Slide9Grammar with Semantic Attachments
Example from Jurafsky and Martin
Slide10Using CCG (Steedman 1996)
CCG representations for semanticsADJ: λx.tall(x)(S\NP)/ADJ : λf.λx.f(x)NP: YaoMing
YaoMing is tall
NP (S\NP)/ADJ
ADJ
YaoMing λf.λx.f(x) λx.tall(x)
>
<
S\NP
λ
x.
tall(x)
S
Tall (
YaoMing
)
Slide11CCG Parsing
Example:
https
://bitbucket.org/yoavartzi/spf
Tutorial by
Artzi
, FitzGerald,
Zettlemoyer
http://yoavartzi.com/pub/afz-tutorial.acl.2013.pdf
Slide12GeoQuery (Zelle and Mooney 1996)
Slide13Zettlemoyer and Collins (2005)
Slide14Zettlemoyer and Collins (2005)
Slide15Dong and Lapata (2016)
Slide16Dong and
Lapata
(2016)
Slide17Dong and
Lapata
(2016)
Slide18FrameNet
Represents
Events, relations, states, entities
1,195 semantic frames
Example:
Absorb_heat
An
Entity (generally food) is exposed to a
Heat_source
whose Temperature may also be specified. Generally, the Entity undergoes some sort of change as a result of this process.
Bacon was frying in the pan, and a great heap of eggs already lay steaming on a
plate.
I
f
it cooks at 400 for an hour, it 'll be nothing but a pile of ash
!
1,774 frame-to-frame relations
Links
https
://framenet.icsi.berkeley.edu/fndrupal
/
http://
naacl.org/naacl-hlt-2015/tutorial-framenet.html
Abstract Meaning Representation (AMR)
http://amr.isi.edu/Single structure that includes:Predicate-Argument StructureNamed Entity RecognitionCoreference ResolutionWikification
[slide from Jonathan
Kummerfeld
]
Slide21Example
“Lassie ate four bones that she found.”
[slide from Jonathan Kummerfeld]
e / eat-01
a / animal
b / bone
4
f / find-01
“Lassie”
n / name
wiki: “Lassie”
Arg-0
Arg-0
Arg-
1
Arg-
1
Slide22Example
About 14,000 people fled their homes at the weekend after a local tsunami warning was issued, the UN said on its Web site
(s / say-01
:ARG0 (g / organization
:name (n / name
:op1 "UN"))
:ARG1 (f / flee-01
:ARG0 (p / person
:quant (a / about
:op1 14000))
:ARG1 (h / home :
poss
p)
:time (w / weekend)
:time (a2 / after
:op1 (w2 / warn-01
:ARG1 (t / tsunami)
:location (l / local))))
:medium (s2 / site
:
poss
g
:mod (w3 / web)))
Status of AMR
AMR currently lacksMultilingual considerationQuantifier scopeCo-references across sentencesGrammatical number, tense, aspect, quotation marksMany noun-noun or noun-adjective relationsMany detailed frames, e.g. Earthquake (with roles for magnitude, epicenter, casualties, etc)
[slide from Jonathan
Kummerfeld
]
Slide24AMR Parsing (Wang et al. 2015,16)
Slide25AMR Parsing (Wang et al. 2015,16)
Slide26AMR Parsing (Wang et al. 2015,16)
Slide27NLP