Git Product home page Git Product logo

associatingnlcommentcodeentities's Introduction

Associating Natural Language Comment and Source Code Entities

Code and datasets for our AAAI-2020 paper "Associating Natural Language Comment and Source Code Entities"

If you find this work useful, please consider citing our paper:

@inproceedings{panthaplackel2020associating,
  author={Sheena Panthaplackel and Milos Gligoric and Raymond J. Mooney and Junyi Jessy Li},
  title={Associating Natural Language Comment and Source Code Entities},
  booktitle={AAAI},
  year={2020},
}

Data is available in model_data/. It can be parsed using the load_data method in models/model_utils.py.

Download embeddings.tar.gz continaining pretrained embeddings from here. Unzip the file in the root directory:

tar zxvf embeddings.tar.gz

A directory with the name embeddings should appear, in the root directory, with 3 json files.

You will need to create a checkpoints directory under the root directory.

Run models from within the models directory. Commands to train models are structured as below:

python run_model.py -model [MODEL_TYPE] -dropout [DROPOUT_KEEP_PROBABILITY] -lr [LEARNING_RATE] -decay [DECAY_RATE] -decay_steps [NUM_DECAY_STEPS] -num_layers [NUM_LAYERS] -layer_units [LAYER_DIMENSIONS] -model_name [MOEL_NAME] -delete_size [NUM_EXAMPLES_FROM_DELETIONS]

Insert one of the following model types in place of MODEL_TYPE:

  • feedforward
  • more_data_feedforward
  • crf
  • more_data_crf
  • subtoken_matching_baseline
  • return_line_baseline
  • random_baseline
  • majority_class_random_baseline

Matching model types with those in the paper:

Learned models:

  • feedforward = binary classifier
  • more_data_feedforward = binary classifier w/ data from deletions set
  • crf = CRF for joint classification
  • more_data_crf = CRF for joint classication w/ data from deletions set

Baselines:

  • subtoken_matching_baseline = subtoken matching
  • return_line_baseline = presence in return line
  • random_baseline = random
  • majority_class_random_baseline = weighted random

Sample commands can be found in models/run.sh.

Please email [email protected] for any questions.

associatingnlcommentcodeentities's People

Contributors

panthap2 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.