Title
Neural query expansion for code search
Abstract
Searching repositories of existing source code for code snippets is a key task in software engineering. Over the years, many approaches to this problem have been proposed. One recent tool called NCS, takes in a natural language query and outputs relevant code snippets, often being able to correctly answer Stack Overflow questions. But what happens when the developer doesn’t provide a query with a clear intent? What if shorter queries are used to demonstrate a more vague intent? We find that the performance of NCS regresses with shorter queries. Furthermore, data from developers’ code search history logs shows that shorter queries have a less successful code search session: there are more query reformulations and more time is spent browsing the results. These observations lead us to believe that using NCS alone with short queries may not be productive enough. In this paper, we explore an additional way of using neural networks in code search: the automatic expansion of queries. We present NQE, a neural model that takes in a set of keywords and predicts a set of keywords to expand the query to NCS. NQE learns to predict keywords that co-occur with the query keywords in the underlying corpus, which helps expand the query in a productive way. Our results show that with query expansion, NQE + NCS is able to perform better than using NCS alone.
Year
DOI
Venue
2019
10.1145/3315508.3329975
Proceedings of the 3rd ACM SIGPLAN International Workshop on Machine Learning and Programming Languages
Keywords
DocType
ISBN
code search, deep learning, word-embedding
Conference
978-1-4503-6719-6
Citations 
PageRank 
References 
2
0.36
0
Authors
5
Name
Order
Citations
PageRank
Jason Liu120.36
Seohyun Kim2385.32
Vijayaraghavan Murali31247.87
Swarat Chaudhuri498167.68
Satish Chandra5117086.45