基于生成对抗策略的代码搜索
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP311

基金项目:

国家自然科学基金(61872139)


Code Search with Generative Adversarial Game
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    基于深度学习的代码搜索方法通过计算代码与描述语句各自表征的相似程度, 实现代码搜索任务. 然而此类方法并未考虑代码和描述语句之间真实存在的相关性概率分布. 针对此问题, 将经典概率模型中代码和描述语句的相关性概率分布与向量空间模型中特征提取相结合, 提出基于生成对抗策略的代码搜索方法. 所提方法首先设计代码和描述语句的特征编码器用于特征提取. 接着采用生成对抗策略, 将代码和描述语句之间的概率分布应用于生成器和判别器的交替训练, 同时实现对代码编码器和描述语句编码器的优化, 生成高质量的代码表征和描述语句表征用于代码搜索任务. 最后在公开的数据集上进行实验验证, 结果表明所提出的方法相比于DeepCS方法在Recall@10, MRR@10和NDCG@10指标上分别提升8.4%、32.5%和24.3%.

    Abstract:

    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.

    参考文献
    相似文献
    引证文献
引用本文

张祥平,刘建勋,扈海泽,刘益.基于生成对抗策略的代码搜索.软件学报,,():1-16

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2023-01-25
  • 最后修改日期:2023-04-17
  • 录用日期:
  • 在线发布日期: 2024-02-05
  • 出版日期:
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号