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

How to get embedding for javascript and python code snippet? #62

Closed
smith-co opened this issue Aug 4, 2022 · 3 comments
Closed

How to get embedding for javascript and python code snippet? #62

smith-co opened this issue Aug 4, 2022 · 3 comments

Comments

@smith-co
Copy link

smith-co commented Aug 4, 2022

I have a couple of questions:

a) How can I use CodeT5 to extract embedding for JavaScript and Python code?
b) Can I feed incomplete code JavaScript and Python snippet to extract embedding? Or the code snippet needs to be complete?
c) Have anyone used CodeT5 to perform code to code search?

@yuewang-cuhk
Copy link
Contributor

yuewang-cuhk commented Aug 9, 2022

Hi, for embedding exaction with CodeT5, we suggest to follow the BART manner by feeding the sequences to both encoder and decoder. Then you can employ either the last decoder state or the average pooling of all decoder states as the sequence embedding.

For code search, we did not try it yet. You can refer to this UniXcoder paper which includes such evaluation for the moment.

@TejaswiniiB
Copy link

Hi @yuewang-cuhk
Does code-t5 give proper embeddings for python code with multiple methods as well? Or only for the code with single method?

@yuewang-cuhk
Copy link
Contributor

HI TejaswiniiB, we did not test it but believe it should give proper embeddings.

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