通过间接监督学习宽松的解析和打字
Learning Lenient Parsing & Typing via Indirect Supervision
摘要:
专业编码人员和教师经常处理不完美的(零碎的,不完整的,格式不正确的)代码。这样的片段在STACKOVERFLOW中很常见;学生也经常产生格式不正确的代码,教师、助教(或学生自己)必须找到修复方法。在任何一种情况下,如果这样的代码能够以某种方式被解析和类型化,开发人员的体验都可以得到极大的改善;这使得这样的代码更适合在IDE中使用,并允许早期检测和修复潜在的错误。我们引入了一个宽松的解析器,它可以解析和类型的片段,即使是简单的错误。训练机器学习者宽松地解析和键入不完美的代码需要一个大型的训练集,包括许多对不完美的代码及其修复;这样的训练集受到人类努力和管理的限制。在本文中,我们提出了一种新的,间接监督的方法,训练宽松的解析器,而无需访问这样的人工策划的训练数据。我们利用Github上可用的大量正确代码,以及基于Transformer的NN架构的大规模高效学习能力。使用GitHub数据,我们首先创建一个包含代码片段和相应的树片段以及类型注释的大型数据集;然后通过模拟STACKOVERFLOW和学生数据中发现的损坏的种子错误来随机损坏输入片段。使用这些数据,我们训练高容量的Transformer模型,以克服碎片化和损坏。有了这种新的方法,我们可以实现合理的性能解析和打字STACKOVERFLOW片段,我们还证明,我们的方法表现良好,较短的学生错误程序,并达到最佳的性能较长的程序,有超过400个令牌。我们还表明,通过混合Deepfix和我们的工具,我们可以实现77%的准确率,这优于所有以前报道的学生纠错工具。
英文摘要:
Both professional coders and teachers frequently deal with imperfect (fragmentary, incomplete, ill-formed) code. Such fragments are common in STACKOVERFLOW; students also frequently produce ill-formed code, for which instructors, TAs (or students themselves) must find repairs. In either case, the developer experience could be greatly improved if such code could somehow be parsed & typed; this makes such code more amenable to use within IDEs and allows early detection and repair of potential errors. We introduce a lenient parser, which can parse & type fragments, even ones with simple errors. Training a machine learner to leniently parse and type imperfect code requires a large training set including many pairs of imperfect code and its repair; such training sets are limited by human effort and curation. In this paper, we present a novel, indirectly supervised, approach to train a lenient parser, without access to such human-curated training data. We leverage the huge corpus of mostly correct code available on Github, and the massive, efficient learning capacity of Transformer-based NN architectures. Using GitHub data, we first create a large dataset of fragments of code and corresponding tree fragments and type annotations; we then randomly corrupt the input fragments by seeding errors that mimic corruptions found in STACKOVERFLOW and student data. Using this data, we train high-capacity transformer models to overcome both fragmentation and corruption. With this novel approach, we can achieve reasonable performance on parsing & typing STACKOVERFLOW fragments; we also demonstrate that our approach performs well on shorter student error program and achieves best-in-class performance on longer programs that have more than 400 tokens. We also show that by blending Deepfix and our tool, we could achieve 77% accuracy, which outperforms all previously reported student error correction tools.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。