Skip to content
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

How to distinguish between terminal nodes and non terminal nodes #14

Open
liu1234567yi opened this issue Apr 9, 2022 · 1 comment
Open

Comments

@liu1234567yi
Copy link

liu1234567yi commented Apr 9, 2022

Dear authors, Thanks for your outstanding work. I have a question for you. When you want to predict a node, you don't know whether it is a terminal node or a non terminal node in advance,and this two kinds of nodes are predicted in different ways(described in the article as two methods:Predicting AST Nodes and Predicting Subtokens). So, how to distinguish these two nodes in order to use different prediction methods in code implementation?

@urialon
Copy link
Contributor

urialon commented Apr 10, 2022

Hi @liu1234567yi ,
Thank you for your interest in our work!

We have this script that as a preprocessing step, goes through the training data and finds all the terminal and nonterminal node types.

Than, at test time when we want to predict the child node of a given node a: if a is a nonterminal - we predict from the nodes vocabulary; if a is a terminal - we predict a subtoken from the subtoken vocabulary.

I hope it helps,
Best,
Uri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants