Code Monkey home page Code Monkey logo

gn-transformer-ast's Introduction

GN-Transformer AST

This is the official repository for the paper "GN-Transformer: Fusing AST and Source Code information in Graph Networks".

Data Preparing

Preprocess the dataset by yourself

The code we used to preprocess the Java and Python datasets are under in ./preprocess, please read README.md in /Java and /Python respectively to see how to preprocess the corpus.

The original corpus we used are from here:

Java corpus: https://github.com/xing-hu/TL-CodeSum

Python corpus: https://github.com/EdinburghNLP/code-docstring-corpus

Directly use our preprocessed dataset

You can directly download our preprocessed dataset:

Java: https://drive.google.com/file/d/1hVJaA2JA377Iz3bstHLIGaffUh_ogVnG/view?usp=sharing

Python: https://drive.google.com/file/d/1lQhczrERskISdBcWeS6VWLwCMpBAh-YF/view?usp=sharing

Or you can run the data_prepare.sh in ./data to prepare the dataset.

Training

Enter the script folders and run the gntransformer.sh, the training and testing will start.

#GPU: gpu device ids

#NAME: name of the model

Java:

cd ./scripts/java

bash gntransformer.sh #GPU #NAME

Python:

cd ./scripts/python

bash gntransformer.sh #GPU #NAME

Examples:

bash gntransformer.sh 0 some_name # one gpu

bash gntransformer.sh 0,1 some_name # two gpus

...

Trained models

You can download our trained models here:

Java: https://drive.google.com/file/d/1vnIuGLBNGU_AHDwL7yZIkoaByWiLKYxb/view?usp=sharing

Python: https://drive.google.com/file/d/1tk3Wc4YpSo_oLKCi6h3Kitvsux3vWFUO/view?usp=sharing

Or directly run download_models.sh in ./models to download the trained models.

gn-transformer-ast's People

Contributors

chengjunyan1 avatar

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.