Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run_classifier.py missing online prediction function #94

Closed
brightmart opened this issue Nov 10, 2018 · 9 comments
Closed

run_classifier.py missing online prediction function #94

brightmart opened this issue Nov 10, 2018 · 9 comments

Comments

@brightmart
Copy link

Hi,

how can we use fine-tuning model for online prediction.
the input is a sentence, the output is a possibility distribution.

currently, as we can see, prediction is possible by using a file(like test.tsv), but it may not feasible to use file based style.

@brightmart brightmart changed the title missing online prediction function run_classifier.py missing online prediction function Nov 10, 2018
@jacobdevlin-google
Copy link
Contributor

You'll have to write whatever "frontend" wrapper is appropriate to your use case. You should be able to use the existing code in run_classifier.py as a guide.

@brightmart
Copy link
Author

brightmart commented Nov 12, 2018

run_classifier_predict_online.py.txt

able to deploy it for online prediction by using session and feed style settings.

shall i make it works it all tasks, then send a merging request?

@CoSeCant-csc
Copy link

@brightmart nice one.
i failed to use estimator.predict to do online prediction, cuz it seems to reload the graph every time once estimator.predict is called.

is that the reason that you choose the way of session and feed style to solve this issue, right

able to deploy it for online prediction by using session and feed style settings.

@brightmart
Copy link
Author

brightmart commented Nov 23, 2018

the reason why I used session and feed style settings is that training and evaluation is designed based on files, so they load data from files then do training or evaluation. but input of online prediction is based on sequence/strings/tokens.

@mokundong
Copy link

@brightmart nice one.
i failed to use estimator.predict to do online prediction, cuz it seems to reload the graph every time once estimator.predict is called.

is that the reason that you choose the way of session and feed style to solve this issue, right

able to deploy it for online prediction by using session and feed style settings.

is there any other good solutions to avoid reload the graph every time once estimator.predict is called ?

@xikunlun001
Copy link

@brightmart
not working by the error on:
saver = tf.train.Saver()

@cdathuraliya
Copy link

Thanks a lot @brightmart for sharing your script! I cleaned it up a little bit and added notebook to demonstrate the usage. You can find it here.

@brightmart
Copy link
Author

great

@JimAva
Copy link

JimAva commented Aug 6, 2019

Can you guys share your Flask app.py code? I'm having a hard time finding any samples for BERT serving through Flask. Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants