Code search model based the self-attention
Successfully tested in Ubuntu 18.04
- Python == 3.7
- PyTorch == 1.6.0
- tqdm == 4.48.2
- numpy == 1.16.3
- tables == 3.6.1
- argparse
attention
: Self-attention network and code-description network.method
: Code/desc representation and similarity measure mudule.train.py
: Train and validate code/desc representation models.dataset.py
: Dataset loader.configs
: Basic configuration for the attention and method folder. Each function defines the hyper-parameters for the corresponding model.utils.py
: Utilities for models and training.
In our experiments, we use the dataset shared by @guxd. You can download this shared dataset from Google Drive and add this dataset folder to /data
.
Edit hyper-parameters and settings in config.py
python train --mode train
python train --mode eval
Here are some things I looked at while writing this model.