'How to deploy a Question Answering BERT Model as a chat bot on MS Teams

I have a Text2SQL model (EditSQL: https://github.com/ryanzhumich/editsql) which I have configured to take a sentence as input and return a SQL query as output.

Now, I want to deploy this program as a chat bot application in Microsoft Teams.

I understand there's Microsoft bot framework that enables publishing a bot and the 3 options are described here. https://docs.microsoft.com/en-us/learn/modules/choose-bot-building-tool/

However, I am not finding any of them suitable for my use case since I need to deploy a Question-Answering Bot where the Questions from users need to be sent to an external server like AWS and the response from AWS (could be an excel file) needs to be sent back to the user. Multiple questions can be the part of a conversation, so the chat client should be able to mark start and end of a conversation.

My problem:

  • What are the basic steps of exposing a ml model via a server so that it can be queried in production.
  • What are the tools that will allow me to make a client on Teams and a server for this model on AWS?

Please let me know if I should add more information on this.

Thanks



Solution 1:[1]

As you've seen, there are a bunch of tools/approaches to creating bots in the Microsoft world, for Teams or otherwise. Underneath, these all use the Bot Framework, but you can develop directly (i.e. write code), or use a higher-level tool like Bot Framework Composer - the choice is yours depending on your own internal skills. If you want to work with code directly, here are a bunch of bot samples, in multiple languages: https://github.com/microsoft/BotBuilder-Samples/tree/main/samples . For isntance, here is an example of integrating the Microsoft QnAMaker service into your bot: https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/python/49.qnamaker-all-features

Basically, if you go the development approach, your bot is just a web service. Once it receives the message, it can call out to any other service behind the scenes. That means it can receive a message, call out to an AWS service, receive the response, and send a reply to the user.

For multiple questions as part of a 'set' of chats, Bot Framework provides an idea called "dialogs" that should work for you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hilton Giesenow