Skip to content

chengjunyan1/GN-Transformer-AST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published