Thanks to visit codestin.com
Credit goes to github.com

Skip to content

minxue29031/Error_Correction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

128 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interpretable Error Correction for Code-to-Code Translation

This repository implements an interpretable error correction method designed to enhance code-to-code translation. It provides a way to correct wrong translations produced by Transformer-based models like TransCoder-ST, while offering interpretability for the corrections.

Installation

Install dependencies:

pip install -r requirements.txt

Usage

1. Build Error Correction Datastore

bash codegen_sources/knnmt/create_datastore.sh
  • This step preprocesses your training code and constructs a key-value datastore for KNN-based error correction.

2. Execute Code Error Correction

python execute.py 

Key Arguments:

  • --model → Specify the base Transformer model (default: TransCoder-ST).
  • --datastore → Path to the prebuilt error correction datastore.
  • --input → Source code file to correct.

About

None

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors