ccg parsing - cs.utexas.edu

18
CCG Parsing

Upload: others

Post on 07-Jan-2022

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CCG Parsing - cs.utexas.edu

CCGParsing

Page 2: CCG Parsing - cs.utexas.edu

CCGParsing

Ze-lemoyerandCollins(2005)

‣ “What”isaverycomplextype:needsanounandneedsaS\NPtoformasentence.S\NPisbasicallyaverbphrase(borderTexas)

Page 3: CCG Parsing - cs.utexas.edu

CCGParsing

Ze-lemoyerandCollins(2005)

‣ “What”isaverycomplextype:needsanounandneedsaS\NPtoformasentence.S\NPisbasicallyaverbphrase(borderTexas)

‣Whatinthiscaseknowsthattherearetwopredicates(statesandborderTexas).Thisisnotageneralthing

Page 4: CCG Parsing - cs.utexas.edu

CCGParsing

‣ ThesequesMonarecomposi2onal:wecanbuildbiggeronesoutofsmallerpieces

WhatstatesborderTexas?

WhatstatesborderstatesborderingTexas?

WhatstatesborderstatesborderingstatesborderingTexas?

‣ Ingeneral,answeringthisdoesrequireparsingandnotjustslot-filling

Page 5: CCG Parsing - cs.utexas.edu

CCGParsing

Slidecredit:DanKlein

‣ “to”needsanNP(desMnaMon)andN(parent)‣ “Showme”isano-op

Page 6: CCG Parsing - cs.utexas.edu

CCGParsing

Ze-lemoyerandCollins(2005)

‣Manywaystobuildtheseparsers

‣ Oneapproach:runa“supertagger”(tagsthesentencewithcomplexlabels),thenruntheparser

‣ Parsingiseasyonceyouhavethetags,sowe’vereducedittoa(hard)taggingproblem

Page 7: CCG Parsing - cs.utexas.edu

TrainingCCGParsers‣ Trainingdatalookslikepairsofsentencesandlogicalforms

WhatstatesborderTexas λx. state(x) ∧ borders(x, e89)

WhatbordersTexas λx. borders(x, e89)…

‣Whatcanwelearnfromthese?

‣ TexascorrespondstoNP|e89inthelogicalform(easytofigureout)

(S/(S\NP))/N|λf.λg.λx. f(x) ∧ g(x)‣Whatcorrespondsto

‣ Howdoweinferthatwithoutbeingtoldit?

‣ Problem:wedon’tknowthederivaMon

Page 8: CCG Parsing - cs.utexas.edu

Lexicon

WhatstatesborderTexas λx. state(x) ∧ borders(x, e89)

‣ Anysubstringcanparsetoanyoftheseinthelexicon

‣ Chunksinferredfromthelogicformbasedonrules:

‣ GENLEX:takessentenceSandlogicalformL.BreakuplogicalformintochunksC(L),assumeanysubstringofSmightmaptoanychunk

‣ Texas->NP:e89iscorrect‣ borderTexas->NP:e89‣WhatstatesborderTexas->NP:e89… Ze-lemoyerandCollins(2005)

‣ NP:e89 ‣ (S\NP)/NP:λx.λy. borders(x,y)

Page 9: CCG Parsing - cs.utexas.edu

Learning

Ze-lemoyerandCollins(2005)

‣ IteraMveprocedure:esMmate“best”parsesthatderiveeachlogicalform,retraintheparserusingtheseparseswithsupervisedlearning

‣ Unsupervisedlearningofcorrespondences,likewordalignment

‣ EventuallyweconvergeontherightparsesatthesameMmethatwelearnamodeltobuildthem

Page 10: CCG Parsing - cs.utexas.edu

Seq2seqSemanMcParsing

Page 11: CCG Parsing - cs.utexas.edu

SemanMcParsingasTranslaMon

JiaandLiang(2016)

‣WritedownalinearizedformofthesemanMcparse,trainseq2seqmodelstodirectlytranslateintothisrepresentaMon

‣Whatmightbesomeconcernsaboutthisapproach?HowdowemiMgatethem?

“whatstatesborderTexas”

lambda x ( state ( x ) and border ( x , e89 ) ) )

‣Whataresomebenefitsofthisapproachcomparedtogrammar-based?

Page 12: CCG Parsing - cs.utexas.edu

HandlingInvariances

‣ Parsing-basedapproacheshandlethesethesameway

‣ Possibledivergences:features,differentweightsinthelexicon

‣ Keyidea:don’tchangethemodel,changethedata

“whatstatesborderTexas” “whatstatesborderOhio”

‣ Canwegetseq2seqsemanMcparserstohandlethesethesameway?

‣ “DataaugmentaMon”:encodeinvariancesbyautomaMcallygeneraMngnewtrainingexamples

Page 13: CCG Parsing - cs.utexas.edu

DataAugmentaMon

‣ AbstractoutenMMes:nowwecan“remix”examplesandencodeinvariancetoenMtyID.Morecomplicatedremixestoo

‣ Letsussynthesizea“whatstatesborderohio?”example

JiaandLiang(2016)

Page 14: CCG Parsing - cs.utexas.edu

SemanMcParsingasTranslaMon

JiaandLiang(2016)

‣ Prolog

‣ Lambdacalculus

‣ OtherDSLs

‣ Handleallofthesewithuniformmachinery!

Page 15: CCG Parsing - cs.utexas.edu

SemanMcParsingasTranslaMon

JiaandLiang(2016)

‣ ThreeformsofdataaugmentaMonallhelp

‣ ResultsonthesetasksaresMllnotasstrongashand-tunedsystemsfrom10yearsago,butthesamesimplemodelcandowellatallproblems

Page 16: CCG Parsing - cs.utexas.edu

ApplicaMons‣ GeoQuery(ZelleandMooney,1996):answeringquesMonsaboutstates(~80%accuracy)

‣ Jobs:answeringquesMonsaboutjobposMngs(~80%accuracy)

‣ ATIS:flightsearch

‣ Candowellonallofthesetasksifyouhandcraqsystemsanduseplentyoftrainingdata:thesedomainsaren’tthatrich

Page 17: CCG Parsing - cs.utexas.edu

RegexPredicMon‣ CanuseforothersemanMcparsing-liketasks

‣ Predictregexfromtext

‣ Problem:requiresalotofdata:10,000examplesneededtoget~60%accuracyonpre-ysimpleregexes

Locascioetal.(2016)

Page 18: CCG Parsing - cs.utexas.edu

SQLGeneraMon‣ ConvertnaturallanguagedescripMonintoaSQLqueryagainstsomeDB

‣ Howtoensurethatwell-formedSQLisgenerated?

Zhongetal.(2017)

‣ Threeseq2seqmodels

‣ Howtocapturecolumnnames+constants?‣ Pointermechanisms