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

Why must use "nwords"? It makes the models harder to serve for inputs from database #42

Open
ishrar opened this issue Feb 28, 2019 · 1 comment

Comments

@ishrar
Copy link

ishrar commented Feb 28, 2019

Currently, the learnt models require the nwords parameter, along with the main words input, when serving the models with tensorflow server.

It would be very helpful if this requirement of nwords parameter can be omitted, so that only the words array can be streamed directly from database sources to the tensorflow server running the learnt models.

@guillaumegenthial
Copy link
Owner

If you're making batchted predictions, sentences can be of different lengths and thus need to be padded before being fed to tensorflow, and as the CRF is a sequence model, you need the length to be exact, so it won't be possible to omit the length.

It might be possible to slightly modify the code to not use the length at inference time if you're always giving one sentence at a time (batches of size 1) but I would really not recommend it.

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

2 participants