3

After executing some of an example syntaxnet scripts(like parse.sh) I receive output in text-conll format. My goal is to take some features and proceed them to next network. One possible choice is to parse text output with something like nltk.corpus.reader.ConllCorpusReader to a python object. But for me interesting is:

It is possible with some code modification to get from SyntaxNet not text, but Python object related to parsed results?

I've found that in parser_eval.py on lines 133-138 syntaxnet fetched already text version of results.

while True:
    tf_eval_epochs, tf_eval_metrics, tf_documents = sess.run([
        parser.evaluation['epochs'],
        parser.evaluation['eval_metrics'],
        parser.evaluation['documents'],
    ])

But I cannot locate the place from what object this text was generated and how.

Obito
  • 391
  • 3
  • 8

1 Answers1

0

There are many ways to do it, and from what I know all involve parsing the output of SyntaxNet, and load it into NLTK objects. I wrote a simple post on my blog, exemplifying it:

http://www.davidsbatista.net/blog/2017/03/25/syntaxnet/

David Batista
  • 3,029
  • 2
  • 23
  • 42
  • Hi, David, Yes I know that this is possible to parse output by some external script. But the question was is it possible to receive result directly from syntaxnet as python object. – Illarion Khlestov Apr 13 '17 at 07:17
  • I've never investigated that, I guess you have to play around directly with SyntaxNet implementation in Tensorflow. Another alternative is to have SyntaxNet working as a daemon, I don't know if that is possible, but I suspect this might be the path to go: https://tensorflow.github.io/serving/ – David Batista Apr 13 '17 at 08:02