How can I pre-filter answers from user input?

NShini 51 Reputation points
2021-08-05T21:32:09.12+00:00

Hi,
I am currently developing a chatbot using QnA Maker. I am using the multi-turn feature by uploading an excel file with all the required questions, answers and other necessary details.

My premise is as follows:

  • I have a list of tools, their descriptions and in which category the tools fall into.
  • The bot is supposed to guide the user towards a tool according to the description they give.
  • The description of the tool are the questions and the tool name is the answer in the KB.
  • The tools are divided into different categories. For instance, say we have Category 1, Category 2 & Category 3 and Tool A, Tool B, Tool C & Tool D.
  • Category 1 contains Tool A & Tool C
  • Category 2 contains Tool B & Tool C
  • Category 3 contains Tool A, Tool C & Tool D
  • The user is first presented with a choice of categories in the form of buttons and I want to be able to pre filter the answers accordingly.
  • Therefore, if a user chooses Category 1, the bot is supposed to limit the search to only Tools A & C

Is there a way to achieve this in QnA Maker or maybe add the categories in the excel?

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
760 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,459 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 42,966 Reputation points Microsoft Employee
    2021-08-06T08:16:57.857+00:00

    @NShini As a initial thought I could see this possible using the metadata tags on answers in your KB. This should help filter answers based on the tags i.e key value pair. For example:

    Pair                                  Question                         Answer                            Metadata  
    1                          I want to drill a hole                  Power Drill                        Category: 1  
                               I want to tighten a screw                                                  Category: 1  
      
    2                          I want to smoothen surface              File                               Category: 2  
    

    The documentation should help you get a better idea of its usage.
    Since QnAMaker helps you to deploy a bot automatically after publish you would need to test the same directly from the portal to check if your KB is working as expected. That is, check if all the required answers are returned and then you can filter the metadata in the response in your client app or bot later.