Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs §...

70
Parsing VI Taylor Berg-Kirkpatrick – CMU Slides: Dan Klein – UC Berkeley Algorithms for NLP

Transcript of Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs §...

Page 1: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

ParsingVITaylorBerg-Kirkpatrick– CMU

Slides:DanKlein– UCBerkeley

AlgorithmsforNLP

Page 2: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

P1Shout-outs§ Saksham Singhal -- implementedpseudo-tries.Usedimplicitcaching(storedthemost

frequentn-gramsontopofhashtables)andexplicitcaching.§ Soumya Wadhwa,Tejas Nama-- approximatedbyignoringalltrigramswithcount1.

ThatdroppedBLEUscorebylessthan0.1onlybutfreedhalfthememory!§ CraigStewart-- rehashannealingidea.Maderesizingfactorandloadfactorchange

witheveryrehashtoconvergeto0.9loadfactortominimizewastedspace.§ GriffinThomasAdams-- Builta"waterfall"tieredcachesystem§ DeanAlderucci -- Builtaclasstopackdatatypesofarbitrarysizeintoanarrayoflongs.

Builtacustomimplementationoflogthatranfaster.§ RobinJonathanAlgayres – Contexttrie!§ Raghuram Mandyam Annasamy -- Useddatabaseinspiredsharding techniqueonkeys§ Xianyang Chen-- Compressedhashtableanddidsmarterbinarysearchbyindexing

chunkswiththesamelastword§ Aldrian Obaja -- ImplementedNestedMap,achieving792MBofmemory.§ Otherthingsmanypeopledid -- LRUcaching,packingmultiplevalues(countsand

contextfertilites)intoasinglelong,binarysearchinsteadofhashtable.

Page 3: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

GrammarProjections

NP→DT@NP

Coarse Grammar Fine Grammar

DT

NP

JJ

@NP

@NPNN

@NP

NN

DT^NP

NP^VP

JJ^NP

@NP^VP[DT]

@NP^VP[…,NN]NN^NP

@NP^VP[…,JJ]

NN^NP

NP^VP→DT^NP@NP^VP[DT]

Note:X-BarGrammarsareprojectionswithruleslikeXP→Y@XorXP→@XYor@X→X

Page 4: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

EfficientParsingforStructuralAnnotation

Page 5: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Coarse-to-FinePruning

… QP NP VP …coarse:

fine:

E.g.considerthespan5to12:

< thresholdP (X|i, j, S)

Page 6: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Coarse-to-FinePruning

ForeachcoarsechartitemX[i,j],computeposteriorprobability:

… QP NP VP …coarse:

fine:

E.g.considerthespan5to12:

< threshold↵(X, i, j) · �(X, i, j)

↵(root, 0, n)

Page 7: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

ComputingMarginals↵(X, i, j) =

X

X!Y Z

X

k2(i,j)

P (X ! Y Z)↵(Y, i, k)↵(Z, k, j)

Page 8: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

ComputingMarginals�(X, i, j) =

X

Y!ZX

X

k2[0,i)

P (Y ! ZX)�(Y, k, j)↵(B, k, i)

+X

Y!XZ

X

k2(j,n]

P (Y ! XZ)�(Y, i, k)↵(Z, j, k)

Page 9: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

EfficientParsingforLexicalGrammars

Page 10: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

LexicalizedTrees

§ Add“headwords”toeachphrasalnode§ Syntacticvs.semantic

heads§ Headshipnotin(most)

treebanks§ Usuallyuseheadrules,

e.g.:§ NP:

§ TakeleftmostNP§ TakerightmostN*§ TakerightmostJJ§ Takerightchild

§ VP:§ TakeleftmostVB*§ TakeleftmostVP§ Takeleftchild

Page 11: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

LexicalizedPCFGs?§ Problem:wenowhavetoestimateprobabilitieslike

§ Nevergoingtogettheseatomicallyoffofatreebank

§ Solution:breakupderivationintosmallersteps

Page 12: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

LexicalDerivationSteps§ Aderivationofalocaltree[Collins99]

Choose a head tag and word

Choose a complement bag

Generate children (incl. adjuncts)

Recursively derive children

Page 13: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

LexicalizedCKY

bestScore(X,i,j,h)if (j = i+1)return tagScore(X,s[i])

elsereturn max max score(X[h]->Y[h] Z[h’]) *

bestScore(Y,i,k,h) *bestScore(Z,k,j,h’)

max score(X[h]->Y[h’] Z[h]) *bestScore(Y,i,k,h’) *bestScore(Z,k,j,h)

Y[h] Z[h’]

X[h]

i h k h’ j

k,h’,X->YZ

(VP->VBD •)[saw] NP[her]

(VP->VBD...NP •)[saw]

k,h’,X->YZ

Page 14: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

QuarticParsing§ Turnsout,youcando(alittle)better[Eisner99]

§ GivesanO(n4)algorithm§ Stillprohibitiveinpracticeifnotpruned

Y[h] Z[h’]

X[h]

i h k h’ j

Y[h] Z

X[h]

i h k j

Page 15: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

PruningwithBeams§ TheCollinsparserpruneswithper-

cellbeams[Collins99]§ Essentially,runtheO(n5) CKY§ Rememberonlyafewhypothesesfor

eachspan<i,j>.§ IfwekeepKhypothesesateachspan,

thenwedoatmostO(nK2)workperspan(why?)

§ Keepsthingsmoreorlesscubic(andinpracticeismorelikelinear!)

§ Also:certainspansareforbiddenentirelyonthebasisofpunctuation(crucialforspeed)

Y[h] Z[h’]

X[h]

i h k h’ j

Page 16: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

PruningwithaPCFG

§ TheCharniak parserprunesusingatwo-pass,coarse-to-fineapproach[Charniak 97+]§ First,parsewiththebasegrammar§ ForeachX:[i,j]calculateP(X|i,j,s)

§ Thisisn’ttrivial,andtherearecleverspeedups§ Second,dothefullO(n5) CKY

§ SkipanyX:[i,j]whichhadlow(say,<0.0001)posterior§ Avoidsalmostallworkinthesecondphase!

§ Charniak etal06:canusemorepasses§ Petrov etal07:canusemanymorepasses

Page 17: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Results

§ Someresults§ Collins99– 88.6F1(generativelexical)§ Charniak andJohnson05– 89.7/91.3F1(generativelexical/reranked)

§ Petrov etal06– 90.7F1(generativeunlexical)§ McClosky etal06– 92.1F1(gen+rerank +self-train)

Page 18: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

LatentVariablePCFGs

Page 19: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

§ Annotationrefinesbasetreebank symbolstoimprovestatisticalfitofthegrammar§ Parentannotation[Johnson’98]

TheGameofDesigningaGrammar

Page 20: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

§ Annotationrefinesbasetreebank symbolstoimprovestatisticalfitofthegrammar§ Parentannotation[Johnson’98]§ Headlexicalization [Collins’99,Charniak ’00]

TheGameofDesigningaGrammar

Page 21: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

§ Annotationrefinesbasetreebank symbolstoimprovestatisticalfitofthegrammar§ Parentannotation[Johnson’98]§ Headlexicalization [Collins’99,Charniak ’00]§ Automaticclustering?

TheGameofDesigningaGrammar

Page 22: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

LatentVariableGrammars

Parse Tree Sentence Parameters

...

Derivations

Page 23: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Backward

LearningLatentAnnotations

EMalgorithm:

X1

X2 X7X4

X5 X6X3

He was right

.

§ Brackets are known§ Base categories are known§ Only induce subcategories

JustlikeForward-BackwardforHMMs.Forward

Page 24: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

RefinementoftheDTtag

DT

DT-1 DT-2 DT-3 DT-4

Page 25: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Hierarchicalrefinement

Page 26: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

HierarchicalEstimationResults

74

76

78

80

82

84

86

88

90

100 300 500 700 900 1100 1300 1500 1700Total Number of grammar symbols

Par

sing

acc

urac

y (F

1)

Model F1Flat Training 87.3Hierarchical Training 88.4

Page 27: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Refinementofthe,tag§ Splittingallcategoriesequallyiswasteful:

Page 28: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Adaptive Splitting

§ Want to split complex categories more§ Idea: split everything, roll back splits which

were least useful

Page 29: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

AdaptiveSplittingResults

Model F1Previous 88.4With 50% Merging 89.5

Page 30: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

0

5

10

15

20

25

30

35

40

NP

VP PP

ADVP S

ADJP

SBAR Q

P

WH

NP

PRN

NX

SIN

V

PRT

WH

PP SQ

CO

NJP

FRAG

NAC UC

P

WH

ADVP INTJ

SBAR

Q

RR

C

WH

ADJP X

RO

OT

LST

NumberofPhrasalSubcategories

Page 31: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

NumberofLexicalSubcategories

0

10

20

30

40

50

60

70

NNP JJ

NNS NN VBN RB

VBG VB VBD CD IN

VBZ

VBP DT

NNPS CC JJ

RJJ

S :PR

PPR

P$ MD

RBR

WP

POS

PDT

WRB

-LRB

- .EX

WP$

WDT

-RRB

- ''FW RB

S TO$

UH, ``

SYM RP LS #

Page 32: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

LearnedSplits

§ Proper Nouns (NNP):

§ Personal pronouns (PRP):

NNP-14 Oct. Nov. Sept.NNP-12 John Robert JamesNNP-2 J. E. L.NNP-1 Bush Noriega Peters

NNP-15 New San WallNNP-3 York Francisco Street

PRP-0 It He IPRP-1 it he theyPRP-2 it them him

Page 33: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

§ Relativeadverbs(RBR):

§ CardinalNumbers(CD):

RBR-0 further lower higherRBR-1 more less MoreRBR-2 earlier Earlier later

CD-7 one two ThreeCD-4 1989 1990 1988CD-11 million billion trillionCD-0 1 50 100CD-3 1 30 31CD-9 78 58 34

LearnedSplits

Page 34: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

FinalResults(Accuracy)

≤ 40 wordsF1

all F1

ENG

Charniak&Johnson ‘05 (generative) 90.1 89.6

Split / Merge 90.6 90.1

GER

Dubey ‘05 76.3 -

Split / Merge 80.8 80.1

CH

N

Chiang et al. ‘02 80.0 76.6

Split / Merge 86.3 83.4

Still higher numbers from reranking / self-training methods

Page 35: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

EfficientParsingforHierarchicalGrammars

Page 36: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Coarse-to-FineInference§ Example:PPattachment

?????????

Page 37: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

HierarchicalPruning

… QP NP VP …coarse:

split in two: … QP1 QP2 NP1 NP2 VP1 VP2 …

… QP1 QP1 QP3 QP4 NP1 NP2 NP3 NP4 VP1 VP2 VP3 VP4 …split in four:

split in eight: … … … … … … … … … … … … … … … … …

Page 38: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

BracketPosteriors

Page 39: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

1621min111min35min

15min(nosearcherror)

Page 40: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

OtherSyntacticModels

Page 41: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

DependencyParsing

§ Lexicalizedparserscanbeseenasproducingdependencytrees

§ Eachlocalbinarytreecorrespondstoanattachmentinthedependencygraph

questioned

lawyer witness

the the

Page 42: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

DependencyParsing

§ Puredependencyparsingisonlycubic[Eisner99]

§ Someworkonnon-projective dependencies§ Commonin,e.g.Czechparsing§ CandowithMSTalgorithms[McDonaldandPereira05]

Y[h] Z[h’]

X[h]

i h k h’ j

h h’

h

h k h’

Page 43: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Shift-ReduceParsers

§ Anotherwaytoderiveatree:

§ Parsing§ Nousefuldynamicprogrammingsearch§ Canstillusebeamsearch[Ratnaparkhi97]

Page 44: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

TreeInsertionGrammars

§ Rewritelarge(possiblylexicalized)subtrees inasinglestep

§ Formally,atree-insertiongrammar§ Derivationalambiguitywhethersubtrees weregeneratedatomically

orcompositionally§ MostprobableparseisNP-complete

Page 45: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

TIG:Insertion

Page 46: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Tree-adjoininggrammars

§ Startwithlocaltrees§ Caninsertstructure

withadjunctionoperators

§ Mildlycontext-sensitive

§ Modelslong-distancedependenciesnaturally

§ …aswellasotherweirdstuffthatCFGsdon’tcapturewell(e.g.cross-serialdependencies)

Page 47: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

TAG:LongDistance

Page 48: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

CCGParsing

§ CombinatoryCategorialGrammar§ Fully(mono-)

lexicalizedgrammar§ Categoriesencode

argumentsequences§ Verycloselyrelated

tothelambdacalculus(morelater)

§ Canhavespuriousambiguities(why?)

Page 49: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

EmptyElements

Page 50: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

EmptyElements

Page 51: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

EmptyElements§ InthePTB,threekindsofemptyelements:

§ Nullitems(usuallycomplementizers)§ Dislocation(WH-traces,topicalization,relativeclauseandheavyNPextraposition)

§ Control(raising,passives,control,sharedargumentation)

§ Needtoreconstructthese(andresolveanyindexation)

Page 52: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Example:English

Page 53: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Example:German

Page 54: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

TypesofEmpties

Page 55: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

APattern-MatchingApproach§ [Johnson02]

Page 56: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Pattern-MatchingDetails§ Somethingliketransformation-basedlearning§ Extractpatterns

§ Details:transitiveverbmarking,auxiliaries§ Details:legalsubtrees

§ Rankpatterns§ Pruningranking:bycorrect/matchrate§ Applicationpriority:bydepth

§ Pre-ordertraversal§ Greedymatch

Page 57: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

TopPatternsExtracted

Page 58: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Results

Page 59: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

SemanticRoles

Page 60: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

SemanticRoleLabeling(SRL)

§ Characterizeclausesasrelations withroles:

§ SaysmorethanwhichNPisthesubject(butnotmuchmore):§ Relationslikesubject aresyntactic,relationslikeagent ormessage are

semantic§ Typicalpipeline:

§ Parse,thenlabelroles§ Almostallerrorslockedinbyparser§ Really,SRLisquitealoteasierthanparsing

Page 61: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

SRLExample

Page 62: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

PropBank/FrameNet

§ FrameNet:rolessharedbetweenverbs§ PropBank:eachverbhasitsownroles§ PropBank moreused,becauseit’slayeredoverthetreebank (andsohas

greatercoverage,plusparses)§ Note:somelinguistictheoriespostulatefewerrolesthanFrameNet (e.g.

5-20total:agent,patient,instrument,etc.)

Page 63: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

PropBankExample

Page 64: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

PropBankExample

Page 65: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

PropBankExample

Page 66: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

SharedArguments

Page 67: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

PathFeatures

Page 68: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

Results

§ Features:§ Pathfromtargettofiller§ Filler’ssyntactictype,headword,case§ Target’sidentity§ Sentencevoice,etc.§ Lotsofothersecond-orderfeatures

§ Goldvsparsedsourcetrees

§ SRLisfairlyeasyongoldtrees

§ Harderonautomaticparses

Page 69: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

ParseReranking

§ Assumethenumberofparsesisverysmall§ WecanrepresenteachparseTasafeaturevectorj(T)

§ Typically,alllocalrulesarefeatures§ Alsonon-localfeatures,likehowright-branchingtheoveralltreeis§ [Charniak andJohnson05]givesarichsetoffeatures

Page 70: Algorithms for NLPtbergkir/11711fa17/FA17 11-711 lecture 15... · 2017-10-19 · P1 Shout-outs § SakshamSinghal--implemented pseudo-tries.Used implicit caching (stored the most frequent

K-BestParsing [Huang and Chiang 05, Pauls, Klein, Quirk 10]