danielzuegner / code-transformer

Implementation of the paper "Language-agnostic representation learning of source code from structure and context".
https://www.in.tum.de/daml/code-transformer/
MIT License
166 stars 31 forks source link

Can i build function classifier using code-transformer #16

Closed ZJUFLS closed 3 years ago

ZJUFLS commented 3 years ago

Hi, I would like to build a method/function classifier using code-transformer, the labels are going to be 0,1,2,..9,

Could i get some suggestions on how to build it?

Any guidelines would be hugely appreciated! :D

vthost commented 3 years ago

I am currently trying the same and add the classes as label instead of the function name, setting separate_label_vocabulary to True and num_subtokens_output to 1. But maybe the authors have a better solution, or additional requirements :)

danielzuegner commented 3 years ago

Yes, that should be a fairly direct way to achieve what you want. Closing this, feel free to reopen in case you have follow-up questions.

tobias-kirschstein commented 3 years ago

Cool idea to use the Code Transformer for method classification. A few remarks:

vthost commented 3 years ago

Thank you! I considered the first two, but it's good to have a confirmation.