Since you haven't specified a language, my answer refers to the C# SDK, but the concepts should be transferable to the other SDKs.
I believe you might be able to achieve the functionality that you want in a roundabout and somewhat manual way:
- In the QnA Maker Portal add a metadata property to the questions you'd like to disambiguate, it could have the key
disambiguation-question
and the value would be the question you'd like to use for disambiguation. An example is provided here. e.g. disambiguation-question
: My question that I want to use to disambiguate
.
- Save, Train, and Publish your Knowledge base.
- Update your code to filter on the
Metadata
property of the QueryResult
class, which contains an array of Metadata
objects. TheGetAnswersAsyncmethod which is how you query your QnA Maker endpoint, will return an array of
QueryResult` objects.
- Use the
Value
from the Metadata object to display in your card for disambiguation. There is an example of how to do this here.
There is also an overview of how the QnA Maker ranking system for answers works available here, currently it works as follows:
| Step | Purpose |
|
| 1 | The client application sends the user query to the GenerateAnswer API |
| 2 | QnA Maker preprocesses the user query with language detection, spellers, and word breakers. |
| 3 | This preprocessing is taken to alter the user query for the best search results. |
| 4 | This altered query is sent to an Azure Cognitive Search Index, which receives the top number of results. If the correct answer isn't in these results, increase the value of top slightly. Generally, a value of 10 for top works in 90% of queries. |
| 5 | QnA Maker uses syntactic and semantic based featurization to determine the similarity between the user query and the fetched QnA results. |
| 6 | The machine-learned ranker model uses the different features, from step 5, to determine the confidence scores and the new ranking order. |
| 7 | The new results are returned to the client application in ranked order. |
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.
I hope this helps.