Constituency Parse Tree output
mercurial-moon opened this issue · 3 comments
mercurial-moon commented
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 ?
AngledLuffa commented
Please explain what you mean by "structured tree". Do you want a list of
Tree objects in Java? You can get that using the DiskTreebank class
https://nlp.stanford.edu/nlp/javadoc/javanlp-4.5.1/index.html?edu/stanford/nlp/trees/DiskTreebank.html
…On Thu, Jun 8, 2023 at 5:16 AM mercurial-moon ***@***.***> wrote:
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 ?
—
Reply to this email directly, view it on GitHub
<#1362>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2AYWJBHXRC3USMNBGYFEDXKG7CVANCNFSM6AAAAAAY7GZ4AM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
mercurial-moon commented
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
AngledLuffa commented
Yes, I had thought your trees were already in a file and you needed them
back, but there are several ways to access them as part of the API
…On Thu, Jun 8, 2023, 12:21 PM mercurial-moon ***@***.***> wrote:
Hi,
Yes I was looking to getting the constituency parse data as a tree of java
objects.
I found some api samples here
<https://stanfordnlp.github.io/CoreNLP/api.html>
Tree constituencyParse = sentence.constituencyParse();
Is this ok instead of the DiskTreebank
—
Reply to this email directly, view it on GitHub
<#1362 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2AYWIJT3Q6V54YJMOQOI3XKIQ3XANCNFSM6AAAAAAY7GZ4AM>
.
You are receiving this because you commented.Message ID:
***@***.***>