Giter Club home page Giter Club logo

Comments (9)

SpirinEgor avatar SpirinEgor commented on July 3, 2024

Hi!
Thank you for the feedback!

It seems that there is a little out of sync between astminer and this lib. In astminer AST stores in JSON under ast key and this library tries to read by key tree. You can change this behavior by changing the value here. Just set AST = "ast".

from embeddings-for-trees.

SamraMehboob avatar SamraMehboob commented on July 3, 2024

Hi
Thank you for help, its resolved.
But another same error appeared.
nodeTypeError

I tried to change NODE = "nodeType" to NODE= "typeLabel" but it didn't work.
I guess it is due to compatibility issue between astminer output and this lib.
There are 2 to 3 ways to create AST using astminer, can you let me know which format this lib is using or help me with above error.
Thanks.

from embeddings-for-trees.

SpirinEgor avatar SpirinEgor commented on July 3, 2024

Hi!

Using typeLabel should be ok.
You should use json AST storage in astminer:

storage:
  name: json AST

Could you provide some astminer output examples?

from embeddings-for-trees.

SamraMehboob avatar SamraMehboob commented on July 3, 2024

I created ASTs using Antrl provided by astminer.
Here is output example.

{"label":"1542.java","ast":[{"token":"","typeLabel":"compilationUnit","children":[1,2]},{"token":"date|time|parser","typeLabel":"IDENTIFIER","children":[]},{"token":"parser","typeLabel":"IDENTIFIER","children":[]}]}

from embeddings-for-trees.

SpirinEgor avatar SpirinEgor commented on July 3, 2024

Oh, it seems I found a bug in vocabulary implementation. Instead of using NODE value from common.py, it uses internal value:
https://github.com/JetBrains-Research/embeddings-for-trees/blob/master/embeddings_for_trees/data/vocabulary.py#L14
Try to change this NODE to typeLabel

from embeddings-for-trees.

SamraMehboob avatar SamraMehboob commented on July 3, 2024

Ok thank you. I'll try updating it.

from embeddings-for-trees.

SamraMehboob avatar SamraMehboob commented on July 3, 2024

I updated it then I get error in jsonl_dataset.py. It seems NODE value needs to be changed at some other place as well.
json1_datasetError

from embeddings-for-trees.

SamraMehboob avatar SamraMehboob commented on July 3, 2024

I changed NODE to typeLabel in common.py as well. It worked now.

https://github.com/JetBrains-Research/embeddings-for-trees/blob/master/embeddings_for_trees/utils/common.py

Thank you for support.

from embeddings-for-trees.

SpirinEgor avatar SpirinEgor commented on July 3, 2024

Nice to hear that it works!
I will update the codebase to make it easier for future usage.

If you have any other questions please feel free to open new issues.

from embeddings-for-trees.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.