GraphSearchNet: Enhancing GNNs via Capturing Global Dependency for
Semantic Code Search
- URL: http://arxiv.org/abs/2111.02671v1
- Date: Thu, 4 Nov 2021 07:38:35 GMT
- Title: GraphSearchNet: Enhancing GNNs via Capturing Global Dependency for
Semantic Code Search
- Authors: Shangqing Liu, Xiaofei Xie, Lei Ma, Jingkai Siow, Yang Liu
- Abstract summary: We design a novel neural network framework, named GraphSearchNet, to enable an effective and accurate source code search.
Specifically, we propose to encode both source code and queries into two graphs with BiGGNN to capture the local structure information of the graphs.
The experiments on both Java and Python datasets illustrate that GraphSearchNet outperforms current state-of-the-art works by a significant margin.
- Score: 15.687959123626003
- License: http://creativecommons.org/publicdomain/zero/1.0/
- Abstract: Code search aims to retrieve the relevant code fragments based on a natural
language query to improve the software productivity and quality. However,
automatic code search is challenging due to the semantic gap between the source
code and the query. Most existing approaches mainly consider the sequential
information for embedding, where the structure information behind the text is
not fully considered. In this paper, we design a novel neural network
framework, named GraphSearchNet, to enable an effective and accurate source
code search by jointly learning rich semantics of both source code and queries.
Specifically, we propose to encode both source code and queries into two graphs
with Bidirectional GGNN to capture the local structure information of the
graphs. Furthermore, we enhance BiGGNN by utilizing the effective multi-head
attention to supplement the global dependency that BiGGNN missed. The extensive
experiments on both Java and Python datasets illustrate that GraphSearchNet
outperforms current state-of-the-art works by a significant margin.
Related papers
- Bridging Local Details and Global Context in Text-Attributed Graphs [62.522550655068336]
GraphBridge is a framework that bridges local and global perspectives by leveraging contextual textual information.
Our method achieves state-of-theart performance, while our graph-aware token reduction module significantly enhances efficiency and solves scalability issues.
arXiv Detail & Related papers (2024-06-18T13:35:25Z) - Source Code Vulnerability Detection: Combining Code Language Models and Code Property Graphs [5.953617559607503]
Vul-LMGNN is a unified model that combines pre-trained code language models with code property graphs.
Vul-LMGNN constructs a code property graph that integrates various code attributes into a unified graph structure.
To effectively retain dependency information among various attributes, we introduce a gated code Graph Neural Network.
arXiv Detail & Related papers (2024-04-23T03:48:18Z) - Learning Strong Graph Neural Networks with Weak Information [64.64996100343602]
We develop a principled approach to the problem of graph learning with weak information (GLWI)
We propose D$2$PT, a dual-channel GNN framework that performs long-range information propagation on the input graph with incomplete structure, but also on a global graph that encodes global semantic similarities.
arXiv Detail & Related papers (2023-05-29T04:51:09Z) - Automatic Relation-aware Graph Network Proliferation [182.30735195376792]
We propose Automatic Relation-aware Graph Network Proliferation (ARGNP) for efficiently searching GNNs.
These operations can extract hierarchical node/relational information and provide anisotropic guidance for message passing on a graph.
Experiments on six datasets for four graph learning tasks demonstrate that GNNs produced by our method are superior to the current state-of-the-art hand-crafted and search-based GNNs.
arXiv Detail & Related papers (2022-05-31T10:38:04Z) - Enhancing Semantic Code Search with Multimodal Contrastive Learning and
Soft Data Augmentation [50.14232079160476]
We propose a new approach with multimodal contrastive learning and soft data augmentation for code search.
We conduct extensive experiments to evaluate the effectiveness of our approach on a large-scale dataset with six programming languages.
arXiv Detail & Related papers (2022-04-07T08:49:27Z) - deGraphCS: Embedding Variable-based Flow Graph for Neural Code Search [15.19181807445119]
We propose a learnable deep Graph for Code Search (called deGraphCS) to transfer source code into variable-based flow graphs.
We collect a large-scale dataset from GitHub containing 41,152 code snippets written in C language.
arXiv Detail & Related papers (2021-03-24T06:57:44Z) - Deep Graph Matching and Searching for Semantic Code Retrieval [76.51445515611469]
We propose an end-to-end deep graph matching and searching model based on graph neural networks.
We first represent both natural language query texts and programming language code snippets with the unified graph-structured data.
In particular, DGMS not only captures more structural information for individual query texts or code snippets but also learns the fine-grained similarity between them.
arXiv Detail & Related papers (2020-10-24T14:16:50Z) - Retrieval-Augmented Generation for Code Summarization via Hybrid GNN [23.445231228940738]
We propose a novel retrieval-augmented mechanism to combine the benefits of both worlds.
To mitigate the limitation of Graph Neural Networks (GNNs) on capturing global graph structure information of source code, we propose a novel attention-based dynamic graph.
Our method achieves the state-of-the-art performance, improving existing methods by 1.42, 2.44 and 1.29 in terms of BLEU-4, ROUGE-L and METEOR.
arXiv Detail & Related papers (2020-06-09T17:09:29Z) - Improved Code Summarization via a Graph Neural Network [96.03715569092523]
In general, source code summarization techniques use the source code as input and outputs a natural language description.
We present an approach that uses a graph-based neural architecture that better matches the default structure of the AST to generate these summaries.
arXiv Detail & Related papers (2020-04-06T17:36:42Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.