• 文献检索
  • 文档翻译
  • 深度研究
  • 学术资讯
  • Suppr Zotero 插件Zotero 插件
  • 邀请有礼
  • 套餐&价格
  • 历史记录
应用&插件
Suppr Zotero 插件Zotero 插件浏览器插件Mac 客户端Windows 客户端微信小程序
定价
高级版会员购买积分包购买API积分包
服务
文献检索文档翻译深度研究API 文档MCP 服务
关于我们
关于 Suppr公司介绍联系我们用户协议隐私条款
关注我们

Suppr 超能文献

核心技术专利:CN118964589B侵权必究
粤ICP备2023148730 号-1Suppr @ 2026

文献检索

告别复杂PubMed语法,用中文像聊天一样搜索,搜遍4000万医学文献。AI智能推荐,让科研检索更轻松。

立即免费搜索

文件翻译

保留排版,准确专业,支持PDF/Word/PPT等文件格式,支持 12+语言互译。

免费翻译文档

深度研究

AI帮你快速写综述,25分钟生成高质量综述,智能提取关键信息,辅助科研写作。

立即免费体验

CRaDLe:基于语义依存学习的深度代码检索

CRaDLe: Deep code retrieval based on semantic Dependency Learning.

作者信息

Gu Wenchao, Li Zongjie, Gao Cuiyun, Wang Chaozheng, Zhang Hongyu, Xu Zenglin, Lyu Michael R

机构信息

The Department of Computer Science and Engineering, The Chinese University of Hong Kong, Hong Kong, China.

The School of Computer Science and Technology, Harbin Institute of Technology, Shenzhen, China.

出版信息

Neural Netw. 2021 Sep;141:385-394. doi: 10.1016/j.neunet.2021.04.019. Epub 2021 Apr 26.

DOI:10.1016/j.neunet.2021.04.019
PMID:33992974
Abstract

Code retrieval is a common practice for programmers to reuse existing code snippets in the open-source repositories. Given a user query (i.e., a natural language description), code retrieval aims at searching the most relevant ones from a set of code snippets. The main challenge of effective code retrieval lies in mitigating the semantic gap between natural language descriptions and code snippets. With the ever-increasing amount of available open-source code, recent studies resort to neural networks to learn the semantic matching relationships between the two sources. The statement-level dependency information, which highlights the dependency relations among the program statements during the execution, reflects the structural importance of one statement in the code, which is favorable for accurately capturing the code semantics but has never been explored for the code retrieval task. In this paper, we propose CRaDLe, a novel approach for Code Retrieval based on statement-level semantic Dependency Learning. Specifically, CRaDLe distills code representations through fusing both the dependency and semantic information at the statement level, and then learns a unified vector representation for each code and description pair for modeling the matching relationship. Comprehensive experiments and analysis on real-world datasets show that the proposed approach can accurately retrieve code snippets for a given query and significantly outperform the state-of-the-art approaches on the task.

摘要

代码检索是程序员在开源代码库中重用现有代码片段的常见做法。给定一个用户查询(即自然语言描述),代码检索旨在从一组代码片段中搜索最相关的代码片段。有效代码检索的主要挑战在于弥合自然语言描述与代码片段之间的语义鸿沟。随着可用开源代码数量的不断增加,最近的研究诉诸神经网络来学习这两种来源之间的语义匹配关系。语句级依赖信息突出了执行过程中程序语句之间的依赖关系,反映了代码中一条语句的结构重要性,这有利于准确捕捉代码语义,但从未在代码检索任务中被探索过。在本文中,我们提出了CRaDLe,一种基于语句级语义依赖学习的代码检索新方法。具体来说,CRaDLe通过融合语句级的依赖和语义信息来提炼代码表示,然后为每个代码和描述对学习一个统一的向量表示,以对匹配关系进行建模。在真实世界数据集上进行的综合实验和分析表明,所提出的方法能够为给定查询准确检索代码片段,并且在该任务上显著优于现有最先进的方法。

相似文献

1
CRaDLe: Deep code retrieval based on semantic Dependency Learning.CRaDLe:基于语义依存学习的深度代码检索
Neural Netw. 2021 Sep;141:385-394. doi: 10.1016/j.neunet.2021.04.019. Epub 2021 Apr 26.
2
Enriching query semantics for code search with reinforcement learning.用强化学习丰富代码搜索的查询语义。
Neural Netw. 2022 Jan;145:22-32. doi: 10.1016/j.neunet.2021.09.025. Epub 2021 Oct 11.
3
Hybrid Attention Network for Language-Based Person Search.基于语言的人物搜索的混合注意力网络。
Sensors (Basel). 2020 Sep 15;20(18):5279. doi: 10.3390/s20185279.
4
Chemical-induced disease relation extraction with dependency information and prior knowledge.基于依存信息和先验知识的化学诱导疾病关系抽取。
J Biomed Inform. 2018 Aug;84:171-178. doi: 10.1016/j.jbi.2018.07.007. Epub 2018 Jul 11.
5
Learning Dual Encoding Model for Adaptive Visual Understanding in Visual Dialogue.学习双编码模型以实现视觉对话中的自适应视觉理解。
IEEE Trans Image Process. 2021;30:220-233. doi: 10.1109/TIP.2020.3034494. Epub 2020 Nov 18.
6
Learning document semantic representation with hybrid deep belief network.使用混合深度信念网络学习文档语义表示。
Comput Intell Neurosci. 2015;2015:650527. doi: 10.1155/2015/650527. Epub 2015 Mar 23.
7
Semantic concept-enriched dependence model for medical information retrieval.用于医学信息检索的语义概念增强依赖模型
J Biomed Inform. 2014 Feb;47:18-27. doi: 10.1016/j.jbi.2013.08.013. Epub 2013 Sep 11.
8
Relevance feedback for enhancing content based image retrieval and automatic prediction of semantic image features: Application to bone tumor radiographs.基于相关性反馈的图像检索增强和语义图像特征的自动预测:在骨肿瘤 X 光片上的应用。
J Biomed Inform. 2018 Aug;84:123-135. doi: 10.1016/j.jbi.2018.07.002. Epub 2018 Jul 5.
9
BELTracker: evidence sentence retrieval for BEL statements.BELTracker:用于BEL语句的证据句子检索
Database (Oxford). 2016 May 12;2016. doi: 10.1093/database/baw079. Print 2016.
10
Semantics Disentangling for Cross-Modal Retrieval.用于跨模态检索的语义解缠
IEEE Trans Image Process. 2024;33:2226-2237. doi: 10.1109/TIP.2024.3374111. Epub 2024 Mar 25.