Abstract Syntax Networks for Code Generation and Semantic Parsing
40014Authors
nan
Abstract
AbstractTasks like code generation and semantic parsing require mapping unstructured (or partially structured) inputs to well-formed, executable outputs. We introduce abstract syntax networks, a modeling framework for these problems. The outputs are represented as abstract syntax trees (ASTs) and constructed by a decoder with a dynamically-determined modular structure paralleling the structure of the output tree. On the benchmark Hearthstone dataset for code generation, our model obtains 79.2 BLEU and 22.7% exact match accuracy, compared to previous state-of-the-art values of 67.1 and 6.1%. Furthermore, we perform competitively on the Atis, Jobs, and Geo semantic parsing datasets with no task-specific engineering.
Keywords
Full Content
Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pages 1139–1149 Vancouver, Canada, July 30 - August 4, 2017. c⃝2017 Association for Computational Linguistics https://doi.org/10.18653/v1/P17-1105 Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pages 1139–1149 Vancouver, Canada, July 30 - August 4, 2017. c⃝2017 Association for Computational Linguistics https://doi.org/10.18653/v1/P17-1105 Abstract Syntax Networks for Code Generation and Semantic Parsing Maxim Rabinovich∗ Mitchell Stern∗ Dan Klein Computer Science Division University of California, Berkeley {rabinovich,mitchell,klein}@cs.berkeley.edu Abstract Tasks like code generation and semantic parsing require mapping unstructured (or partially structured) inputs to well-formed, executable outputs. We introduce ab- stract syntax networks, a modeling frame- work for these problems. The outputs are represented as abstract syntax trees (ASTs) and constructed by a decoder with a dynamically-determined modular struc- ture paralleling the structure of the output tree. On the benchmark HEARTHSTONE dataset for code generation, our model ob- tains 79.2 BLEU and 22.7% exact match accuracy, compared to previous state-of- the-art values of 67.1 and 6.1%. Further- more, we perform competitively on the ATIS, JOBS, and GEO semantic parsing datasets with no task-specific engineering. 1 Introduction Tasks like semantic parsing and code generation are challenging in part because they are struc- tured (the output must be well-formed) but not synchronous (the output structure diverges from the input structure). Sequence-to-sequence models have proven ef- fective for both tasks (Dong and Lapata, 2016; Ling et al., 2016), using encoder-decoder frame- works to exploit the sequential structure on both the input and output side. Yet these approaches do not account for much richer structural con- straints on outputs—including well-formedness, well-typedness, and executability. The well- formedness case is of particular interest, since it can readily be enforced by representing outputs as abstract syntax trees (ASTs) (Aho et al., 2006), an approach that can be seen as a much lighter weight ∗Equal contribution. name: [ ’D’, ’i’, ’r’, ’e’, ’ ’, ’W’, ’o’, ’l’, ’f’, ’ ’, ’A’, ’l’, ’p’, ’h’, ’a’] cost: [’2’] type: [’Minion’] rarity: [’Common’] race: [’Beast’] class: [’Neutral’] description: [ ’Adjacent’, ’minions’, ’have’, ’+’, ’1’, ’Attack’, ’.’] health: [’2’] attack: [’2’] durability: [’-1’] class DireWolfAlpha(MinionCard): def __init__(self): super().__init__( "Dire Wolf Alpha", 2, CHARACTER_CLASS.ALL, CARD_RARITY.COMMON, minion_type=MINION_TYPE.BEAST) def create_minion(self, player): return Minion(2, 2, auras=[ Aura(ChangeAttack(1), MinionSelector(Adjacent())) ]) Figure 1: Example code for the “Dire Wolf Alpha” Hearthstone card. show me the fare from ci0 to ci1 lambda $0 e ( exists $1 ( and ( from $1 ci0 ) ( to $1 ci1 ) ( = ( fare $1 ) $0 ) ) ) Figure 2: Example of a query and its logical form from the ATIS dataset. The ci0 and ci1 tokens are entity abstractions introduced in preprocess- ing (Dong and Lapata, 2016). version of CCG-based semantic parsing (Zettle- moyer and Collins, 2005). In this work, we introduce abstract syntax networks (ASNs), an extension of the standard encoder-decoder framework utilizing a modular decoder whose submodels are composed to na- tively generate ASTs in a top-down manner. The decoding process for any …
Content truncated to 500 words
Labeled Text
AbstractTasks like code generation and semantic parsing require mapping unstructured (or partially structured) inputs to well-formed, executable outputs. We introduce abstract syntax networks, a modeling framework for these problems. The outputs are represented as abstract syntax trees (ASTs) and constructed by a decoder with a dynamically-determined modular structure paralleling the structure of the output tree. On the benchmark Hearthstone dataset for code generation, our model obtains 79.2 BLEU and 22.7% exact match accuracy, compared to previous state-of-the-art values of 67.1 and 6.1%. Furthermore, we perform competitively on the Atis, Jobs, and Geo semantic parsing datasets with no task-specific engineering.
Publication Details
- Paper ID:
- 40014
- Year:
- 2017
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan