Code Monkey home page Code Monkey logo

graphsearchnet's Introduction

GraphSearchNet

This repo is the implementation of the paper "GraphSearchNet: Enhancing GNNs via Capturing Global Dependency for Semantic Code Search". We encode the programs and descriptions in a dual graph framework to learn the semantic similarity.

Get started

Prerequisites

This code is written in python 3. You will need to install the required packages in order to run the code. We recommend to use conda virtual environment for the package management. Install the package requirements with pip install -r requirements.txt.

Preprocess

  1. Download the raw data from CodeSearchNet.
  2. For Java Graph Construction, please run the scripts at graph-based-search/parsers/sourcecode/java/build_java_graph.py
  3. For Python Graph Construction, please run the scripts at graph-based-search/parsers/sourcecode/java/build_python_graph.py We provide the partial data in this repo to help run our model quickly. The whole processed data will be public.

Run the model

  1. Train Java model python main.py --config config/search_train_java.yml
  2. Train Python model python main.py --config config/search_train_puython.yml

We also provide the queried results generated by our model based on the 99 queries from CodeSearchNet in graph-based-search/answers.

Citation

If you find this code or our paper relevant to your work, please cite our arXiv paper:

@article{liu2021graphsearchnet,
  title={GraphSearchNet: Enhancing GNNs via Capturing Global Dependency for Semantic Code Search},
  author={Liu, Shangqing and Xie, Xiaofei and Ma, Lei and Siow, Jingkai and Liu, Yang},
  journal={arXiv preprint arXiv:2111.02671},
  year={2021}
}

graphsearchnet's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.