Giter Site home page Giter Site logo

icpc2020_gnn's Introduction

ICPC2020 CodeGNN

This code is part of the reproducibility package for the ICPC 2020 paper "Improved Code Summarization via a Graph Neural Network" - arxiv

The reproducibility package has three parts:

  1. the code found in this repository
  2. the trained models, predictions, and tokenizer (.tok) files can be downloaded HERE
  3. the fully processed data (as a pkl file) can be downloaded HERE

The dataset we used is from our NAACL'19 paper "Recommendations for Datasets for Source Code Summarization" where the unprocessed data can be found and downloaded HERE

This code uses Keras v2.3.1 and Tensorflow v1.15.2

Running the code and models

To run the trained models from the paper download the three parts of the reproducibility package and run predict.py. Predict.py takes the path to the model file as a positional argument and will output the prediction file to ./modelout/predictions.

python3 predict.py {path to model} --gpu 0 --modeltype {model type: codegnngru|codegnnbilstm|codegnndense} --data {path to data download}

python3 predict.py ./mymodels/codegnngru.h5 --gpu 0 --modeltype codegnngru --data ./mydata

To train a new model run train.py with the modeltype and gpu options set.

python3 train.py --gpu 0 --modeltype codegnnbilstm --data ./mydata

Processing Files

We have added our processing files to the processing directory. These files will not work without some tweaking due to hard coded paths/file names/databases but show how we processed our code, comments, and AST. To generate the base AST XML we use SrCML which can be downloaded HERE

Cite this work

@inproceedings{
leclair2020codegnn,
title={Improved Code Summarization via a Graph Neural Network},
author={Alex LeClair, Sakib Haque, Lingfei Wu, Collin McMillan},
booktitle={2020 IEEE/ACM International Conference on Program Comprehension},
year={2020},
month={Oct.},
doi={10.1145/3387904.3389268}
ISSN={978-1-4503-7958-8/20/05}
}

icpc2020_gnn's People

Contributors

acleclair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

icpc2020_gnn's Issues

Data pre-processing

Hi,

Could you please let me know where nd how the .tok files are prepared from the Java source code?
I couldn't find this functionality under the processing directory

ValueError: Unknown layer: GCNLayer

Hi thanks for sharing the code, I have been trying to reproduce the results presented in the paper.

To do this I have trained the codegnnbilstm model from scratch using the instructions and code provided in the repository. The model trains fine. However, when I try to run the predict.py file, I run into the following error.

ValueError: Unknown layer: GCNLayer

Implemetation of Bleu and Rouge-l is used?

Hi, thanks a lot for sharing the code and the dataset.

Would it be possible for you to share the implementation of Bleu and Rouge used in the paper? There are multiple implementations of this available from nltk and other Github repos. I understand there would not be much of a difference in the scores (decimal places), it would be really helpful if you could share so that there is consistency with what I comparing to and the paper.

Check-in dependency versions

Thank you for sharing the source code for your interesting paper!

To foster reproducibility, it would be nice to put requirements.txt into the repository as well, to avoid possible confusion.

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.