OCoR: An Overlapping-Aware Code Retriever

08/12/2020
by   Qihao Zhu, et al.
0

Code retrieval helps developers reuse the code snippet in the open-source projects. Given a natural language description, code retrieval aims to search for the most relevant code among a set of code. Existing state-of-the-art approaches apply neural networks to code retrieval. However, these approaches still fail to capture an important feature: overlaps. The overlaps between different names used by different people indicate that two different names may be potentially related (e.g., "message" and "msg"), and the overlaps between identifiers in code and words in natural language descriptions indicate that the code snippet and the description may potentially be related. To address these problems, we propose a novel neural architecture named OCoR, where we introduce two specifically-designed components to capture overlaps: the first embeds identifiers by character to capture the overlaps between identifiers, and the second introduces a novel overlap matrix to represent the degrees of overlaps between each natural language word and each identifier. The evaluation was conducted on two established datasets. The experimental results show that OCoR significantly outperforms the existing state-of-the-art approaches and achieves 13.1 conducted several in-depth experiments to help understand the performance of different components in OCoR.

READ FULL TEXT

Authors

page 1

page 2

page 3

page 4

12/02/2020

CRaDLe: Deep Code Retrieval Based on Semantic Dependency Learning

Code retrieval is a common practice for programmers to reuse existing co...
08/27/2020

Neural Code Search Revisited: Enhancing Code Snippet Retrieval through Natural Language Intent

In this work, we propose and study annotated code search: the retrieval ...
03/13/2019

CoaCor: Code Annotation for Code Retrieval with Reinforcement Learning

To accelerate software development, much research has been performed to ...
09/03/2020

CoNCRA: A Convolutional Neural Network Code Retrieval Approach

Software developers routinely search for code using general-purpose sear...
04/17/2017

A Neural Architecture for Generating Natural Language Descriptions from Source Code Changes

We propose a model to automatically describe changes introduced in the s...
02/16/2022

Code Search based on Context-aware Code Translation

Code search is a widely used technique by developers during software dev...
08/07/2017

Code Park: A New 3D Code Visualization Tool

We introduce Code Park, a novel tool for visualizing codebases in a 3D g...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.