-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sampling k paths from AST tree #118
Comments
Hi @Avra2 , Here it is: The code is not as simple as one would imagine, because every example has a different number of paths, so we need to sample the paths of every example separately. Let me know if you have any questions! |
@urialon. Thank you. You mentioned in your paper that, "we represent node using a learned embedding matrix E^nodes and then encode the entire sequence using the final states of a bi-directional LSTM." What is embedding matrix E^nodes and how you get that in your code please? |
@urialon. Hello Doctor, Can you please just add some hints what algorithm you used to sample over AST paths? What format your AST path is in in the first place? Have you used any AST parser to generate the AST tree, then you looped over that parsed AST tree to generate paths? For binary tree, I see it's easy to loop over it to generate all paths between all terminals, but not sure how you did that given that AST is an N-tree. Thanks. |
Hi @Avra2 ,
This is a standard, simple, embedding matrix, initialized here:
A simple sampling without repetitions.
See the README and the processed datasets.
Yes, we used JavaParser in our code, but basically every parser can work, the parser is only used at preprocessing time. The neural network is agnostic to the parser.
Why is it different? For every pair of terminals, we can go up in the tree until we reach their common ancestor, and that is the shortest path. Let me know if you have any more questions |
Hi @urialon, |
Hi @sadiasahar , Can you please provide more details? |
@urialon, thank you for the reply.
Now I want to split path from common ancestor. In this Example, from 'Foreach' Node. The Output I am requiring is
|
I see. We tried something similar in this PLDI 2018 paper. So what's the problem? Can you just edit the data files and split the paths? |
When I preprocessed my data, I got the output
The problem is, in the string
I am unable to locate common ancestor, that is why can not split the path according to my requirement. How can I locate the ancestor in the string? |
Right, I see. You can change these lines: But then you'll need to re-build the java package, and re-preprocess the data. Best, |
@urialon, thank you so much. I tried as you suggested and got required output. |
Hello Code2Seq team,
I was wondering where in your source code please does you implement the uniform sampling of k paths from AST where you also make sure that you select new paths from AST?
Regards,
The text was updated successfully, but these errors were encountered: