KDEGroup / RefBERT

Source code for ISSTA'23 paper "RefBERT: A Two-Stage Pre-trained Framework for Automatic Rename Refactoring".

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RefBERT: A Two-Stage Pre-trained Framework for Automatic Rename Refactoring

The source code and datasets for ISSTA 2023 paper: RefBERT: A Two-Stage Pre-trained Framework for Automatic Rename Refactoring [arXiv preprint].

Folder

  • model folder contains pretrain and finetune two folders, which include source code for the two stages described in our paper.
  • result folder contains several figures reported in the paper (submission version).

Environment

The required environment is included in environments.txt.

Data

The datasets used in experiments can be downloaded from Google Drive or 阿里云盘.

How to run

Our model has two stages: pretraining and finetuning.

First, pre-train the model:

python ./model/pretrain/train.py

Then, fine-tune the model on the LP task and the TG task:

python ./model/finetune/LP/train.py
python ./model/finetune/TG/train.py

Note that, since the number of masked tokens in each function differs in finetuning, we set batch size to 1 in the finetuning stage. The parameters args.do_train and args.do_eval control whether the program is training the model or evaluating the model. More details can be found in the paper.

About

Source code for ISSTA'23 paper "RefBERT: A Two-Stage Pre-trained Framework for Automatic Rename Refactoring".

License:MIT License


Languages

Language:Python 100.0%