A Code Search Method Incorporating Code Annotations

Li, Qi and Liu, Jianxun and Zhang, Xiangping (2024) A Code Search Method Incorporating Code Annotations. In: Collaborative Computing: Networking, Applications and Worksharing. 19th EAI International Conference, CollaborateCom 2023, Corfu Island, Greece, October 4-6, 2023, Proceedings, Part I.

[thumbnail of 77520.pdf] PDF
77520.pdf

Download (954kB)

Abstract

Code search is a technique for users to retrieve code snippets from the Code base using natural language, which is dedicated to retrieve the target code accurately and quickly to improve the efficiency of software development. The deep learning based code search technique greatly improves the accuracy of search by learning the relationship between code and query statements. Since it relies on the extracted code features, acquiring more code features is the key to quickly improve the search performance. However, most of the previous works have not taken code annotations into consideration. In this paper, we take code annotations as code features and apply them to code search, which is named ICA-CS (Code Search that Incorporates Code Annotations). In the method, firstly, the code features are embedded to get the corresponding vector representation. It is then processed by bidirectional LSTM (Long Short-Term Memory) network or multi-head attention respectively, followed by features fusion. And finally, the model is trained by joint embedding and using the minimised ranking loss function. As the experimental results show, on the evaluation metric MRR (mean reciprocal rank) compared to the state-of-the-art models DeepCS, SAN-CS, CARLCS-CNN and SelfAtt, the proposed model improves 48.96%, 17.11%, 41.01% and 13.07%, respectively.

Item Type: Conference or Workshop Item (UNSPECIFIED)
Uncontrolled Keywords: Code search, Code features, Code annotations, Bidirectional LSTM, Multi-head attention
Date Deposited: 04 Mar 2026 19:50
Last Modified: 20 Nov 2026 13:31
URI: https://eprints.eai.eu/id/eprint/58176

Actions (login required)

View Item
View Item