Search code examples
botframeworkazure-qna-maker

QnA Maker giving incorrect results to similar questions


I have built a chatbot that answers questions related to Sustainable Development Goals (SDGs) using QnA Maker service. As a part of that, the main functionality of the bot is to answer different SDGs like what is SDG 1, what is SDG 2.... what is SDG 17.

How can I get accurate predictions from QnA Maker in this scenario where the questions are so similar as currently, the QnA Maker is always returning the answer for what is SDG 1 when I ask questions like what is SDG 16, 15, 14, etc even though the knowledge base has exact same questions


Solution

  • The issue was resolved by using the parameter "Top" from QnAMakerOptions Class when calling the GetAnswersAsync method. I kept the value of the parameter "Top" to be 20.

    If there are very similar questions in a Knowledgebase, Azure Search does not return relevant QnA pairs in the default list of results. These results are re-ranked by the final QnA Maker ranker if the parameter "top" is used.