arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2305.11625cs.CLcs.SE
收藏

按代码搜索:一个新的SearchBySnippet数据集和SnippeR检索模型用于按代码片段搜索

Searching by Code: a New SearchBySnippet Dataset and SnippeR Retrieval Model for Searching by Code Snippets

Huawei Noah's Ark lab(华为诺亚方舟实验室);St. Petersburg Department of the Steklov Institute of Mathematics(斯捷克洛夫数学研究所圣彼得堡分部);Ivannikov Institute for System Programming(伊万尼科夫系统编程研究所)

Ivan Sedykh, Dmitry Abulkhanov, Nikita Sorokin, Sergey Nikolenko, Valentin Malykh

AI总结:

本文提出按代码片段搜索的新任务,构建SearchBySnippet数据集并设计SnippeR单编码器模型,在Recall@10上达到0.451,超越现有基线,成为代码搜索新基准。

摘要:

代码搜索是一项重要且被广泛研究的任务,但通常指的是通过文本查询来搜索代码。我们认为,在寻找修复错误的指令和代码示例时,使用代码片段(可能还有错误回溯)作为查询是一种自然的使用场景,但现有工作并未覆盖。此外,现有数据集使用代码注释而非全文描述作为文本,因此不适合这种使用场景。我们提出了一个新的SearchBySnippet数据集,基于StackOverflow数据实现了按代码搜索的使用场景;我们表明,在SearchBySnippet上,现有架构即使经过微调也达不到简单的BM25基线的性能。我们提出了一种新的单编码器模型SnippeR,在SearchBySnippet上以0.451的Recall@10结果超越了多个强基线;我们提议将SearchBySnippet数据集和SnippeR作为代码搜索评估的新重要基准。

英文摘要:

Code search is an important and well-studied task, but it usually means searching for code by a text query. We argue that using a code snippet (and possibly an error traceback) as a query while looking for bugfixing instructions and code samples is a natural use case not covered by prior art. Moreover, existing datasets use code comments rather than full-text descriptions as text, making them unsuitable for this use case. We present a new SearchBySnippet dataset implementing the search-by-code use case based on StackOverflow data; we show that on SearchBySnippet, existing architectures fall short of a simple BM25 baseline even after fine-tuning. We present a new single encoder model SnippeR that outperforms several strong baselines on SearchBySnippet with a result of 0.451 Recall@10; we propose the SearchBySnippet dataset and SnippeR as a new important benchmark for code search evaluation.

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

↑