With the rapid increase in the amount of public code repositories, developers maintain a great desire to retrieve precise code snippets by using natural language. Despite existing deep learning based approaches(e.g., DeepCS and MMAN) have provided the end-to-end solutions (i.e., accepts natural language as queries and shows related code fragments retrieved directly from code corpus), the accuracy of code search in the large-scale repositories is still limited by the code representation (e.g., AST) and modeling (e.g., directly fusing the features in the attention stage). In this paper, we propose a novel learnable deep Graph for Code Search (calleddeGraphCS), to transfer source code into variable-based flow graphs based on the intermediate representation technique, which can model code semantics more precisely compared to process the code as text directly or use the syntactic tree representation. Furthermore, we propose a well-designed graph optimization mechanism to refine the code representation, and apply an improved gated graph neural network to model variable-based flow graphs. To evaluate the effectiveness of deGraphCS, we collect a large-scale dataset from GitHub containing 41,152 code snippets written in C language, and reproduce several typical deep code search methods for comparison. Besides, we design a qualitative user study to verify the practical value of our approach. The experimental results have shown that deGraphCS can achieve state-of-the-art performances, and accurately retrieve code snippets satisfying the needs of the users.


翻译:随着公共代码库数量的迅速增加,开发商仍然非常希望通过使用自然语言检索精确的代码片断。尽管现有的深层次学习基础方法(例如深CS和MMAN)提供了端到端解决方案(即接受自然语言作为查询,并显示直接从代码库中检索的相关代码碎片),但大型存储库的代码搜索准确性仍然受到代码表述(例如AST)和模型(例如直接在关注阶段中显示特征)的限制。在本文中,我们提议了一个新的、可学习的代码搜索深度图(称为GraphCS),以基于中间表述技术将源代码转换为基于变量的流程图(即接受自然语言作为查询,并显示直接从代码库中检索的相关代码片断),大规模存储库的代码搜索准确性仍受到代码代表(例如AST)和模型(例如直接在关注阶段中显示特征)的限制。我们提议了一个设计完善的图表优化机制,在基于模型的代码流图中采用改良的门式直径网络。为了评估degraphCS的准确性搜索(即我们收集了41种典型的精确度数据),我们用来进行大规模搜索的系统搜索的系统,我们收集了40级数据,我们用系统,我们用系统搜索的方法可以复制数据分析。

1
下载
关闭预览

相关内容

【图神经网络导论】Intro to Graph Neural Networks,176页ppt
专知会员服务
126+阅读 · 2021年6月4日
【图与几何深度学习】Graph and geometric deep learning,49页ppt
最新《Transformers模型》教程,64页ppt
专知会员服务
313+阅读 · 2020年11月26日
神经常微分方程教程,50页ppt,A brief tutorial on Neural ODEs
专知会员服务
74+阅读 · 2020年8月2日
一份简单《图神经网络》教程,28页ppt
专知会员服务
125+阅读 · 2020年8月2日
因果图,Causal Graphs,52页ppt
专知会员服务
249+阅读 · 2020年4月19日
深度强化学习策略梯度教程,53页ppt
专知会员服务
183+阅读 · 2020年2月1日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
53+阅读 · 2019年9月29日
顶会论文 || 65篇"IJCAI"深度强化学习论文汇总
深度强化学习实验室
3+阅读 · 2020年3月15日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
【跟踪Tracking】15篇论文+代码 | 中秋快乐~
专知
18+阅读 · 2018年9月24日
vae 相关论文 表示学习 1
CreateAMind
12+阅读 · 2018年9月6日
《pyramid Attention Network for Semantic Segmentation》
统计学习与视觉计算组
44+阅读 · 2018年8月30日
LibRec 精选:连通知识图谱与推荐系统
LibRec智能推荐
3+阅读 · 2018年8月9日
【推荐】(TensorFlow)SSD实时手部检测与追踪(附代码)
机器学习研究会
11+阅读 · 2017年12月5日
【论文】图上的表示学习综述
机器学习研究会
14+阅读 · 2017年9月24日
强化学习族谱
CreateAMind
26+阅读 · 2017年8月2日
Arxiv
38+阅读 · 2020年12月2日
Arxiv
12+阅读 · 2020年6月20日
Learning Dynamic Routing for Semantic Segmentation
Arxiv
8+阅读 · 2020年3月23日
Arxiv
15+阅读 · 2020年2月5日
VIP会员
相关VIP内容
【图神经网络导论】Intro to Graph Neural Networks,176页ppt
专知会员服务
126+阅读 · 2021年6月4日
【图与几何深度学习】Graph and geometric deep learning,49页ppt
最新《Transformers模型》教程,64页ppt
专知会员服务
313+阅读 · 2020年11月26日
神经常微分方程教程,50页ppt,A brief tutorial on Neural ODEs
专知会员服务
74+阅读 · 2020年8月2日
一份简单《图神经网络》教程,28页ppt
专知会员服务
125+阅读 · 2020年8月2日
因果图,Causal Graphs,52页ppt
专知会员服务
249+阅读 · 2020年4月19日
深度强化学习策略梯度教程,53页ppt
专知会员服务
183+阅读 · 2020年2月1日
最新BERT相关论文清单,BERT-related Papers
专知会员服务
53+阅读 · 2019年9月29日
相关资讯
顶会论文 || 65篇"IJCAI"深度强化学习论文汇总
深度强化学习实验室
3+阅读 · 2020年3月15日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
【跟踪Tracking】15篇论文+代码 | 中秋快乐~
专知
18+阅读 · 2018年9月24日
vae 相关论文 表示学习 1
CreateAMind
12+阅读 · 2018年9月6日
《pyramid Attention Network for Semantic Segmentation》
统计学习与视觉计算组
44+阅读 · 2018年8月30日
LibRec 精选:连通知识图谱与推荐系统
LibRec智能推荐
3+阅读 · 2018年8月9日
【推荐】(TensorFlow)SSD实时手部检测与追踪(附代码)
机器学习研究会
11+阅读 · 2017年12月5日
【论文】图上的表示学习综述
机器学习研究会
14+阅读 · 2017年9月24日
强化学习族谱
CreateAMind
26+阅读 · 2017年8月2日
Top
微信扫码咨询专知VIP会员