GithubHelp home page GithubHelp logo

kazuhiradz / code_comment_generation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liang2024086/code_comment_generation

0.0 1.0 0.0 74.62 MB

Automatic Generation of Text Descriptive Comments for Code Blocks

Home Page: https://www.aaai.org/ocs/index.php/AAAI/AAAI18/paper/view/16492/16072

Python 1.13% Java 98.81% Shell 0.06%

code_comment_generation's Introduction

Code Comment Generation

Code and data for paper: Automatic Generation of Text Descriptive Comments for Code Blocks.

Resources

Libraries: tensorflow 1.3; numpy; python2.7

Put the Code Jam data in folder CodeComment_Data/Code_Jam

Put the github code data in folder CodeComment_Data/Github

You can change the command in the file run.sh to run different data set.

There are the template commands:

To train the Code-RNN:

CodeComment_Code/run_code_rnn.sh {MAX_TERMINATE_ITERATION_NUMBERS_OF_NOT_INCREASE}

For example, if we want to terminate the training process when the results of validation sets is not increased in five steps, we can write the command as:

CodeComment_Code/run_code_rnn.sh 5

To train the Code-GRU:

CodeComment_Code/run_code_gru.sh {PROJECT_NAME} {TRAIN_SET_INDEX} {VALIDATION_SET_INDEX} {TEST_SET_INDEX} {EPOCH_NUMBER}

For example, project cocos2d totally has 1181 commented methods, we split them into three date sets. The training set is from index 0 to 999, the validation set is from index 1000 to 1039 and the test set is from index 1040 to 1180. The command is:

CodeComment_Code/run_code_gru.sh cocos2d 1000 1040 1181 800

Run the demo

Put the source code of cocos2d into the folder CodeComment_Data/Github/cocos2d then run the run.sh file directly.

code_comment_generation's People

Contributors

liang2024086 avatar

Watchers

James Cloos 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.