Retrieval on source code: a neural code search

Retrieval on source code: a neural code search
复制标题

DOI:
10.1145/3211346.3211353
复制
发表时间:
2018-06
期刊:
Proceedings of the 2nd ACM SIGPLAN International Workshop on Machine Learning and Programming Languages
影响因子:
--
通讯作者:
Saksham Sachdev;Hongyu Li;Sifei Luan;Seohyun Kim;Koushik Sen;S. Chandra
Saksham Sachdev;Hongyu Li;Sifei Luan;Seohyun Kim;Koushik Sen;S. Chandra
中科院分区:
其他
文献类型:
--
作者:
Saksham Sachdev;Hongyu Li;Sifei Luan;Seohyun Kim;Koushik Sen;S. Chandra

文献摘要

被引文献

相似文献

搜索大型代码语料库对于初学者和有经验的开发人员来说都是一个强大的生产力工具,因为它可以帮助他们快速找到与他们意图相关的代码示例。如果开发人员可以用自然语言表达他们的意图,代码搜索将变得更加有吸引力,类似于Stack Overflow支持的交互。在本文中,我们研究了使用自然语言处理和信息检索技术来直接在源代码上进行自然语言搜索,即没有一个策划的Q&A论坛,如Stack Overflow。我们使用来自Stack Overflow和GitHub存储库的基准测试套件进行的实验显示出良好的结果。我们发现,虽然一个基本的词嵌入为基础的搜索程序可以接受的工作,更好的结果可以通过添加一层的监督,以及通过定制的排名策略。
Searching over large code corpora can be a powerful productivity tool for both beginner and experienced developers because it helps them quickly find examples of code related to their intent. Code search becomes even more attractive if developers could express their intent in natural language, similar to the interaction that Stack Overflow supports. In this paper, we investigate the use of natural language processing and information retrieval techniques to carry out natural language search directly over source code, i.e. without having a curated Q&A forum such as Stack Overflow at hand. Our experiments using a benchmark suite derived from Stack Overflow and GitHub repositories show promising results. We find that while a basic word–embedding based search procedure works acceptably, better results can be obtained by adding a layer of supervision, as well as by a customized ranking strategy.