arrow
Return

Enriching query semantics for code search with reinforcement learning

delete2022-01-01
delete21
delete
OA
AI
C
Chaozheng Wang
Z
Zhenhao Nong
C
Cuiyun Gao *
Z
Zongjie Li
J
Jichuan Zeng
Z
Zhenchang Xing
刘洋 (Yang Liu)
DOI:10.1016/j.neunet.2021.09.025delete
deleteOriginal
deleteShare
deleteSave
View PDF
Abstract

Abstract

En 中文
Code search is a common practice for developers during software implementation. The challenges of accurate code search mainly lie in the knowledge gap between source code and natural language (i.e., queries). Due to the limited code-query pairs and large code-description pairs available, the prior studies based on deep learning techniques focus on learning the semantic matching relation between source code and corresponding description texts for the task, and hypothesize that the semantic gap between descriptions and user queries is marginal. In this work, we found that the code search models trained on code-description pairs may not perform well on user queries, which indicates the semantic distance between queries and code descriptions. To mitigate the semantic distance for more effective code search, we propose QueCos, a Query-enriched Code search model. QueCos learns to generate semantic enriched queries to capture the key semantics of given queries with reinforcement learning (RL). With RL, the code search performance is considered as a reward for producing accurate semantic enriched queries. The enriched queries are finally employed for code search. Experiments on the benchmark datasets show that QueCos can significantly outperform the state-of-the-art code search models. (C) 2021 Elsevier Ltd. All rights reserved.
Keywords:
Code search
Query semantics
Semantic enrichment
Reinforcement learning
AI Summary

AI Summary

Key information extracted from the uploaded paper, including a brief overview, abstract, background, key highlights, visual analysis, and future outlook.

Journal

Neural Networks cover
Neural Networks
IF:
6.3
Papers:
7.8K
Citations:
3.0W

Organization

H
harbin institute of technology
Scholars:
8.0W
Papers: 6.6W
Citations: 66
A
Australian National University
Scholars:
2.1W
Papers: 2.3W
Citations: 3.9W
N
Nanyang Technological University
Scholars:
4.9W
Papers: 4.8W
Citations: 8.1W
C
Chinese University of Hong Kong
Scholars:
3.4W
Papers: 3.2W
Citations: 5.6W
researcher View more organizations