Weakly Supervised Semantic Parsing with Abstract Examples Omer Goldman , Veronica Latcinnik, Udi Naveh, Amir Globerson, Jonathan Berant Tel Aviv University ACL, July 2018
Semantic Parsing π h ππ’ ππ‘ π’ h π πππππ’ππ ππ π’ h π πππ πππ‘π’ ππ π‘π’ππ’π ? model CapitalOf.argmax(Type.State β© LocatedIn.US,Population) KB: execution Sacramento οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 1
Training with Full Supervision οΏ½ Training examples: E X P E N S I V E x: y: CapitalOf.argmax(Type.State β© LocatedIn.US,Population) $ β¬ Β₯ οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 2
Training with Weak Supervision οΏ½ Training examples: x: y: Sacramento οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 3
Problems with Weak Supervision οΏ½ Exponential search space 3+3*15 1 decoding 5+30 2-2 4+60/3 οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 4
Problems with Weak Supervision οΏ½ Spurious programs (Pasupat and Liang, 2016; Guu et al., 2017) 20-16 32/4 decoding 4*2-4 50-1 3+85 Correct program : 2*2 οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 4
CNLVR (Suhr et al., 2017) οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 6
Semantic Parsing π h ππ π ππ‘ π πππ£π π‘ππ£ππ π model exist(filter(ALL_ITEMS, Ξ» x.IsBlue(x) β© IsSquare(x))) KB: execution Binary! True 50% spurious οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 7
Insight π h ππ π ππ‘ ππ¦πππ’ππ§ πππ πππππ πππ πππ πππ’ π’ππ£π h πππ π’ h π ππππ οΏ½ Equal( 1 ,(filter(ALL_ITEMS, Ξ» x.IsBlack(x) β© IsCircle(x) β© Β¬IsTouchingWall(x))) οΏ½ Equal( 1 ,(filter(ALL_ITEMS, Ξ» x.IsBlack(x) β© IsCircle(x) β© Β¬IsTouchingWall(x))) οΏ½ GreaterEqual( 3 ,(filter(ALL_ITEMS, Ξ» x.IsBlue(x) β© IsTriangle(x) β© Β¬IsTouchingWall(x))) οΏ½ GreaterEqual( 1 ,(filter(ALL_ITEMS, Ξ» x.IsBlue(x) β© IsTriangle(x) β© Β¬IsTouchingWall(x))) οΏ½ LessEqual( 3 ,(filter(ALL_ITEMS, Ξ» x.IsYellow(x) β© IsRectangle(x) β© Β¬IsTouchingWall(x))) οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 8
Contributions π h ππ π ππ‘ π π§πππππ₯ πππ πππ exist(filter(ALL_ITEMS, Ξ» x.IsYellow(x) β IsCircle(x))) π h ππ π ππ‘ π π· β π·ππππ π· β ππΌπ΅ππΉ exist(filter(ALL_ITEMS, Ξ» x.IsC-COLOR(x) β IsC-SHAPE(x))) Data augmentation Abstract cache helps search tackles spuriousness CNLVR improvement: 67.8 οΏ½ 82.5 οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 9
Semantic Parsing 11
Logical Program x: z: exist(filter(ALL_BOXES, Ξ» x.ge(3,count(filter(x, Ξ» y.IsBlue(y)))))) Variable Variable Function Set(Item) Item Set() οΏ½ Bool Constant Function Set(Set(Item)) Function Set() οΏ½ Int Set() BoolFunc() οΏ½ Set() οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 12
Model Exist(Filter(ALL_ITEMS, Ξ» x.And(IsYellow(x), IsTriangle(x)))) βThere is a yellow triangleβ Beam Exist(Filter(ALL_ITEMS, Ξ» x.IsYellow(x))) Encoder β search GraeterEqual(1,count(Filter(ALL_ITEMS, Ξ» x.And(IsYellow(x),IsTriangle(x))))) Decoder οΏ½ Training maximizes log-likelihood of correct programs οΏ½ + discriminative re-ranker οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 13
Abstract Examples 14
Abstraction π h ππ π ππ‘ π π§πππππ₯ πππ πππ π h ππ π ππ‘ π πππ£π π‘ππ£ππ π exist(filter(ALL_ITEMS, Ξ» x.IsYellow(x) β IsCircle(x))) exist(filter(ALL_ITEMS, Ξ» x.IsBlue(x) β IsRectangle(x))) π h ππ π ππ‘ π π· β π·ππππ π· β ππΌπ΅ππΉ exist(filter(ALL_ITEMS, Ξ» x.IsC-COLOR(x) β IsC-SHAPE(x))) οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 15
Analysis 3163 CNLVR sentences There isβ¦β¦β¦β¦ β’ One of theβ¦β¦. β’ There areβ¦β¦.. β’ ~1300 abstract sentences Exactly twoβ¦.. β’ There isβ¦β¦β¦β¦ β’ In two ofβ¦β¦β¦. β’ There isβ¦β¦β¦β¦β¦ β’ There isβ¦β¦β¦.. β’ There areβ¦β¦β¦β¦ β’ There areβ¦β¦.. β’ C-Num ofβ¦β¦.β¦β¦ β’ There isβ¦β¦β¦.. β’ There is........... β’ abstraction One squareβ¦.. β’ One towerβ¦β¦β¦.. β’ There isβ¦β¦β¦.. β’ There areβ¦β¦β¦β¦. β’ One of theβ¦β¦. β’ C-Num C-Shapeβ¦ β’ There areβ¦β¦.. β’ There isβ¦β¦β¦β¦β¦. β’ There isβ¦β¦.... β’ C-Num towersβ¦.. β’ Two towersβ¦.. β’ Another lastβ¦β¦β¦ β’ There areβ¦β¦.. β’ There isβ¦β¦β¦.. β’ One circleβ¦β¦. β’ There isβ¦β¦β¦.. β’ Last oneβ¦β¦β¦.. β’ οΏ½ ~150 abstract sentences cover 50% of CNLVR. οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 16
Abstraction οΏ½ Data augmentation οΏ½ Abstract cache οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 17
Data Augmentation π h ππ π ππ‘ π π§πππππ₯ πππ πππ π h ππ π ππ‘ π πππ£π π πππ’πππππ exist(filter(ALL_ITEMS, Ξ» x.IsBlue(x) β IsSquare(x))) π h ππ π ππ‘ π π§πππππ₯ π’π ππππππ exist(filter(ALL_ITEMS, Ξ» x.IsYellow(x) β IsTriangle(x))) π h ππ π ππ‘ π πππππ πππ πππ exist(filter(ALL_ITEMS, Ξ» x.IsBlack(x) β IsCircle(x))) π h ππ π ππ‘ π π· β π·ππππ π· β ππΌπ΅ππΉ exist(filter(ALL_ITEMS, Ξ» x.IsC-COLOR(x) β IsC-SHAPE(x))) οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 18
Training Procedure ~100 Abstract examples (abs. sent., abs. prog.) Generation ~6000 Instantiated examples Supervised model Supervised (sentence, program) training initialization 3163 CNLVR training examples Weakly-supervised model Weakly (sentence, answer) supervised training οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 19
Abstract Cache οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 20
Reward Tying 50% spurious οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 21
Reward Tying : False : False 6.25% spurious οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 22
Results 23
Models Baselines (Suhr et al., 2017) οΏ½ Majority label ( True ) οΏ½ Max Entropy classifier on extracted features οΏ½ Supervised trained model (+Re-ranker) οΏ½ Weakly supervised trained model (+Re-ranker) οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 24
Results - Public test set Test-P Accuracy Test-P Consistency 84 81.7 76.6 67.7 66.9 65 60.1 56.2 51.8 38.3 Majority MaxEnt Sup. Sup.+Rerank W.Sup. W.Sup.+Rerank οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 25
Ablations No data ugmentation Abstract weakly pervised parser οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 26
Data augmentation addition Ablations 85.7 77.2 71.4 67.4 58.2 56.1 Dev Accuracy Dev Consistency 41.2 7.1 -Abstraction -Data augment. -Beam cache W.Sup.+Rerank Cache addition οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 27
Conclusions 28
Conclusions Closed domains Better Abstraction training Weak supervision Facilitate information sharing οΏ½ Similar ideas in: Dong and Lapata (2018) and Zhang et al. (2017) οΏ½ Automation would be useful οΏ½ Introduction οΏ½ Semantic parser οΏ½ Abstract examples οΏ½ Results οΏ½ Conclusions 29
Thank you https://github.com/udiNaveh/nlvr_tau_nlp_final_proj
Recommend
More recommend