期刊文献+

基于生成对抗策略的代码搜索

Code Search with Generative Adversarial Game
下载PDF
导出
摘要 基于深度学习的代码搜索方法通过计算代码与描述语句各自表征的相似程度,实现代码搜索任务.然而此类方法并未考虑代码和描述语句之间真实存在的相关性概率分布.针对此问题,将经典概率模型中代码和描述语句的相关性概率分布与向量空间模型中特征提取相结合,提出基于生成对抗策略的代码搜索方法.所提方法首先设计代码和描述语句的特征编码器用于特征提取.接着采用生成对抗策略,将代码和描述语句之间的概率分布应用于生成器和判别器的交替训练,同时实现对代码编码器和描述语句编码器的优化,生成高质量的代码表征和描述语句表征用于代码搜索任务.最后在公开的数据集上进行实验验证,结果表明所提出的方法相比于DeepCS方法在Recall@10,MRR@10和NDCG@10指标上分别提升8.4%、32.5%和24.3%. The code search method based on deep learning realizes the code search task by calculating the similarity of the corresponding representation of the code and the description statement.However,this manner does not consider the real probability distribution of relevance between the code and the description.To solve this problem,this study proposes a code search method based on a generative adversarial game that combines the correlation between the code and the description in the classical probability model with the feature extraction in the vector space model.Then the generative adversarial game is adopted to apply the probability distribution between the code and the description to the alternate training of the generator and discriminator.Meanwhile,the code encoder and the description encoder are optimized,and high-quality code representation and description statement representation are generated for the code search task.Finally,experimental verification is carried out on the public dataset,and the results show that the proposed method improves the Recall@10,MRR@10,and NDCG@10 metrics by 8.4%,32.5%,and 24.3%respectively compared to the DeepCS method.
作者 张祥平 刘建勋 扈海泽 刘益 ZHANG Xiang-Ping;LIU Jian-Xun;HU Hai-Ze;LIU Yi(Key Lab for Services Computing and Novel Software Technology(Hunan University of Science and Technology),Xiangtan 411201,China;School of Computer Science and Engineering,Hunan University of Science and Technology,Xiangtan 411201,China)
出处 《软件学报》 EI CSCD 北大核心 2024年第12期5382-5396,共15页 Journal of Software
基金 国家自然科学基金(61872139)。
关键词 代码搜索 生成对抗策略 代码表征 近似采样 code search generative adversarial game code representation approximate sampling
  • 相关文献

参考文献2

二级参考文献10

共引文献9

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部