PyTorch's implementation of code2seq model.
Use yaml files from config directory to configure all processes.
model option is used to define model, for now repository supports:
- code2seq
- typed-code2seq
- code2class
data_folder stands for the path to the folder with dataset.
For checkpoints with predefined config, users can specify data folder by argument in corresponding script.
Code2seq implementation supports the same data format as the original model. The only one different is storing vocabulary. To recollect vocabulary use
PYTHONPATH='.' python preprocessing/build_vocabulary.pyTo train model use train.py script
python train.py modelUse main.yaml to set up hyper-parameters.
Use corresponding configuration from configs/model to set up dataset.
To resume training from saved checkpoint use --resume argument
python train.py model --resume checkpoint.ckptTo evaluate trained model use test.py script
python test.py checkpoint.pyTo specify the folder with data (in case on evaluating on different from training machine) use --data-folder argument
python test.py checkpoint.py --data-folder path