arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.10744cs.CLcs.PL
收藏

基于序列标记的问答的程序设计语言无关代码和语言对挖掘

Programming Language Agnostic Mining of Code and Language Pairs with Sequence Labeling Based Question Answering

University of California, Berkeley(加州大学伯克利分校);Tencent Cloud(腾讯云);Tsinghua University(清华大学)

Changran Hu, Akshara Reddi Methukupalli, Yutong Zhou, Chen Wu, Yubo Chen

摘要:

挖掘对齐的自然语言和程序设计语言对是理解自然语言-程序设计语言对的一个关键任务。现有的方法应用专门的手工制作的功能或单独训练的模型,为每个PL。然而,它们通常遭受跨多个PL的低可转移性,特别是对于具有较少注释数据的利基PL。幸运的是,Stack Overflow回答帖子本质上是一系列文本和代码块,其全局文本上下文可以提供PL不可知的补充信息。在本文中,我们提出了一个基于序列标记的问答(SLQA)方法,以PL不可知的方式挖掘NL-PL对。特别是,我们建议应用BIO标记方案而不是传统的二进制方案来挖掘通常由多个帖子块组成的代码解决方案。在现有的单PL单块基准测试和人工标记的跨PL多块基准测试上的实验证明了SLQA的有效性和可移植性。我们进一步提出了一个并行的NL-PL语料库命名为Lang 2Code自动挖掘SLQA,其中包含约1.4M对6 PL。在统计分析和下游评估下,我们证明Lang 2Code是进一步NL-PL研究的大规模高质量数据资源。

英文摘要:

Mining aligned natural language (NL) and programming language (PL) pairs is a critical task to NL-PL understanding. Existing methods applied specialized hand-crafted features or separately-trained models for each PL. However, they usually suffered from low transferability across multiple PLs, especially for niche PLs with less annotated data. Fortunately, a Stack Overflow answer post is essentially a sequence of text and code blocks and its global textual context can provide PL-agnostic supplementary information. In this paper, we propose a Sequence Labeling based Question Answering (SLQA) method to mine NL-PL pairs in a PL-agnostic manner. In particular, we propose to apply the BIO tagging scheme instead of the conventional binary scheme to mine the code solutions which are often composed of multiple blocks of a post. Experiments on current single-PL single-block benchmarks and a manually-labeled cross-PL multi-block benchmark prove the effectiveness and transferability of SLQA. We further present a parallel NL-PL corpus named Lang2Code automatically mined with SLQA, which contains about 1.4M pairs on 6 PLs. Under statistical analysis and downstream evaluation, we demonstrate that Lang2Code is a large-scale high-quality data resource for further NL-PL research.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑