Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model for other task. #168

Open
XuRuiAngel opened this issue Oct 19, 2022 · 2 comments
Open

Model for other task. #168

XuRuiAngel opened this issue Oct 19, 2022 · 2 comments

Comments

@XuRuiAngel
Copy link

Thank you for providing the source code to your paper, I have a question.
Can this model be used to identify Java design patterns? According to my rough understanding, each line of input data of the current model is the path context of a code block, while the identification of design patterns needs to analyze the whole Java files even cross files. I want to ask if the code2vec model can complete the prediction in this scenario.

@daveymathijssen
Copy link

daveymathijssen commented Oct 19, 2022

Hi @XuRuiAngel,

By default, code2vec is only able to interpret single methods. However, some other studies have tried to overcome this limitation. For example, Compton et al. have used various aggregation methods on the method embeddings to create class-level embeddings. You could experiment yourself with some aggregation methods to combine the various java files and use the resulting embeddings to train a classifier on your task of classifying design patterns.

@urialon
Copy link
Collaborator

urialon commented Oct 19, 2022

Hi @XuRuiAngel ,
Thank you for your interest in our work.

As @daveymathijssen said, code2vec is currently working on a single function at a time.
We have other recent work such as PolyCoder https://github.com/VHellendoorn/Code-LMs
and a CodeBERT model that we fine-tuned on Java, that maybe you can fine-tune to your task: https://huggingface.co/neulab/codebert-java

Let me know if you have any more questions.
Best,
Uri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants