Amrit Bulusu
Amrit Bulusu

Reputation: 31

How to get a tree visualization for google nl api?

How can you develop a tree for the syntax analysis in google nl api. Like stanford corenlp uses brat annotation tool to generate the tree. Can we use something like that to generate a dependency parse tree for the json response for google nl api, if so how?

Thanks in advance :)

Upvotes: 3

Views: 1271

Answers (2)

Dave Orr
Dave Orr

Reputation: 1102

There's the demo UI -- go to the NL API home page and scroll down to the interactive demo. There you can put in a sentence, click on "syntax" and get a pretty tree that shows the parse tree.

Parse tree visualization

In the actual demo, you can mouse over the tokens to see more detail, like morphology.

This will help for individual examples. If you want to visualize these things programatically, you'll have to implement that yourself, or use existing tools.

Upvotes: 2

Adam
Adam

Reputation: 5985

I'm not able to find any pre-existing tools that do this, but the documentation for the Google NL API has a section on dependency trees which include pseudocode for iterating over the analysis response. This could be useful for parsing the response into a format that brat or another syntax tree visualization tool understands.

Upvotes: 0

Related Questions