deep-code-search icon indicating copy to clipboard operation
deep-code-search copied to clipboard

Any suggestions about using this on javascript or python?

Open fengh16 opened this issue 5 years ago • 3 comments

We're trying to apply this model to JavaScript and Python dataset, but we don't know how to get the class or type of a variable using static code analysis. So we just use function name instead of <class name>.<function name> or <variable name>.<function name>.

Now the result seems not good, do you think the class name of a function very important in this model?

Do you have any suggestions about using this model with JavaScript or Python data? Thank you!

fengh16 avatar Jul 24 '19 07:07 fengh16

First, this model needs further fine-tuning. You should modify the default hyperparameter setting to adapt to other languages. Second, simply using function name could result in ambiguity since a function name could refer to multiple APIs including self-defined ones. We suggest applying code analysis tools to extract class names.
According to feedback from users, API sequences are the most important in representing code semantics. You can try using other sequences which captures the code logics (i.e., step by step procedure to implement a certain functionality).

guxd avatar Jul 24 '19 07:07 guxd

Thanks for your reply! But I haven't found the proper way to extract the class name of an instance just using code analysis tools, because JavaScript and Python don't have type signature. Only some code inferring methods using GNN seems good, but it can only tell user the variable is an object, rather than directly give the class name.

Do you know some tools to extract class name in JavaScript or Python? And do you know someone who applied Deep CS to JavaScript or Python? Thanks very much!

fengh16 avatar Jul 25 '19 01:07 fengh16

Thanks for your reply! But I haven't found the proper way to extract the class name of an instance just using code analysis tools, because JavaScript and Python don't have type signature. Only some code inferring methods using GNN seems good, but it can only tell user the variable is an object, rather than directly give the class name.

Do you know some tools to extract class name in JavaScript or Python? And do you know someone who applied Deep CS to JavaScript or Python? Thanks very much!

Have you already solved this problem? I also use Python language in the dataset which is CosQA dataset. I also want to use deepcs baseline. If you have sovled this problem, please tell me, thank you very much!

wusuhuang avatar Jun 23 '22 02:06 wusuhuang