models icon indicating copy to clipboard operation
models copied to clipboard

Create simple API for running syntaxnet without rebuilding models

Open satchamo opened this issue 9 years ago • 8 comments

There have been numerous attempts to solve the problem of "streaming" sentences to syntaxnet. None of them are ideal.

It would be great if there was a blessed way to:

  1. initialize the models (which take several seconds)
  2. feed sentences to them
  3. capture the output immediately

In code, this would be something like:

models = initialize_syntaxnet()
while True:
    sentence = raw_input("Enter your sentence")
    output = tag_and_parse(sentence, models)
    print(output)

As it stands now, demo.sh waits until EOF is read, and then outputs everything (and then exits). To run it on another sentence, you have to run the program again (which takes several seconds to bootstrap).

satchamo avatar Jul 23 '17 19:07 satchamo

/CC @calberti, can you take a look at this?

reedwm avatar Jul 25 '17 01:07 reedwm

I was also wondering about the same thing. Ideally the user could also be able to get the trained model (network), and use it (or a part of it excluding the last layer for instance) as a module in a larger system.

adrinjalali avatar Aug 04 '17 08:08 adrinjalali

Is this possible now? I am looking for a way to pre-load the models in memory so that I can use them for multiple sentences without having to load the models again and again.

ManojB18 avatar Aug 31 '17 11:08 ManojB18

I don't think so @ManojB18. I have the same problem, and I'm waiting on this issue (https://github.com/tensorflow/models/issues/2129) to continue my experiments.

adrinjalali avatar Sep 04 '17 07:09 adrinjalali

is this possible now ? if yes, How ?

Angarish avatar Jan 12 '18 06:01 Angarish

@nardeas seems to know how to do it. The wrapper.py script in his docker image does the trick: https://github.com/nardeas/tensorflow-syntaxnet

satchamo avatar Jan 29 '18 06:01 satchamo

Anyone know of any wrappers done with the old syntaxnet that work? Most of what I've been able to find is for dragnn but we've finetuned our downstream analysis for the original syntaxnet already and prefer to continue using it

paulhager avatar Dec 13 '18 15:12 paulhager

Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

tensorflowbutler avatar Jan 29 '20 23:01 tensorflowbutler