GithubHelp home page GithubHelp logo

aetherprior / emse-deepcom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xing-hu/emse-deepcom

0.0 1.0 0.0 653.08 MB

The dataset for EMSE-DeepCom

License: MIT License

Perl 0.03% Python 0.08% Shell 0.01% Java 0.34% TeX 0.01% NewLisp 99.55%

emse-deepcom's Introduction

EMSE-DeepCom

The source code and dataset for EMSE-DeepCom

Model Training

Command: python3 __main__.py config.yaml --train -v

Projects extracted from Github

The project information are listed in the file projects.txt. Each line represents a project which includes the GitHub username and project name connected by "_"

The distribution of the Java methods and classes in projects

Data process

Generate ASTs for Java methods

Command: python3 get_ast.py source.code ast.json source.code:the source code file and each line represents one Java method. ast.json: the ast file for Java method and each line represents one ast:

For Example:

public boolean doesNotHaveIds (){ 
  return getIds () == null || getIds ().getIds().isEmpty(); 
}
[
{"id": 0, "type": "MethodDeclaration", "children": [1, 2], "value": "doesNotHaveIds"}, 
    {"id": 1, "type": "BasicType", "value": "boolean"}, 
    {"id": 2, "type": "ReturnStatement", "children": [3], "value": "return"}, 
        {"id": 3, "type": "BinaryOperation", "children": [4, 7]}, 
            {"id": 4, "type": "BinaryOperation", "children": [5, 6]}, 
                {"id": 5, "type": "MethodInvocation", "value": "getIds"}, 
                {"id": 6, "type": "Literal", "value": "null"}, 
            {"id": 7, "type": "MethodInvocation", "children": [8, 9], "value": "getIds"}, 
                {"id": 8, "type": "MethodInvocation", "value": "."}, 
                {"id": 9, "type": "MethodInvocation", "value": "."}
 ]

Dataset and Outputs

As the limitation of LFS, the dataset can be downloaded from Google Drive (dataset version 1)

Evaluate Metrics

The evaluation scripts are listed in the file Scripts.

The Sentence-level evaluation by NLTK:

Command: python3 evaluation.py reference predictions

The Corpus-level evaluation by multi-bleu.perl:

Command: perl multi-bleu.perl reference < predictions

The METEOR evaluation by meteor 1.5:

Command: java -Xmx2G -jar meteor-1.5.jar predictions reference -l en -norm

reference: the ground-truth file (the test.token.nl file in our dataset). predictions: the generated comments file. Each line represents one sample.

emse-deepcom's People

Contributors

xing-hu avatar

Watchers

 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.