We are using microsoft's QnAMaker service to build a FAQ bot. I would like to know if the api response has the answers sorted when there are multiple matches with different scores. Does the api return the answer with the top score first?
We tested it with a sample but wanted to make sure that there is no other factor playing a role here. Kindly let me know.
Thanks!
You can read about how QnA Maker processes a user query in the official docs:
Features used include but aren't limited to word-level semantics, term-level importance in a corpus, and deep learned semantic models to determine similarity and relevance between two text strings.
The Typescript SDK also specifies the following on the generateAnswer method:
Returns an array of answers sorted by score with the top scoring answer returned first.
You should also be aware that multiple resources are involved in the QnA Maker ranking process - Azure Cognitive Search and QnA Maker.
The Cognitive Search resource is used to store the QnA pairs and provide the initial ranking (ranker #1) of the QnA pairs at runtime.
The QnA Maker resource provides access to the authoring and publishing APIs as well as the natural language processing (NLP) based second ranking layer (ranker #2) of the QnA pairs at runtime.
The second ranking applies intelligent filters that can include metadata and follow-up prompts.