DeepPavlov Models API

Hello nice to meet you. I am new to the DeepPavlov framework and am aiming to utilize it to create a production-ready basic chatbot. Currently I have ventured the FAQ model in the deeppavlov framework and now want to create an API endpoint so that I can incorporate it to a site where users will ask questions. I am hoping questions can be sent as an HTTP request through an deeppavlov api where the FAQ model will generate an answer and return it through the API.

I am a great fan of the framework and am amazed by its features! But there are various confusing parts not explained in the documentations which is causing several issues.

To attempt this I have read over both the documentation for deeppavlov and deeppavlov agent. But I am confused on multiple parts. In the DeepPavlov’s master documentation on the REST API section, it is very unclear how each models are to be prepared for a rest api. There are no examples and the only available guide is a command-line script for starting a riseapi. But it does not explain how we incorporate our model to the api nor how we are supposed to exactly interact with the api.

Thus, while searching for a better solution, I came across the deeppavlov agent library and read its documentations. I have also seen the example demo you have given on this link: https://github.com/deepmipt/dp-dream-demos
But this demo does not explain how we would incorporate models from the original deeppavlov framework like FAQ, ODQA into the Deeppavlov Agent and create an API with it. It also does not explain how we are to interact with the API to have a conversation using chatbots.

It is just a little bit sad to me that you have built such an amazing library but people are unable to use the features because it is too confusing on how to make the features actually work or function at higher customized level instead of the basic basic level.

In conclusion, could you please explain how we would create an interactive API for the deeppavlov models?

Hi Brandon!

Thanks a lot for reaching out. Indeed, you are right, there’s some lack of documentation in terms of combining together different parts of our systems. We’re slowly but steadily working towards closing the gap, and we’ll also do a refactoring of our DeepPavlov Library and DeepPavlov Dream to make it drastically easier to use components from the DeepPavlov Library within the DeepPavlov Dream framework for building multiskill AI assistants.

For now, one of the things you could do is this:

  1. use gobot_done branch of the dp-dream-demos as the start
  2. use riseapi command of your DeepPavlov Library’s FAQ model to run it as a REST API
  3. make sure your FAQ model is properly containerized to run as a docker container with open TCP port to make its REST API accessible within your solution
  4. go to your server’s name with the corresponding TCP port and call it’s /model endpoint (see docs here: http://docs.deeppavlov.ai/en/master/integrations/rest_api.html), e.g., https://faq_skill:3000/model
  5. detailed info about the model’s params that you have to provide in REST api is accessible for each DP Library’s REST API at /docs endpoint, e.g., https://faq_skill:3000/docs
  6. in server.py of harvesters_maintenance_gobot_skill in skills folder you can replace calls to gobot to calls to your FAQ Model through its REST API available at, e.g., https://faq_skill:3000/model

Let me know if this makes sense to you. We’ll be happy to provide more examples!

Thank you so much for your quick and kind answer. I am currently attempting do as you have outlined. I will let you know of any successes for failures after the attempt :slight_smile:

Wish you best of luck, and don’t hesitate to ask more questions. We’re happy to help!

Hi Brandon!

We’ve built a small dist for Deepy that includes an FAQ skill. Here’s an conversation in the forum with the detailed instructions: