Transformer-based code search for software Q&A sites

被引:0
|
作者
Peng, Yaohui [1 ]
Xie, Jing [1 ]
Hu, Gang [1 ]
Yuan, Mengting [1 ]
机构
[1] Wuhan Univ, Sch Comp Sci, Bayi 299, Wuhan, Hubei, Peoples R China
基金
中国国家自然科学基金;
关键词
aligned attention; code search; neural network; structural code information; transformer;
D O I
10.1002/smr.2517
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
In software Q&A sites, there are many code-solving examples of individual program problems, and these codes with explanatory natural language descriptions are easy to understand and reuse. Code search in software Q&A sites increases the productivity of developers. However, previous approaches to code search fail to capture structural code information and the interactivity between source codes and natural queries. In other words, most of them focus on specific code structures only. This paper proposes TCS (Transformer-based code search), a novel neural network, to catch structural information for searching valid source codes from the query, which is vital for code search. The multi-head attention mechanism in Transformer helps TCS learn enough information about the underlying semantic vector representation of codes and queries. An aligned attention matrix is also employed to catch relationships between codes and queries. Experimental results show that the proposed TCS can learn more structural information and has better performance than existing models.
引用
收藏
页数:13
相关论文
共 50 条
  • [31] The Answer Is Out There: Online Q&A Sites
    Uduwage, Anuradha
    Konstan, Joseph A.
    COMPUTER, 2012, 45 (07) : 90 - 92
  • [32] A Transformer-Based Ensemble Framework for the Prediction of Protein-Protein Interaction Sites
    Mou, Minjie
    Pan, Ziqi
    Zhou, Zhimeng
    Zheng, Lingyan
    Zhang, Hanyu
    Shi, Shuiyang
    Li, Fengcheng
    Sun, Xiuna
    Zhu, Feng
    RESEARCH, 2023, 6
  • [33] DeepPM: Transformer-based Power and Performance Prediction for Energy-Aware Software
    Shim, Jun S.
    Han, Bogyeong
    Kim, Yeseong
    Kim, Jihong
    PROCEEDINGS OF THE 2022 DESIGN, AUTOMATION & TEST IN EUROPE CONFERENCE & EXHIBITION (DATE 2022), 2022, : 1491 - 1496
  • [34] Transformer-Based Learned Optimization
    Gartner, Erik
    Metz, Luke
    Andriluka, Mykhaylo
    Freeman, C. Daniel
    Sminchisescu, Cristian
    2023 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR), 2023, : 11970 - 11979
  • [35] Transformer-based Image Compression
    Lu, Ming
    Guo, Peiyao
    Shi, Huiqing
    Cao, Chuntong
    Ma, Zhan
    DCC 2022: 2022 DATA COMPRESSION CONFERENCE (DCC), 2022, : 469 - 469
  • [36] Transformer-Based Microbubble Localization
    Gharamaleki, Sepideh K.
    Helfield, Brandon
    Rivaz, Hassan
    2022 IEEE INTERNATIONAL ULTRASONICS SYMPOSIUM (IEEE IUS), 2022,
  • [37] Graph Embedding based Code Search in Software Project
    Zou, Yanzhen
    Ling, Chunyang
    Lin, Zeqi
    Xie, Bing
    INTERNETWARE'18: PROCEEDINGS OF THE TENTH ASIA-PACIFIC SYMPOSIUM ON INTERNETWARE, 2018,
  • [38] CoRT: Transformer-based code representations with self-supervision by predicting reserved words for code smell detection
    Alazba, Amal
    Aljamaan, Hamoud
    Alshayeb, Mohammad
    EMPIRICAL SOFTWARE ENGINEERING, 2024, 29 (03)
  • [39] Are Code Examples on an Online Q&A Forum Reliable?
    Zhang, Tianyi
    Upadhyaya, Ganesha
    Reinhardt, Anastasia
    Rajan, Hridesh
    Kim, Miryung
    PROCEEDINGS 2018 IEEE/ACM 40TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2018, : 886 - 896
  • [40] Identify and Update Test Cases when Production Code Changes: A Transformer-based Approach
    Hu, Xing
    Liu, Zhuang
    Xia, Xin
    Liu, Zhongxin
    Xu, Tongtong
    Yang, Xiaohu
    2023 38TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE, 2023, : 1111 - 1122