I’m not sure I’m in the right part of the forum, so don’t hesitate to redirect me.
I have some questions about DeepPavlov and I couldn’t find answers inside the documentation (maybe I missed it, I only found : Register your model — DeepPavlov 1.1.0 documentation for explanation on how to register a model) :
I wish to integrate a custom already trained model inside a pipeline, only for inference. It’s a model conducting intent and entity recognition. It’s saved as a pytorch model (files for config, model and training args). Is there any way to do that ? If so, where can I find the corresponding documentation with examples or tips on how to achieve that ?
Hey @Alana , Thank you very much for your interest!
It’s possible to integrate pre-trained models into DeepPavlov, however, it depends on the model itself.
Please let us know if the model is based on transformer by hugging-face? If it’s already on transformer’s hub? If not, are you able to upload it on transformer’s hub?
No, it’s not on Hugging-Face hub but it’s based on a Hugging-Face Transformer. Classifications layers were built on top of it to make the joint detection of intent and entities.
I can’t upload it to the hub. Is there a way to load it from pytorch model source files ?
Then, it might be a problem. First, we have to implement the configuration of the classification layers in DeepPavlov. Can you provide us with the exact configuration of the layers? Potentially we could implement it and add it to our next release, however, it might take some time.
How do you intend to use your model within DeepPavlov? Only for inference via rise API?
I never used DeepPavlov before, but indeed, the main idea is to use it for the inference API. Is there any way to make DeepPavlov call a custom script for inference when a custom model is present in the pipeline ?
I don’t believe there is an easy way to integrate JointBERT into DeepPavlov.
We will consider adding JointBERT into our next release but it will take some time. Meanwhile I can offer separate models for intent classification and slot filling based on any Transformer-based encoder.
Thanks again for your answer ! That would be an awesome feature.
I the meantime, is there any documentation/examples somewhere on how to integrate a custom model for inference ? For example, let’s suggest I make two scripts using the same model : one for intent detection, the other for entities. How can I integrate them inside a deeppavlov pipeline for inference ? Is there an example somewhere on how to proceed ?