Skip to content

css518/Keywords-Guided-Method-Name-Generation

Repository files navigation

Keywords-Guided-Method-Name-Generation

Code for the model presented in the paper: "Keywords Guided Method Name Generation". This repository contains the Tensorflow implementation of Keywords Extractor and KG-MNGen, the code implementation are based on graph neural network library OpenGNN.

The dataset we used is from paper "Code2seq: Generating Sequences from Structure Representations of Code", where the unprocessed Java-small dataset can be found and downloaded Here. You can parse the original dataset to the graph format by Parsers.

To download the preprocessed datasets for Keywords Extractor and KG-MNGen, use:

Get Started

run the keywords extractor

First, you should train the keywords extractor. Note that the param --classify is needed.

sh run_extractor.sh

Then, run the keywords extractor to predict the keywords of each code snippet.

sh infer_extractor.sh

Of course, you can download the processed method name generation dataset, instead of retraining a keywords extractor.

run the KG-MNGen

Similar to the keywords extractor, train the KG-MNGen first.

sh run_kgmngen.sh

Then, run the KG-MNGen to predict the method name of each code snippet.

sh infer_kgmngen.sh

About

A repository with the code for the paper with the same title

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published