0

I am successfully able to parse a sentence using Syntaxnet using following command.

echo 'Bob brought the pizza to Alice.' | syntaxnet/demo.sh

On an average Syntaxnet takes about 4 seconds to parse. I presume the model loads everything each time it is called. is there any way where we can pre-load the model in memory and keep it as such so that I can reduce the time taken. Also, is there any way to reduce the time taken to parse a single sentence.

Manoj
  • 1
  • 3
  • The documentation says that the demo script parses standard input one line at a time. So that suggests that you could feed multiple sentences, each one on its own line. DId you try that? Of course, you are free to edit the script to use some other mechanism to separate utterances. – rici Aug 30 '17 at 17:52
  • I am trying to feed multiple sentences in a text file. But, it gets hanged. Could you help me with this? – Manoj Aug 31 '17 at 05:02

1 Answers1

0
$ cat test.txt| syntaxnet/demo.sh

In the test.txt, I write two setences:

how are you doing today
i am doing great

The result is as follows:

Input: how are you doing today
Parse:
doing VBG ROOT
 +-- how WRB advmod
 +-- are VBP aux
 +-- you PRP nsubj
 +-- today NN tmod
Input: i am doing great
Parse:
doing VBG ROOT
 +-- i PRP nsubj
 +-- am VBP aux
 +-- great JJ advmod
Xiang Lv
  • 31
  • 3