stanfordnlp/CoreNLP

Constituency Parse Tree output

mercurial-moon opened this issue · 3 comments

I see that the output for constituency parse output in the text, xml or json files is given as a long string like so

Constituency parse: 
(ROOT
  (S
    (NP (NNP Stanford) (NNP University))
    (VP (VBZ is)
      (VP (VBN located)
        (PP (IN in)
          (NP (NNP California)))))
    (. .)))

This would be needed to be parsed to get it into a structured tree.
Is there a parser available for this by default in CoreNLP, or is there a more direct output (in tree format) available by querying the api ?

Hi,
Yes I was looking to getting the constituency parse data as a tree of java objects.
I found some api samples here

Tree constituencyParse = sentence.constituencyParse();

Is this ok instead of the DiskTreebank