salesforce / CodeT5

Home of CodeT5: Open Code LLMs for Code Understanding and Generation
https://arxiv.org/abs/2305.07922
BSD 3-Clause "New" or "Revised" License
2.71k stars 396 forks source link

Regarding Code Generation task. #20

Closed BakingBrains closed 2 years ago

BakingBrains commented 2 years ago

Can I use it for Code generation? For example if I give a query, "Add two numbers", and it should generate the code for that. And if Yes, can you please suggest how can I prepare the dataset for this task or can I use the dataset which you mentioned.

Thank you

yuewang-cuhk commented 2 years ago

Yes, you can fine-tune CodeT5 on such code generation task. For data collection, one suggestion is to crawl code corpus with both code and its comments (similar to CodeSearchNet), and employ the comment texts as the source to generate the paired code.

BakingBrains commented 2 years ago

@yuewang-cuhk Thanks for the reply.

I will try, meanwhile can you please suggest if possible better way to employ the comment texts as the source to generate the paired code.

yuewang-cuhk commented 2 years ago

You may also get such data from some Code-QA platforms such as Stack Overflow.