Skip to content

wssun/TranCS

Repository files navigation

TranCS: Code search based on Context-aware Code Translation

Environment

ubuntu 16.04

Requirements

python==3.8
torch==1.8.1
tables==3.6.1
h5py==3.3.0
tqdm==4.62.3

Dataset

Original dataset

The original dataset can be downloaded from https://github.com/github/CodeSearchNet

Process dataset

  1. put the original java dataset in process_dataset/original_dataset
  2. run the processing code
python process_dataset/generate_from_jsonl.py
  1. convert instruction to translation
python process_instruction/instruction2tran.py
  1. run the preprocessing code
python src/dataset_utils.py

Baseline

DeepCS: https://github.com/guxd/deep-code-search
MMAN: https://github.com/wanyao1992/mman_public

Train

python baseline_methods/DeepCS/train.py
python baseline_methods/MMAN/train.py

Test

python baseline_methods/DeepCS/test.py
python baseline_methods/MMAN/test.py

TranCS

We provide TranCS model and raw data processing code which are listed in src/ and process_instruction/ directories.

Train the Model

python src/train.py

Test the Model

python src/test.py

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages