Closed celsofranssa closed 3 years ago
Hi @Ceceu , Thanks again for your interest in code2vec! I think that code2seq would be more appropriate for this task than code2vec.
Please see these issues: https://github.com/tech-srl/code2seq/issues/41 https://github.com/tech-srl/code2seq/issues/45
Best, Uri
Couldn't the following script
python3 code2vec.py \
--load models/java14_model/saved_model_iter8.release \
--test codes.txt \
--export_code_vectors
be used to extract the vector from the codes?
...
public int getPushesLowerbound() {\n\t\tretu...
public void setPushesLowerbound(int pushesLo...
public void play() {\n\t\t\t\n\t\t\t// If ...
public int getInfluenceValue(int boxNo1, int...
public void setPositions(int[] positions){\n...
...
Hmmm, not exactly, the codes.txt
file needs to be a file that was preprocessed by JavaExtractor.
The --test
flag expects a preprocessed file (where every row is a list of paths), rather than a raw Java text.
If we want to build C/C++ vector using code2vec, then what should we use? - 1) JavaExtractor, 2) CSharp Extractor, 3) I need to build my own extractor?
Hi @faysalhossain2007 , Thank you for your interest in code2vec!
You'll need to build your own extractor. Fortunately, there are some existing extractors for C/C++, see: https://github.com/tech-srl/code2vec#extending-to-other-languages and: https://github.com/tech-srl/code2seq/#extending-to-other-languages
If you have any further questions, feel free to open a new issue, as these issues are unrelated.
Best, Uri
Hmmm, not exactly, the
codes.txt
file needs to be a file that was preprocessed by JavaExtractor. The--test
flag expects a preprocessed file (where every row is a list of paths), rather than a raw Java text.
@urialon, thank you.
I am working with a Java dataset composed of pairs
(code, comment)
, as shown below:then, is there an approach to extract the path context of each Java method creating new pairs
(path_context, comment)
?