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 条
  • [41] Towards a question answering assistant for software development using a transformer-based language model
    Vale, Liliane do Nascimento
    Maia, Marcelo de Almeida
    2021 IEEE/ACM THIRD INTERNATIONAL WORKSHOP ON BOTS IN SOFTWARE ENGINEERING (BOTSE 2021), 2021, : 39 - 42
  • [42] Quality and clarity of health information on Q&A sites
    Chu, Samuel Kai Wah
    Huang, Hong
    Wong, Wendy Nga Man
    van Ginneken, Wouter F.
    Wu, Kendra M.
    Hung, Miu Yan
    LIBRARY & INFORMATION SCIENCE RESEARCH, 2018, 40 (3-4) : 237 - 244
  • [43] Towards a Weighted Voting System for Q&A Sites
    Romano, Daniele
    Pinzger, Martin
    2013 29TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), 2013, : 368 - 371
  • [44] Predictors of Answer Quality in Online Q&A Sites
    Harper, F. Maxwell
    Raban, Daphne
    Rafaeli, Sheizaf
    Konstan, Joseph A.
    CHI 2008: 26TH ANNUAL CHI CONFERENCE ON HUMAN FACTORS IN COMPUTING SYSTEMS VOLS 1 AND 2, CONFERENCE PROCEEDINGS, 2008, : 865 - 874
  • [45] Search Based Software Testing for Software Security: Breaking Code to Make it Safer
    Antoniol, Giuliano
    ICSTW 2009: IEEE INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION, AND VALIDATION WORKSHOPS, 2009, : 87 - 100
  • [46] Seq2Code: Transformer-Based Encoder-Decoder Model for Python']Python Source Code Generation
    Laskari, Naveen Kumar
    Reddy, K. Adi Narayana
    Reddy, M. Indrasena
    THIRD CONGRESS ON INTELLIGENT SYSTEMS, CIS 2022, VOL 1, 2023, 608 : 301 - 309
  • [47] Requirement Acquisition from Social Q&A Sites
    Xiao, Ming
    Yin, Gang
    Wang, Tao
    Yang, Cheng
    Chen, Mengwen
    REQUIREMENTS ENGINEERING IN THE BIG DATA ERA, 2015, 558 : 64 - 74
  • [48] RESTBERTa: a Transformer-based question answering approach for semantic search in Web API documentation
    Kotstein, Sebastian
    Decker, Christian
    CLUSTER COMPUTING-THE JOURNAL OF NETWORKS SOFTWARE TOOLS AND APPLICATIONS, 2024, 27 (04): : 4035 - 4061
  • [49] Transformer-Based Approach to Melanoma Detection
    Cirrincione, Giansalvo
    Cannata, Sergio
    Cicceri, Giovanni
    Prinzi, Francesco
    Currieri, Tiziana
    Lovino, Marta
    Militello, Carmelo
    Pasero, Eros
    Vitabile, Salvatore
    SENSORS, 2023, 23 (12)
  • [50] Transformer-based Bug/Feature Classification
    Ozturk, Ceyhun E.
    Yilmaz, Eyup Halit
    Koksal, Omer
    2023 31ST SIGNAL PROCESSING AND COMMUNICATIONS APPLICATIONS CONFERENCE, SIU, 2023,