Skip to content

datapaf/sit_asg

 
 

Repository files navigation

Code Summarization with Strcuture-induced Transformer. ASG Modification.

This is a version of Strcuture-induced Transformer modified to accept Abstract Semantic Graph(ASG) as a structural input feature.

Note: The modification is available only for Python.

Dependency

pip install -r requirements.txt

Data

For reproducing the results, you can download the tokens from here and put python the data directory.

To prepare the ASG adjacency matrices, unpack adjacency.zip archive:

cd sit_asg
unzip adjacency.zip

Unpack lines.zip archive to prepare lines vectors:

cd sit_asg
unzip lines.zip

Quick Start

Training

cd main
python train.py --dataset_name python --model_name YOUR_MODEL_NAME

See the log through:

vi ../modelx/YOUR_MODEL_NAME.txt

Testing

python test.py --dataset_name python --beam_size 5 --model_name YOUR_MODEL_NAME

Acknowledgement: The implementation is based on https://github.com/gingasan/sit3.

Some Files Descriptions

absent_asg.txt - contains id of the source code samples that have no corresponding ASG adjacency matrices

with_zero_matrices.txt - contains id of the source code samples that have zero matrices because of having with statement

wrong_lines.txt - contains id of the source code samples that have incorrect corresponding lines vector

zero_matrices.txt - contains id of the source code samples that have zero ASG adjacency matrices

ignore_guids.txt - contains id of the source code samples (absent_asg.txt with_zero_matrices.txt wrong_lines.txt) to ignore while training and testing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 83.2%
  • Python 16.8%