Code Search Method Based on Program Dependency Graph Representation Learning
-
Abstract
Code search provides semantically similar program fragments from a large codebase based on the developer's query sentence. Existing code search methods are mainly based on abstract syntax trees to represent code fragments, which cannot fully express the structural semantics of code fragments. This paper proposes a code search method based on program-dependent graph representation learning. Firstly, the program code fragment is converted into a program dependency graph of the marker control dependency and data dependency. The graph node is initialized with the Transformer encoder, and the structural features of the program fragment are extracted by combining the graph neural network module of self-attention hierarchical pooling, which better capture the complete semantical structure. Evaluated in Java language and Python language in the public CodeSearchNet dataset, the proposed method is superior to the advanced code search method GraphSearchNet.
-
-