一句话:结合神经网络预测相关纠错规则与符号纠错解析器,自动修复解析错误。
论文研究自动修复程序解析错误的问题。符号纠错解析器理论上可合成修复,但实践中会被大量与当前程序无关的纠错规则淹没;神经方法虽常受限于可能的序列级编辑空间,却能精确定位与特定程序相关的纠错规则。Seq2Parse 将二者互补优势结合:先用神经方法训练序列分类器,为解析失败的程序预测一小组相关纠错规则,再由符号纠错解析算法快速生成有用修复。作者在包含 110 万个 Python 程序的数据集上训练与评估,表明该方法准确且高效:94% 的测试可在 2.1 秒内解析,三分之一的案例能生成与用户修复完全一致的结果;人类评估也显示,Seq2Parse 生成的错误位置与修复在统计显著意义上接近人类生成质量。
We present Seq2Parse, a language-agnostic neurosymbolic approach to automatically repairing parse errors. Seq2Parse is based on the insight that Symbolic Error Correcting (EC) Parsers can, in principle, synthesize repairs, but, in practice, are overwhelmed by the many error-correction rules that are not relevant to the particular program that requires repair. In contrast, Neural approaches are fooled by the large space of possible sequence level edits, but can precisely pinpoint the set of EC-rules that are relevant to a particular program. We show how to combine their complementary strengths by using neural methods to train a sequence classifier that predicts the small set of relevant EC-rules for an ill-parsed program, after which, the symbolic EC-parsing algorithm can make short work of generating useful repairs. We train and evaluate our method on a dataset of 1,100,000 Python programs, and show that Seq2Parse is accurate and efficient : it can parse 94% of our tests within 2.1 seconds, while generating the exact user fix in 1 out 3 of the cases; and useful : humans perceive both Seq2Parse-generated error locations and repairs to be almost as good as human-generated ones in a statistically-significant manner.
@article{paperbot1417,
title = {Seq2Parse: neurosymbolic parse error repair},
author = {Georgios Sakkas and Madeline Endres and Philip J. Guo and Westley Weimer and Ranjit Jhala},
journal = {Proceedings of the ACM on Programming Languages},
volume = {6},
number = {OOPSLA2},
year = {2022},
doi = {10.1145/3563330}
}