Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

After the model training, I want to input a paragraph and a question, and then get the output answer, how to do #22

Open
hl0929 opened this issue Jun 10, 2019 · 3 comments

Comments

@hl0929
Copy link

hl0929 commented Jun 10, 2019

No description provided.

@ronaktanna1
Copy link

I have a similar concern. Is there any boilerplate code that can be used to get inference on new paragraph and questions?

@yylun
Copy link
Contributor

yylun commented Jun 24, 2019

If you want a interactive or data-streaming way to do inference with a trained model, unfortunately there is no boilerplate code yet. A simple idea to implement it is to modify the BatchGenerator class.

In examples, you have to feed the instance list to BatchGenerator because BatchGenerator need to do type detection for all fields(https://github.com/sogou/SMRCToolkit/blob/master/sogou_mrc/data/batch_generator.py#L49). If types of all fields are known, you can simply pass a generator of you data to inner Dataset(https://github.com/sogou/SMRCToolkit/blob/master/sogou_mrc/data/batch_generator.py#L108-L116). Then use it as other examples and run inference with you model.

Maybe will add a StreamBatchGenerator

@hl0929
Copy link
Author

hl0929 commented Jun 24, 2019

If you want a interactive or data-streaming way to do inference with a trained model, unfortunately there is no boilerplate code yet. A simple idea to implement it is to modify the BatchGenerator class.

In examples, you have to feed the instance list to BatchGenerator because BatchGenerator need to do type detection for all fields(https://github.com/sogou/SMRCToolkit/blob/master/sogou_mrc/data/batch_generator.py#L49). If types of all fields are known, you can simply pass a generator of you data to inner Dataset(https://github.com/sogou/SMRCToolkit/blob/master/sogou_mrc/data/batch_generator.py#L108-L116). Then use it as other examples and run inference with you model.

Maybe will add a StreamBatchGenerator

thank you

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

No branches or pull requests

3 participants