Deep Graph Matching and Searching for Semantic Code Retrieval

Deep Graph Matching and Searching for Semantic Code Retrieval
复制标题

语义代码检索的深度图匹配和搜索

DOI:
10.1145/3447571
复制
发表时间:
2020-10
期刊:
ACM Transactions on Knowledge Discovery from Data (TKDD)
影响因子:
--
通讯作者:
Shouling Ji
Shouling Ji
中科院分区:
其他
文献类型:
--
作者:
Xiang Ling;Lingfei Wu;Saizhuo Wang;Gaoning Pan;Tengfei Ma;Fangli Xu;Alex X. Liu;Chunming Wu;Shouling Ji

文献摘要

参考文献

相似文献

代码检索是从大量的源代码库中找到与自然语言描述查询高度匹配的代码片段。目前的工作主要使用自然语言处理技术来处理查询文本(即人类自然语言)和代码片段(即机器编程语言),而忽略了查询文本和源代码的深层结构化特征,两者都包含丰富的语义信息。本文提出了一种基于图神经网络的端到端深度图匹配与搜索(DGMS)模型,用于语义代码检索任务。为此,我们首先用统一的图结构数据表示自然语言查询文本和编程语言代码段,然后使用所提出的图匹配和搜索模型来检索最佳匹配的代码段。特别是,DGMS不仅获取了单个查询文本或代码片段的更多结构信息,而且通过基于交叉注意的语义匹配操作来学习它们之间的细粒度相似性。我们在两个公共代码检索数据集上使用两种有代表性的编程语言(即Java和Python)对所提出的DGMS模型进行了评估。实验结果表明,DGMS在两个数据集上的性能都明显优于最先进的基线模型。此外,我们广泛的消融研究系统地研究和说明了DGMS各部分的影响。
Code retrieval is to find the code snippet from a large corpus of source code repositories that highly matches the query of natural language description. Recent work mainly uses natural language processing techniques to process both query texts (i.e., human natural language) and code snippets (i.e., machine programming language), however, neglecting the deep structured features of query texts and source codes, both of which contain rich semantic information. In this article, we propose an end-to-end deep graph matching and searching (DGMS) model based on graph neural networks for the task of semantic code retrieval. To this end, we first represent both natural language query texts and programming language code snippets with the unified graph-structured data, and then use the proposed graph matching and searching model to retrieve the best matching code snippet. In particular, DGMS not only captures more structural information for individual query texts or code snippets, but also learns the fine-grained similarity between them by cross-attention based semantic matching operations. We evaluate the proposed DGMS model on two public code retrieval datasets with two representative programming languages (i.e., Java and Python). Experiment results demonstrate that DGMS significantly outperforms state-of-the-art baseline models by a large margin on both datasets. Moreover, our extensive ablation studies systematically investigate and illustrate the impact of each part of DGMS.
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
DOI: --
发表时间: 2018-08
期刊: ArXiv
影响因子: --
作者:
Uri Alon;Shaked Brody;Omer Levy;Eran Yahav
通讯作者: Uri Alon;Shaked Brody;Omer Levy;Eran Yahav
DOI: 10.18653/v1/p16-2
发表时间: 2016
期刊: --
影响因子: --
作者:
K. Erk;Noah A. Smith
通讯作者: K. Erk;Noah A. Smith
DOI: --
发表时间: 2019-09
期刊: ArXiv
影响因子: --
作者:
Hamel Husain;Hongqiu Wu;Tiferet Gazit;Miltiadis Allamanis;Marc Brockschmidt
通讯作者: Hamel Husain;Hongqiu Wu;Tiferet Gazit;Miltiadis Allamanis;Marc Brockschmidt
DOI: 10.1109/ase.2011.6100115
发表时间: 2011-11
期刊: 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011)
影响因子: --
作者:
Emily Hill;L. Pollock;K. Vijay-Shanker
通讯作者: Emily Hill;L. Pollock;K. Vijay-Shanker