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

Visualize the parse tree #83

Open
xiaohy9 opened this issue Jun 9, 2021 · 1 comment
Open

Visualize the parse tree #83

xiaohy9 opened this issue Jun 9, 2021 · 1 comment

Comments

@xiaohy9
Copy link

xiaohy9 commented Jun 9, 2021

I’d like to visualize the parse tree from Berkeley Neural Parser. But I couldn’t find the function in the package. Could you give me the hint how to generate the tree graph as in the online demo site:
https://parser.kitaev.io/

if this function is not part of the package, please consider adding it. thanks a lot!

@chlor
Copy link

chlor commented Jun 21, 2021

Hi, I had the same problem and I have solved it with nltk lib :

`

do spacy and benepar comands before.

import nltk
from nltk import Tree, ParentedTree
parse_tree = ParentedTree.fromstring('(' + sent._.parse_string + ')')
print(parse_tree.pretty_print())
`

BR, Christina

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