Affiliation:
1. School of Computer Science and Engineering Hunan University of Science and Technology Xiangtan China
2. Key Lab for Services Computing and Novel Software Technology Hunan University of Science and Technology Xiangtan China
Abstract
SummaryWith the wide application of deep learning in code search, especially the proposed code search model based on attention mechanism, the accuracy of code search has been greatly improved. However, the attention mechanism only captures the attention weight relationship between two words in the code fragment, without considering the contextual semantic relationship that exists between words in the code fragment, which can help improve the accuracy of code search. To address this problem, this paper proposes a model that combining bidirectional long short‐term memory and self‐attention mechanisms for code search (CBLSAM‐CS). The model first captures the contextual semantic relationship of each word in the code fragment by long‐short term memory network, and then uses the self‐attention mechanism to extract deep‐level features of the sequence. In order to verify the effectiveness of the proposed model, the paper has been conducted an experimental comparison with three other baseline models, CODEnn, CARLCS‐CNN, and SAN‐CS, on the basis of a public dataset containing 18 million code fragments. The experimental results show that the proposed model in this paper achieves 92.24% and 93.55% in mean reciprocal rank value and normalized discounted cumulative gain metrics, respectively, which are better than the baseline model. Therefore, it shows that the CBLSAM‐CS model proposed in this paper can effectively improve the accuracy and efficiency of code search.
Funder
National Natural Science Foundation of China
Subject
Computational Theory and Mathematics,Computer Networks and Communications,Computer Science Applications,Theoretical Computer Science,Software
Cited by
1 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献