The search functionality is under construction.

IEICE TRANSACTIONS on Information

A Combined Alignment Model for Code Search

Juntong HONG, Eunjong CHOI, Osamu MIZUNO

  • Full Text Views

    1

  • Cite this

Summary :

Code search is a task to retrieve the most relevant code given a natural language query. Several recent studies proposed deep learning based methods use multi-encoder model to parse code into multi-field to represent code. These methods enhance the performance of the model by distinguish between similar codes and utilizing a relation matrix to bridge the code and query. However, these models require more computational resources and parameters than single-encoder models. Furthermore, utilizing the relation matrix that solely relies on max-pooling disregards the delivery of word alignment information. To alleviate these problems, we propose a combined alignment model for code search. We concatenate the multi-code fields into one sequence to represent code and use one encoding model to encode code features. Moreover, we transform the relation matrix using trainable vectors to avoid information losses. Then, we combine intra-modal and cross-modal attention to assign the salient words while matching the corresponding code and query. Finally, we apply the attention weight to code/query embedding and compute the cosine similarity. To evaluate the performance of our model, we compare our model with six previous models on two popular datasets. The results show that our model achieves 0.614 and 0.687 Top@1 performance, outperforming the best comparison models by 12.2% and 9.3%, respectively.

Publication
IEICE TRANSACTIONS on Information Vol.E107-D No.3 pp.257-267
Publication Date
2024/03/01
Publicized
2023/12/15
Online ISSN
1745-1361
DOI
10.1587/transinf.2023MPP0002
Type of Manuscript
Special Section PAPER (Special Section on Empirical Software Engineering)
Category

Authors

Juntong HONG
  Kyoto Institute of Technology
Eunjong CHOI
  Kyoto Institute of Technology
Osamu MIZUNO
  Kyoto Institute of Technology

Keyword