Learning Structural Edits via Incremental Tree Transformations

Learning Structural Edits via Incremental Tree Transformations
复制标题

DOI:
--
复制
发表时间:
2021-01
期刊:
ArXiv
影响因子:
--
通讯作者:
Ziyu Yao;Frank F. Xu;Pengcheng Yin;Huan Sun;Graham Neubig
Ziyu Yao;Frank F. Xu;Pengcheng Yin;Huan Sun;Graham Neubig
中科院分区:
其他
文献类型:
--
作者:
Ziyu Yao;Frank F. Xu;Pengcheng Yin;Huan Sun;Graham Neubig

文献摘要

被引文献

相似文献

尽管大多数神经生成模型都会在单个通行证中产生输出,但人类的创造过程通常是迭代的建筑和改进之一。最近的工作提出了编辑过程的模型,但是这些模型主要集中于编辑顺序数据和/或仅对单个编辑通行证进行建模。在本文中,我们提出了一个通用模型,用于逐步编辑结构化数据(即''结构编辑')。特别是,我们专注于树结构化的数据,以计算机程序的抽象语法为例,作为我们的规范示例。我们的编辑器将学习到迭代生成树的编辑(例如,删除或添加子树)并将其应用于部分编辑的数据,从而可以将整个编辑过程作为连续的增量树转换配方。为了展示直接建模树编辑的独特好处,我们进一步提出了一个新颖的编辑编码器,用于学习编辑,以及一种允许编辑器更强大的模仿学习方法。我们在两个源代码编辑数据集上评估了建议的编辑器,结果表明,在提出的编辑编码器中,我们的编辑器显着提高了与以前直接在一个通行证中生成编辑程序的方法相比的准确性。最后,我们证明培训编辑模仿专家并动态纠正其错误可以进一步提高其性能。
While most neural generative models generate outputs in a single pass, the human creative process is usually one of iterative building and refinement. Recent work has proposed models of editing processes, but these mostly focus on editing sequential data and/or only model a single editing pass. In this paper, we present a generic model for incremental editing of structured data (i.e. ''structural edits''). Particularly, we focus on tree-structured data, taking abstract syntax trees of computer programs as our canonical example. Our editor learns to iteratively generate tree edits (e.g. deleting or adding a subtree) and applies them to the partially edited data, thereby the entire editing process can be formulated as consecutive, incremental tree transformations. To show the unique benefits of modeling tree edits directly, we further propose a novel edit encoder for learning to represent edits, as well as an imitation learning method that allows the editor to be more robust. We evaluate our proposed editor on two source code edit datasets, where results show that, with the proposed edit encoder, our editor significantly improves accuracy over previous approaches that generate the edited program directly in one pass. Finally, we demonstrate that training our editor to imitate experts and correct its mistakes dynamically can further improve its performance.