Dependency Tree with Stanza - stanford-nlp

I'm using Stanza (https://stanfordnlp.github.io/), and I'd like to take the dependency tree and convert it to an image, similar to what's done here (how to get a dependency tree with Stanford NLP parser).
However, I've downloaded the stanza source code and can't seem to find anything similar to the to_dot() method. How should I proceed to do this in Stanza?

Related

Cannot extract confidence level from StanfordOpenIE

Was using StanfordOepnIE for my professor on a research project.
I can successfully extract the triples by using OpenIE annotator from the Standford NLP server.
However, the confidence score was not returned with the requested json as it was shown on the website
https://nlp.stanford.edu/software/openie.html.
Apparently it seemed like that was not being implemented yet by the Stanford people.
Anyone has solution to the problem or have alternative python library that I can to extract both the expected output with its confidence level from the Stanford OpenIE?
The text output has the confidences. We can add the confidences into the json for future versions.

Does Constituency Parse annotator include the full Deparse?

From the Constituency parse documentation it seems obvious you can also get a dependency parse from the "parse" annotator. (Kind of like a bonus!) Is the dependency parse annotation produced by the constituency "parse" annotator the same output as the annotation produced by the "deparse" annotator?
In other words, if you run the constituency parse annotator, is it redundant to also run the "deparse" step?
I already use the dependency parser and want to start using the constituency parser as well. I don't want to double up on the parsers if I don't have to.
Thanks!
If you run the constituency parser there is a rule based process that will create a dependency parse structure based on the constituency parse, so yes you will automatically get a dependency parse for a sentence. You only need to run the parse annotator if you want both types of parses.
It is important to note that this won't necessarily be the same dependency parse that the neural model will generate. So in case 1 you create a statistical constituency parse, and then with rules convert that to a dependency parse. In case 2 you are using a neural model to only generate a dependency parse. I am sure quite regularly these parses are not identical.

Exact description of parent inheritance

Both the official documentation and Nexus Book have only a superficial description.
There are some details on merging plugin configuration, but that's all.
I just noticed a weird behavior: namely adding a <resources>/<resource> element seems to override parent declarations rather than doing an append or merge.
Can I find a more detailed description of the merge algorithm somewhere on the Web, or is reading the source code the only way to find out?
If it's just code can somebody point where to look, or should I just check what effective-pom mojo calls?

Arango single tree response using AQL only

I have found several questions that are similar but no solution worked as needed, or used internal functions. This is the most relevant one:
Getting data for d3 from ArangoDB using AQL (or arangojs)
I'm unable to understand how to return a single response with a tree structure of parent + children. Something that D3 can understand. Whatever I do, beyond the first iteration, everything is a mess. I have tried MERGE and MERGE_RECURSIVE but it just did not work as I thought of.
I'm clueless to how I can make it to work. I'm used to Neo4J and for some reason this one is just hard for me to understand.
Any help will do,
Thanks,
DD.
I found a simple solution. I'm just using AQL to get a flat list of results and their edges. After that, I just sort it as I need on my code

Using Boost Property Tree to replace DOM Parser

I need to write a XML Parser using Boost Property tree which can replace an existing MSXML DOM Parser. Basically my code should return the list of child nodes, number of child nodes etc. Can this be achieved using Property Tree? Eg. GetfirstChild(),selectNodes(),Getlength()etc.
I saw a lot of APIs related to Boost Property Tree, but the documentation seems to be bare minimum and confusing. As of now, I am able to parse the entire XML using BOOST_FOREACH. But the path to each node is hard coded which will not serve my purpose.
boost::property_tree can be used to parse XML and it's a tree so you can use as XML DOM substitution but the library is not intended to be fully fledged XML parser and it's not complaint with XML standard. For instance it can successfully parse non-wellformed xml input and it doesn't support some of XML features. So it's your choice - if you want simple interface to simple XML configuration then yes, you should use boost::property_tree

Resources