Incorporating External Knowledge through Pre-training for Natural Language to Code Generation

Incorporating External Knowledge through Pre-training for Natural Language to Code Generation
复制标题

DOI:
10.18653/v1/2020.acl-main.538
复制
发表时间:
2020-04
期刊:
ArXiv
影响因子:
--
通讯作者:
Frank F. Xu;Zhengbao Jiang;Pengcheng Yin;Bogdan Vasilescu;Graham Neubig
Frank F. Xu;Zhengbao Jiang;Pengcheng Yin;Bogdan Vasilescu;Graham Neubig
中科院分区:
其他
文献类型:
--
作者:
Frank F. Xu;Zhengbao Jiang;Pengcheng Yin;Bogdan Vasilescu;Graham Neubig

文献摘要

相似文献

开放域代码生成的目的是通过自然语言(NL)意图以通用编程语言(例如Python)生成代码。由开发人员通常在编写代码时在网络上检索资源的动机,我们探索将两种外部知识纳入NL-to-od代码生成的有效性:从在线编程QA QA论坛stackoverflow和编程中自动开采NL代码对语言API文档。我们的评估表明,将两种来源与数据增强和基于检索的数据重新采样相结合可在代码生成测试床CONALA上提高当前最新ART的绝对BLEU分数。代码和资源可在https://github.com/neulab/external-knowledge-codegen上找到。
Open-domain code generation aims to generate code in a general-purpose programming language (such as Python) from natural language (NL) intents. Motivated by the intuition that developers usually retrieve resources on the web when writing code, we explore the effectiveness of incorporating two varieties of external knowledge into NL-to-code generation: automatically mined NL-code pairs from the online programming QA forum StackOverflow and programming language API documentation. Our evaluations show that combining the two sources with data augmentation and retrieval-based data re-sampling improves the current state-of-the-art by up to 2.2% absolute BLEU score on the code generation testbed CoNaLa. The code and resources are available at https://github.com/neulab/external-knowledge-codegen.