models icon indicating copy to clipboard operation
models copied to clipboard

How to get parsey mcparseface tree output programatically

Open JemarJones opened this issue 10 years ago • 4 comments

I've read through the README on syntaxnet and figured out how to set everything up and running with the demo.sh file. What i'm unclear about is how i can get the output tree that is created by the demo, and access it programatically so that i can actually make use of the structure. Any help would that could point me in the right direction would be appreciated?

JemarJones avatar May 27 '16 17:05 JemarJones

If you go through the master/syntaxnet/syntaxnet/conll2tree.py you should see the basic tensorflow session reading the output of the parse_eval into a sentence class and storing the tree as a dictionary. Using the dictionary you could do whatever instead of printing the ascii tree.

smaransmarty avatar May 28 '16 11:05 smaransmarty

Okay this seems to be a good start. Is there not a more official way to go about this, rather than digging through the code? Also, would i need to rebuild the whole project after making some modification there?

JemarJones avatar May 30 '16 13:05 JemarJones

This would be a good way to utilize the parse_eval output. I am not part of Google and I am sure thats the whole purpose of open sourcing this, so anyone can make changes as one needs. Well changing the python code would not need a rebuild. If you would change the ops code thats in C then definitely Yes.

smaransmarty avatar May 30 '16 15:05 smaransmarty

Hi Jemar,

Smaran's right, if you tweak the Python code you won't need to rebuild. You can of course add further Python binaries by adding more BUILD rules (at which point you'll need to rebuild).

At this stage we're not suggesting any 'official' way to access SyntaxNet through Python, and could envision running it in a variety of ways from Python or even directly from C++.

Cheers, Daniel

andorardo avatar Jun 02 '16 13:06 andorardo