tech-srl / code2vec

TensorFlow code for the neural network presented in the paper: "code2vec: Learning Distributed Representations of Code"
https://code2vec.org
MIT License
1.1k stars 286 forks source link

Javascript Benchmark with Code2Vec #177

Open zunairazaman2021 opened 1 year ago

zunairazaman2021 commented 1 year ago

Hi @urialon, Is there a way to run Code2Vec on Javascript Benchmarks. Can you guide me how do we get Code2Vec input format for Javascript benchmarks. Currently, I am using ASTminer library but the results I get look like this ![Uploading Screenshot 2023-02-20 at 08.53.01.png…]()

urialon commented 1 year ago

Hi @zunairazaman2021 , Thank you for your interest in our work!

Our repository supports only Java and C#. We have a newer model that supports all languages called PolyCoder. Loading it takes only a few lines of code using the Huggingface Transformers library. see:

https://arxiv.org/pdf/2202.13169.pdf https://github.com/VHellendoorn/Code-LMs#october-2022---polycoder-is-available-on-huggingface

We also have another project called CodeBERTScore: https://github.com/neulab/code-bert-score Where we trained a CodeBERT model specifically for JavaScript. See: https://github.com/neulab/code-bert-score#backend-model

Best, Uri

zunairazaman commented 1 year ago

@urialon considering I want to use Code2Vec to predict "what is happening in a JS method/file". Do you think CodeBERTScore can be applied for such case study.

urialon commented 1 year ago

Not out of the box, you will need to train it.