microsoft / CodeBERT

CodeBERT
MIT License
2.15k stars 442 forks source link

Can you provide an example of code detection ? #246

Open SunFzzf opened 1 year ago

SunFzzf commented 1 year ago

I am using CodeBert for my graduation design. I want to make a tool for code similarity detection, but I have just learned Bert and Pytorch for a while. Could you please provide me with an example? I just need an example of Clone Detection

guoday commented 1 year ago

CodeBert struggles to perform Clone Detection without fine-tuning. However, I recommend using UniXcoder for Clone Detection, as it has demonstrated superior performance in detecting code similarity. You just need to change nl to another code. https://github.com/microsoft/CodeBERT/tree/master/UniXcoder#2-similarity-between-code-and-nl

SunFzzf commented 1 year ago

CodeBert struggles to perform Clone Detection without fine-tuning. However, I recommend using UniXcoder for Clone Detection, as it has demonstrated superior performance in detecting code similarity. You just need to change nl to another code. https://github.com/microsoft/CodeBERT/tree/master/UniXcoder#2-similarity-between-code-and-nl

Thank you most sincerely