Abstract Syntax Networks for Code Generation and Semantic Parsing
Maxim Rabinovich, Mitchell E. Stern, Dan Klein · 2017
Tasks 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-ofthe-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.* 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())) ])