Open hl0929 opened 5 years ago
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
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
I have a similar concern. Is there any boilerplate code that can be used to get inference on new paragraph and questions?