AOCG
收藏Figshare2023-12-07 更新2026-04-28 收录
下载链接:
https://figshare.com/articles/dataset/AOCG/24763701
下载链接
链接失效反馈官方服务:
资源简介:
### The replication package of AOCGThe repository is divided into two parts: datasets and the code of our AOCG method.### Requirements```- python 3.8- Java 1.8.0- transformers 4.5.1- tree-sitter 0.2.2- Pytorch 1.7.1```### Data Preprocessing```Experimental datasets contain the API_SUM dataset, the Hearthstone dataset, and the MBPP dataset. We use tree sitter tool to automatically extract the API terms and sketches of programs.Take the MBPP dataset as an example:To extract API terms, run 'data_process/api_extract.py' and acquire the 'api_terms.jsonl' To extract sketches, run 'data_process/sketch_extract.py' and acquire the 'sketches.jsonl' Put the API terms, sketches, complete codes, and requirements into the 'final_train.jsonl' and 'final_test.jsonl'.```### TrainingGiven a specific requirement, the APIer predicts API terms, and the Sketcher outputs corresponding the sketch based on the API terms and requirements. And the Coder fills the sketch to a complete program according to the API terms, sketch and requirement.```export CUDA_VISIBLE_DEVICES=0python AOCG_finetune.py \--stage_1 nl_pp \--stage_2 nl_pp_ss \--stage_3 nl_ss_pp_code \--local_rank -1 ```### InferenceThe AOCG predicts code snippets in a progressive generation manner, and write the predicted codes into 'xx.output'.```export CUDA_VISIBLE_DEVICES=0python AOCG_inference.py \--stage_1 nl_pp \--stage_2 nl_pp_ss \--stage_3 nl_ss_pp_code \--local_rank -1 ```### Evaluation```After acquiring the generated codes, evaluate the programs by running 'evaluator/evaluation.py'.```
创建时间:
2023-12-07



