-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[QnA Maker] Support for IsTest and RankerType in GetAnswerAsync call …
…in QnAMaker (#1478)
- Loading branch information
Showing
6 changed files
with
112 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
libraries/botbuilder-ai/src/qnamaker-interfaces/rankerTypes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @module botbuilder-ai | ||
*/ | ||
/** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
/** | ||
* Enumeration of types of ranking. | ||
*/ | ||
export class RankerTypes { | ||
|
||
/** | ||
* Default Ranker Behaviour. i.e. Ranking based on Questions and Answer. | ||
*/ | ||
public static readonly default: string = 'Default'; | ||
|
||
/** | ||
* Ranker based on question Only. | ||
*/ | ||
public static readonly questionOnly: string = 'QuestionOnly'; | ||
|
||
/** | ||
* Ranker based on Autosuggest for question field Only. | ||
*/ | ||
public static readonly autoSuggestQuestion: string = 'AutoSuggestQuestion'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
libraries/botbuilder-ai/tests/TestData/QnAMaker/should_call_qnamaker_with_isTest_true.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"activeLearningEnabled": true, | ||
"answers": [ | ||
{ | ||
"questions": [], | ||
"answer": "No good match found in KB.", | ||
"score": 0, | ||
"id": -1, | ||
"source": null, | ||
"metadata": [] | ||
} | ||
] | ||
} |
35 changes: 35 additions & 0 deletions
35
...builder-ai/tests/TestData/QnAMaker/should_call_qnamaker_with_rankerType_questionOnly.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"activeLearningEnabled": false, | ||
"answers": [ | ||
{ | ||
"questions": [ | ||
"Q1" | ||
], | ||
"answer": "A1", | ||
"score": 80, | ||
"id": 15, | ||
"source": "Editorial", | ||
"metadata": [ | ||
{ | ||
"name": "topic", | ||
"value": "value" | ||
} | ||
] | ||
}, | ||
{ | ||
"questions": [ | ||
"Q2" | ||
], | ||
"answer": "A2", | ||
"score": 78, | ||
"id": 16, | ||
"source": "Editorial", | ||
"metadata": [ | ||
{ | ||
"name": "topic", | ||
"value": "value" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters