dsindex / syntaxnet

reference code for syntaxnet
197 stars 57 forks source link

DRAGNN - Tensorflow Serving #25

Closed alexfridlyand closed 7 years ago

alexfridlyand commented 7 years ago

Hello again!:)

Could you please share your knowledge about Dragnn and tf serving integration? Do you know current state? I see that you did wrapper for REST with tornado for dragnn_script, that basically does conllu/proto to json.

I just want to hear your thoughts on all this. I've seen your integration with README_API, but from what i understand it's for syntaxnet.

I'm really trying to investigate what it will take to make tf1.0+latest serving + dragnn.

Thank you in advance!

dsindex commented 7 years ago

hello @alexfridlyand

long time ago, i summarized a method how to serve the Syntaxnet which originally made by dmansfield, xtknight. but that code is only valid for the designated Syntaxnet version(pretty old one). so if you are using very recent version of the Syntaxnet, you can't build it. (and i don't have such a deep knowledge of serving, i didn't try to modify for the recent version of Syntaxnet)

however, recently, new interface for the Syntaxnet was emerging! the DRAGNN. and thankfully, that was easy to train and inference by pure python codes.

that is why i made the dragnn scripts and api with tornado.

i am very curious why the team(of syntaxnet) doesn't release python interface for serving!! i think there should be simple and succinct python code to use the Syntaxnet.

like this pseudo code(basic pattern for inference)

initialize_model()
while 1 :
    inference by input sentence
finalize_model()

anyway, i decide not to use the Syntaxnet but use the DRAGNN instead.

p.s. since the tf is not fork-safe, i can't use multi-process to serve. i didn't find a good and simple method to solve it. this is my another concern about the DRAGNN. :(

alexfridlyand commented 7 years ago

Thank you very much for your comment! Yes, i knew about first paragraph and reviewed most of the stuff about old syntaxnet. I was able to do an inference of a baseline conll 2017 model for russian with dragnn. Your codes helped also! I appreciate it a lot.

https://github.com/tensorflow/models/pull/250 those 2 first bullets are still relate to dragnn?

new dragnn framework also works on tensoflow 0.6, right? we should port it to the 1.0 and then enable serving will be easy, do you agree?

dsindex commented 7 years ago
  1. "tensorflow/models#250 those 2 first bullets are still relate to dragnn?"

    • i don't think so. those issues are only related to tf-serving for the Syntaxnet.
  2. "new dragnn framework also works on tensoflow 0.6, right?"

    • well, i am not sure. but i guess it probably have troubles with tf 0.6.
  3. "we should port it to the 1.0 and then enable serving will be easy, do you agree?"

    • i need more explanation about it. what are you supposed to do exactly?
alexfridlyand commented 7 years ago

I see a dependency on tensorflow as a submodule. It looks like it depends on version 0.6. Am i right? So is DRAGNN still uses tf 0.6 and can't be run without internal modifications on 1. ? What should be done to serve DRAGNN with TFServing? (i thought it requires to port tf from 0.6 to 1. ) Or i'm completely wrong in all of this stuff?

dsindex commented 7 years ago

from my knowledge, i haven't thought the relation b/w dragnn and tf-serving. that is why i am confused.

if we want to tf-serve a model trained by dragnn, we should develop tf-serving codes. and it would be very different from the codes for syntaxnet.