Riadh Belkebir
Riadh Belkebir

Reputation: 795

How to get a node level with Stanford dependency parser

I would like to know if there is any method that allows to give the node level of the parse given by Stanford dependency parser. I haven't found the method that gives the node level. Thanks for the help.

Upvotes: 0

Views: 230

Answers (1)

Chthonic Project
Chthonic Project

Reputation: 8366

The Stanford NLP pipeline contains the class ExhaustiveDependencyParser as well as the interface ViterbiParser, both of which have methods from which you can get a Tree object. This, in turn, has a depth(Tree) method. Using this method with the root node as argument should suffice.

Upvotes: 1

Related Questions