Query-oriented two-stage attention-based model for code search

被引:2
|
作者
Yang, Huanhuan [1 ,2 ]
Xu, Ling [1 ,2 ]
Liu, Chao [1 ,2 ]
Huangfu, Luwen [3 ,4 ]
机构
[1] Chongqing Univ, Key Lab Dependable Serv Comp Cyber Phys Soc, Minist Educ, Chongqing, Peoples R China
[2] Chongqing Univ, Sch Big Data & Software Engn, Chongqing, Peoples R China
[3] San Diego State Univ, Fowler Coll Business, San Diego, CA 92182 USA
[4] San Diego State Univ, Ctr Human Dynam Mobile Age, San Diego, CA 92182 USA
关键词
Code search; Attention mechanism; Query-oriented attention mechanism; Code structural feature;
D O I
10.1016/j.jss.2023.111948
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Applying code search models to search through a large-scale codebase can significantly contribute to developers finding and reusing existing code. Researchers have applied deep learning (DL) techniques to code search models, which first compute deeper semantics representation for query and candidate code snippets, and then rank code snippets. However, these models do not well deeply analyze the semantics gap (i.e., the difference and correlation between queries written in natural language and code in programming languages), or suitably apply the correlation to the code search task. Moreover, most DL -based models use complex networks, slowing down code search tasks. To build the correlation of two languages, and apply the correlation well to code search task, we propose a query-oriented code search model named QobCS. QobCS leverage two attention-based stages, which are simple and quick, and the cooperation of the two stages bridges the semantic gap between code and query. Stage1 learns deeper semantics representation for code and query. Stage2 applies their deeper semantic correlation and query's intention to learn better code representation. We evaluated QobCS on two datasets. On dataset1/dataset2 with 485k/542k code snippets, QobCS achieves the MRRs of 0.701/0.595, outperforming DL -based code search models DeepCS, CARLCS-CNN, UNIF, and our prior study TabCS. For efficiency, our model shows desirable performances on both datasets compared to DL -based models.
引用
收藏
页数:16
相关论文
共 50 条
  • [21] Fault detection and diagnosis using two-stage attention-based variational LSTM in electrolytic copper manufacturing process
    Jaejin Yoo
    Seunghwan Song
    Kyuchang Chang
    Jun-Geol Baek
    The International Journal of Advanced Manufacturing Technology, 2023, 129 : 1269 - 1288
  • [22] Fault detection and diagnosis using two-stage attention-based variational LSTM in electrolytic copper manufacturing process
    Yoo, Jaejin
    Song, Seunghwan
    Chang, Kyuchang
    Baek, Jun-Geol
    INTERNATIONAL JOURNAL OF ADVANCED MANUFACTURING TECHNOLOGY, 2023, 129 (3-4): : 1269 - 1288
  • [23] TAFENet: A Two-Stage Attention-Based Feature-Enhancement Network for Strip Steel Surface Defect Detection
    Zhang, Li
    Fu, Zhipeng
    Guo, Huaping
    Feng, Yan
    Sun, Yange
    Wang, Zuofei
    ELECTRONICS, 2024, 13 (18)
  • [24] Beyond Query-Oriented Highlighting: Investigating the Effect of Snippet Text Highlighting in Search User Behavior
    Zhang, Hui
    COMPUTATIONAL INTELLIGENCE AND NEUROSCIENCE, 2018, 2018
  • [25] Fast Query-by-Example Speech Search Using Attention-Based Deep Binary Embeddings
    Yuan, Yougen
    Xie, Lei
    Leung, Cheung-Chi
    Chen, Hongjie
    Ma, Bin
    IEEE-ACM TRANSACTIONS ON AUDIO SPEECH AND LANGUAGE PROCESSING, 2020, 28 (28) : 1988 - 2000
  • [26] A Two-stage Evaluation of User Query Performance for the Relational Model and SQL
    Chan, Hock Chuan
    PACIFIC ASIA CONFERENCE ON INFORMATION SYSTEMS 2007, SECTIONS 1-6, 2007,
  • [27] Query-oriented text summarization based on multiobjective evolutionary algorithms and word embeddings
    Fors-Isalguez, Yanet
    Hermosillo-Valadez, Jorge
    Montes-y-Gomez, Manuel
    JOURNAL OF INTELLIGENT & FUZZY SYSTEMS, 2018, 34 (05) : 3235 - 3244
  • [28] An attention-based multi-input LSTM with sliding window-based two-stage decomposition for wind speed forecasting
    Yang, Dongchuan
    Li, Mingzhu
    Guo, Ju-e
    Du, Pei
    APPLIED ENERGY, 2024, 375
  • [29] Two-Stage Query Segmentation for Information Retrieval
    Bendersky, Michael
    Croft, W. Bruce
    Smith, David A.
    PROCEEDINGS 32ND ANNUAL INTERNATIONAL ACM SIGIR CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION RETRIEVAL, 2009, : 810 - 811
  • [30] Query-oriented unsupervised multi-document summarization via deep learning model
    Zhong, Sheng-hua
    Liu, Yan
    Li, Bin
    Long, Jing
    EXPERT SYSTEMS WITH APPLICATIONS, 2015, 42 (21) : 8146 - 8155