Skip to content

Application to real case study #176

Open

Description

@Avv22

Hello Code2Vec team,

Could you please give some hints giving a whole software of code written in different programming languages, how it's possible to apply your tool on it?

Activity

  1. urialon commented on Feb 18, 2023

    @urialon
    Collaborator

    Hey @Avv22 ,
    Thank you for your interest in our work!

    Our repository supports only Java and C#.
    We have a newer model that supports all languages called PolyCoder. Loading it takes only a few lines of code using the Huggingface Transformers library. see:

    https://arxiv.org/pdf/2202.13169.pdf
    https://github.com/VHellendoorn/Code-LMs#october-2022---polycoder-is-available-on-huggingface

    Best,
    Uri

  2. Avv22 commented on Feb 18, 2023

    @Avv22
    Author

    Hey @Avv22 , Thank you for your interest in our work!

    Our repository supports only Java and C#. We have a newer model that supports all languages called PolyCoder. Loading it takes only a few lines of code using the Huggingface Transformers library. see:

    https://arxiv.org/pdf/2202.13169.pdf https://github.com/VHellendoorn/Code-LMs#october-2022---polycoder-is-available-on-huggingface

    Best, Uri

    Thank you. I mean if we have a big software of source code in Java. What would be your strategy you decompose the software and give it to your tool please?

  3. urialon commented on Feb 19, 2023

    @urialon
    Collaborator

    Sorry, I don't understand you're question.
    What is your goal? What are you trying to do?

  4. Avv22 commented on Feb 21, 2023

    @Avv22
    Author

    Sorry, I don't understand you're question. What is your goal? What are you trying to do?

    Thank you for your quick reply. I just meant that if we have a complete system. How we can decompose it and pass if to your model so that it predicts the names of blocks inside the system? Do you suggest decomposing the system method-wise and then try to predict a name for each method?

    I was trying to use your tool to generate a script (name to tell what software does).

  5. urialon commented on Feb 28, 2023

    @urialon
    Collaborator

    Do you suggest decomposing the system method-wise and then try to predict a name for each method?

    Yes, this is basically what our preprocessing pipeline does automatically.

  6. Avv22 commented on Feb 28, 2023

    @Avv22
    Author

    Do you suggest decomposing the system method-wise and then trying to predict a name for each method?

    Yes, this is basically what our preprocessing pipeline does automatically.

    Thank you very much. You split the code method-based, but can you please show (reference) where you do that in your code? Did you do it by yourself or you used a tool for that?

  7. urialon commented on Feb 28, 2023

    @urialon
    Collaborator

    First, our code goes through all files in the directory:
    https://github.com/tech-srl/code2vec/blob/master/JavaExtractor/JPredict/src/main/java/JavaExtractor/App.java#L43-L47

    Then, I used JavaParser to parse each file in the project, and traverse the resulting AST and extract "method nodes":
    https://github.com/tech-srl/code2vec/blob/master/JavaExtractor/JPredict/src/main/java/JavaExtractor/FeatureExtractor.java#L39-L49

    But that's a very Java-specific pipeline, I wouldn't use the same code for JavaScript.

  8. Avv22 commented on Mar 13, 2023

    @Avv22
    Author

    @urialon. Thank you. Appreciate it. Would you recommend a similar PythonPraser for Python please to extract the method node if possible?

  9. urialon commented on Mar 13, 2023

    @urialon
    Collaborator

    Yes,
    Our newer project Code2seq has a Python extractor, and the model itself is also much better.

    Best,
    Uri

  10. Avv22 commented on Mar 14, 2023

    @Avv22
    Author

    Yes, Our newer project Code2seq has a Python extractor, and the model itself is also much better.

    Best, Uri

    Thanks. The Python extractor you developed works similarily to how JavaParser works by extracting method node form python AST source code, please?

  11. urialon commented on Mar 14, 2023

    @urialon
    Collaborator

    It was contributed from the community, so it might be a little different. I think that by default, it was designed to process a specific dataset. However its logic is the same and its output fits the code2seq model.

    Best,
    Uri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions