semantic parsing - columbia universitykathy/nlp/2017/classslides/class14... · 2017. 10. 24. ·...
TRANSCRIPT
![Page 1: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/1.jpg)
SemanticParsing
![Page 2: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/2.jpg)
Announcements• PlantoreleasemidtermgradesbyThursday• Onedaybehindonsyllabus.Willlikelydropimagecap:oning.
![Page 3: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/3.jpg)
Whatissemanticparsing?• Mappingtoameaningrepresenta:on• Seman:crepresenta:onwithdesiderata• Seman:croles• Composi:onality• Truthpreserving
• Applica:onrepresenta:on
![Page 4: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/4.jpg)
TwoExamples• ParsingintoAbstractMeaningRepresenta:on(AMR)• LanguagetoCode:learningparsersforif-this-then-thatrecipes• Simplerulesthatallowuserstocontrolaspectsoftheirdigitallivesincludingsmartphones• LargeonlinenaturallyoccurringrepositoryofNLdescrip:onsandassociatedcode
![Page 5: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/5.jpg)
TwoExamples• ParsingintoAbstractMeaningRepresenta2on• LanguagetoCode:learningparsersforif-this-then-thatrecipes• Simplerulesthatallowuserstocontrolaspectsoftheirdigitallivesincludingsmartphones• LargeonlinenaturallyoccurringrepositoryofNLdescrip:onsandassociatedcode
![Page 6: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/6.jpg)
AMRcharacteristics• Rooted,labeledgraphs• Abstractawayfromsyntac:cdifferences• Hedescribedherasagenius• Hisdescrip:onofher:genius• Shewasageniusaccordingtohisdescrip:on• UsePropbankframesets• “bondinvestor”:invest-01• HeavilybiasedtowardsEnglish
![Page 7: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/7.jpg)
• Variables(ornodes)foren::es,events,proper:es,states• Leafnodesarelabeledwithconcepts:• (b/boy)aninstanceoftheconceptboy
• Rela:onslinken::es• (d/die-01:loca:on(p/park)):therewasadeathinthepark
• AMRconcepts• Englishwords(e.g.,boy),Propbankframesets(e.g.,want-01)orspecialkeywords(en:ty-types,quan::esorconjunc:ons)
![Page 8: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/8.jpg)
AMRrelations• ~100rela:ons• Framearguments• Arg0,arg1,arg2,arg3,arg4,arg5(Propbank)
• Generalseman:crela:ons• :Accompanier,:age,:beneficiary,:cause,:compared-to,:concession,:condi:on,:consistof,:degree,:des:na:on,:direc:on,:domain,:dura:on,:employed-by,:example,:extent,:frequency,:instrument,:li,:loca:on,:manner,:medium,:mod,:mode,:name,:part,:path,:polarity,:poss,:purpose,:source,:subevent,:subset,::me,:topic,:value.
• Rela:onsforquan:ty• :quant,:unit,:scale
• Rela:onsfordateen:ty• :day,:month,:year,:weekday,::me,::mezone,:quarter,:dayperiod,:season,:year2,:decade,:century,:calendar,:era.
• Rela:onsforlists• :op1,:op2,….:op10
• Plusinverses(e.g.,:arg0-of,:loca:on-of)
![Page 9: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/9.jpg)
Framesets• ExamplesofusingFramesetstoextractawayfromEnglishsyntax• (d/describe-01• :arg0(m/man)• :arg1(m2/mission)• :arg2(d/disaster))
• :arg0thedescriber,:arg1thethingdescribed,:arg2whatitisdescribing• Themandescribedthemissionasadisaster.Asthemandescribedit,themissionwasadisaster
![Page 10: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/10.jpg)
Generalsemanticrelations• Non-corerela:ons• (s:hum-02• :arg0(s2/soldier)• :beneficiary(g/girl)• ::me(w/walk-01
• :arg0g• :des:na:on(t/town)))
• Thesoldierhummedtothegirlasshewalkedtotown.
![Page 11: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/11.jpg)
Co-reference• AMRabstractsawayfromsurfaceformsforco-referencesuchaspronouns,zero-pronouns,reflexive,controlstructure.Instead,variablesarere-used.• See“g”inpreviousexample.
![Page 12: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/12.jpg)
Inverserelations• Inordertoobtainrootedstructures• (s/sing-01• :arg0(b/boy
:source(c/college))
• Theboyfromthecollegesang.
![Page 13: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/13.jpg)
• (b/boy• :arg0-of(s/sing-01):source(c/college))thecollegeboywhosang
![Page 14: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/14.jpg)
ModalsandNegation• Nega:onisrepresentedwith:polarityandmodalityisrepresentedwithconcepts• (g/go-01
:arg0(b/boy):polarity-)
Theboydidnotgo.
![Page 15: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/15.jpg)
• (p/possible:domain(g/go-01 :arg0(b/boy)):polarity-))
Theboycannotgo.It’snotpossiblefortheboytogo.
![Page 16: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/16.jpg)
• (p/obligate-01:arg0(g/go-01 :arg0(b/boy)):polarity-)
• Theboydoesn’thavetogo.• Theboyisnotobligatedtogo.
![Page 17: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/17.jpg)
Questions• Amr-unknowntoindicatewh-ques:ons• (f/find-01
:arg0(g/girl):arg1(a/amr-unknown))
Whatdidthegirlfind?
![Page 18: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/18.jpg)
• (f/find-01):arg0(g/girl):arg1(b/boy):loca:on(a/amr-unknown))
Wheredidthegirlfindtheboy?
![Page 19: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/19.jpg)
• (f/find-01arg0(g/girl)arg1(t/toy :poss(a/amr-unknown))
Sentence??
![Page 20: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/20.jpg)
![Page 21: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/21.jpg)
Verbs• CorrespondtoPropbankframesets(l/look-05
arg0:(b/boy)arg1:(a/answer)
Theboylookeduptheanswer.Theboylookedtheanswerup.
![Page 22: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/22.jpg)
Nouns• PropBankverbframesetsrepresentmanynounsaswell(d/destroy-01
arg0:(b/boy)arg1:(r/room)
thedestruc:onoftheroombytheboytheboy’sdestruc:onoftheroomtheboydestroyedtheroom
![Page 23: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/23.jpg)
• Nominaliza:onisarole(s/see-01)
arg0:(j/judge)arg1:(e/explode-01))
Thejudgesawtheexplosion
![Page 24: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/24.jpg)
• Howabout?(r/read-01
:arg0(j/judge):arg1(t/thing :arg1-of(p/propose-01))
Sentence?
![Page 25: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/25.jpg)
![Page 26: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/26.jpg)
Adjectives• Canalsouseframesets(s/spy
:arg0-of(a/afract-01))theafrac:vespy
![Page 27: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/27.jpg)
• (s/spy:arg0-of(a/afract-01 :arg1(w/woman)))
NP?
![Page 28: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/28.jpg)
![Page 29: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/29.jpg)
Compositionality• Themeaningofthewholeisequaltothesumofthemeaningofitsparts
• HowisAMRcomposi:onal?(d/describe-01• :arg0(m/man):arg1(m2/mission):arg2(d/disaster))
• (s/spy:arg0-of(a/afract-01))
• WhatistheAMRfortheafrac:vespydescribedthemissionasadisaster?
![Page 30: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/30.jpg)
AMRdata• Availabledownloads:hfps://amr.isi.edu/download.html• LiflePrinceavailabletoall• EnglishandChinese
• Biomedicaldata• Generic,wide-rangingcontent:LDC
• ReferencesonAMRdata• Abstractmeaningrepresenta:onforsembanking:hfps://amr.isi.edu/a.pdf• GuidelinesforAMRannota:on:amr.isi.edu/language.html
![Page 31: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/31.jpg)
AMRparsing• Manyapproaches• E.g.,CCG,intologicalform,graphparsing,syntax-basedmachinetransla:on,hyperedgereplacementgrammars
• SemEval2016:Track8onAMRparsinghfp://alt.qcri.org/semeval2016/task8/• Today:AParserforAbstractMeaningRepresenta:onUsingLearningtoSearch
![Page 32: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/32.jpg)
LearningtoSearch(L2S)• Familyofapproachesthatsolvesstructuredpredic:onproblems• Decomposestheproduc:onofthestructuredoutputintermsofexplicitsearchspace• Learnshypothesesthatcontrolapolicythattakesac:onsinthesearchspace
• AMRisastructuredseman:crepresenta:on
• Modellearningofconceptsandrela:onsinaunifiedsejng.
![Page 33: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/33.jpg)
AMRparsingtaskdecomposed• Predic:ngconcepts• Predic:ngtheroot• Predic:ngrela:onsbetweenpredicatedconcepts
![Page 34: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/34.jpg)
Searchspace• States={x1,x2,....,xn,y1,y2,….,yi-1}wheretheinput{x1,x2,....,xn}arethenwordsofthesentence• Conceptpredic:on:labelsy1,y2,….,yi-1aretheconceptspredicteduptoi-1.• Nextac:on:yiistheconceptforwordxifromak-bestlistofconcepts
• Rela:onpredic:on:labelsarerela:onsforpredictedpairsofconcepts• Rootpredic:on:mul:-taskclassifierselectsrootconceptfromallpredictedconcepts
![Page 35: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/35.jpg)
Example
![Page 36: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/36.jpg)
Selectingk-bestlists• Conceptcandidates• Thesetofallconceptsassignedtosiintheen:retrainingdata• Ifsiunseen->lemma:zedspan,Propbankframes,andnull
• Rela:oncandidates(fromcitocj)• Unionof• Pairwisei,j:Alldirectedrela:onsfromcitocjwhentheyoccurredinthesameAMR
• Outgoingi:Alloutgoingrela:onsfromci• Incomingj:Allincomingrela:onsintocj
• Whenunseenintrainingdata,allrela:onsinthetrainingdata.
![Page 37: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/37.jpg)
Whatdoesthislooklike?
![Page 38: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/38.jpg)
Pre-processingfortraining• Wheredospanscomefrom?• JAMRalignertoalignsentenceswithAMRconceptsandrela:onsintrainingdata• Singlewordtosingleconcept• Spanofwordstographfragment:“StoriesfromNature”alignedtographrootedat“name”• Nameden::es• Mul:wordexpressions
• Wordalignedtonull• Func:onwords(e.g.,“to”,“a”,“the”)
![Page 39: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/39.jpg)
Singleconceptormultiple?• BarackObama• Atthedropofahat(e.g.,Iwoulddoanythingforyouatthedropofahat).• ThePresidentoftheUnitedStates
![Page 40: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/40.jpg)
![Page 41: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/41.jpg)
![Page 42: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/42.jpg)
![Page 43: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/43.jpg)
![Page 44: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/44.jpg)
AlignmentDetails• Forcedalignments• Someconceptsarenotalignedtowords• Forcealignmentsbasedoncount(unalignedconceptalignedtounalignedwords)acrosstrainingcorpus
• Test:me• Eachwordasinglespanexcept• Nameden::es• Dateand:memul:-wordexpressionsusingregularexpressions
![Page 45: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/45.jpg)
Learning• Ateachstate,learnmul:pleclassifiers• Oneconcept(rela:on)againstallothers
• Predicttheconcept,rela:on,rootsequencefortheen:resentence• UseHammingdistancetocomputetheloss• Adjustpredic:onbasedonloss->jointlearning
![Page 46: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/46.jpg)
FeaturesforLearningConcepts• Wordsinsiandcontext• POSofwordsinsiandcontext• Nameden:tytagsforwordsinsi• Binaryfeatureindica:ngwhetherwordsinsiarestopwords• Alldependencyedgesemana:ngfromwordsinsi• Binaryfeatureindica:ngwhethercistheconceptmostfrequentlyalignedwithsi• Predictedconceptsforthetwopreviousspans• Conceptlabelanditsconjunc:onwithallpreviousfeatures• IfthelabelisaFramesetfeature,thentheframeanditssense
![Page 47: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/47.jpg)
Whatdoesthislooklike?
![Page 48: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/48.jpg)
FeaturesforLearningRelations• Givencicjandr• Thetwoconcepts(cicj)andtheirconjunc:on• Wordsinthecorrespondingspansandtheirconjunc:ons• POStagsofwordsinspansandtheirconjunc:ons• Alldependencyedgeswithtailinwiandheadinwj• BinaryfeaturewhichistrueiffI<j• Rela:onlabelanditsconjunc:onwithallotherlabels
![Page 49: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/49.jpg)
FeaturesforLearningRoot• Conceptlabel.IftheconceptisaFrameset,thentheframeanditssense• Wordsinthespancorrespondingtoconcept• POStagsofwordsinthespan• Binaryfeatureindica:ngwhetheroneofthewordsinthespanistherootofthedependencytree
![Page 50: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/50.jpg)
SomeOddsandEnds• Connec:vity:• Foreachdisconnectedcomponent,finditsroot• Thenconnectroottorootofsentence
• Cycles• Nospecificconstraintsagainstcyclesinlearning• Inprac:ce,only5%ofpredictedAMRgraphshavecycles
![Page 51: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/51.jpg)
![Page 52: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/52.jpg)
Results• Useatool(Smatch)tocomparepredictedAMRwithgoldAMR• F1=.46• P=.51• R=.43• Meanofallsystemsinsharedtask:F1=.55,standarddevia:on.06
![Page 53: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/53.jpg)
TwoExamples• ParsingintoAbstractMeaningRepresenta:on(AMR)• LanguagetoCode:learningparsersforif-this-then-thatrecipes• Simplerulesthatallowuserstocontrolaspectsoftheirdigitallivesincludingsmartphones• LargeonlinenaturallyoccurringrepositoryofNLdescrip:onsandassociatedcode
![Page 54: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/54.jpg)
TaskerandIFFT• Simpleprogramswithtriggersandac:ons• PhillipsHuelightbulbstoflashredandbluewhentheCubshitahomerun.Homeautoma:onsensorsandcontrollers• Mo:ondetectors• Thermostats• Loca:onsensors• Garagedooropeners
• Usersdescribetherecipesinnaturallanguageandpublishthem
![Page 55: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/55.jpg)
Goal• Tobuildseman:cparsersthatmapfromNLdescrip:ontotheprogramautoma:cally• Collected114,408recipe-NLpairsfromthehfp://irf.comwebsite
![Page 56: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/56.jpg)
ExampleRecipes• TurnonmylightswhenIarrivehome• Textmeifthedooropnes• Addreceiptemailstoaspreadsheet• RemindmetodrinkwaterifI’vebeenatabarformorethan2hours.
![Page 57: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/57.jpg)
MTapproach• Createdacontextfreegrammarforprograms• GrammarforNLrecipes• Learntomapfromonetotheother• Useseparateclassifiersforeachpossibleac:on
![Page 58: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/58.jpg)
• Isitbe7ertoparseintoAMRordirectlyintothecommandlanguage?• WhatareprosforusingAMR?• WhatareconsforusingAMR?
![Page 59: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/59.jpg)
![Page 60: Semantic Parsing - Columbia Universitykathy/NLP/2017/ClassSlides/Class14... · 2017. 10. 24. · Two Examples • Parsing into Abstract Meaning Representaon (AMR) • Language to](https://reader034.vdocuments.site/reader034/viewer/2022051923/6010eba3ab7e3f39c26cfe69/html5/thumbnails/60.jpg)