Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QnAMaker]Making Max and Min ScoreForLowScoreVariation Configurable #3841

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libraries/Microsoft.Bot.Builder.AI.QnA/Dialogs/QnAMakerDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ public QnAMakerDialog([CallerFilePath] string sourceFilePath = "", [CallerLineNu
[JsonProperty("rankerType")]
public StringExpression RankerType { get; set; } = new StringExpression(RankerTypes.DefaultRankerType);

/// <summary>
/// Gets or sets the Maximum Score For LowScoreVariation to use.
/// </summary>
/// <value>
/// Max score for LowScoreVariation.
/// </value>
/// <seealso cref="RankerTypes"/>
[JsonProperty("maximumScoreForLowScoreVariation")]
public float MaximumScoreForLowScoreVariation { get => maximumScoreForLowScoreVariation; set => maximumScoreForLowScoreVariation = value; }
vipeketi marked this conversation as resolved.
Show resolved Hide resolved
vipeketi marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

@tomlm tomlm Jun 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float [](start = 15, length = 5)

Make this
public NumberExpression MaximumScoreForLowScoreVariation {get; set;} = 0.95F;


/// <summary>
/// Called when the dialog is started and pushed onto the dialog stack.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
}
}
},
"maximumScoreForLowScoreVariation": {
"type": "float",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"type": "float", [](start = 9, length = 18)

 "$ref": "[https://raw.githubusercontent.com/microsoft/botframework-sdk/master/schemas/component/definitions.schema#/definitions/numberExpression](https://raw.githubusercontent.com/microsoft/botframework-sdk/master/schemas/component/definitions.schema#/definitions/numberExpression)",

"title": "maximumScoreForLowVariation",
"description": "Maximum score For Low Variation",
"default": 0.95
},
"top": {
"$ref": "https://raw.githubusercontent.com/microsoft/botframework-sdk/master/schemas/component/definitions.schema#/definitions/numberExpression",
"title": "Top",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ namespace Microsoft.Bot.Builder.AI.QnA
/// </summary>
public static class ActiveLearningUtils
{
/// <summary>
/// Minimum Score For Low Score Variation.
/// </summary>
private const double MinimumScoreForLowScoreVariation = 20.0;

/// <summary>
/// Previous Low Score Variation Multiplier.
/// </summary>
Expand All @@ -27,9 +22,18 @@ public static class ActiveLearningUtils
private const double MaxLowScoreVariationMultiplier = 1.0;

/// <summary>
/// Maximum Score For Low Score Variation.
/// Maximum Score For Low Variation.
/// </summary>
private const double MaximumScoreForLowScoreVariation = 95.0;
private static double maximumScoreForLowScoreVariation = 95.0;

/// <summary>
/// Minimum Score For Low Variation.
/// </summary>
private static double minimumScoreForLowScoreVariation = 20.0;

public static double MaximumScoreForLowScoreVariation { get => maximumScoreForLowScoreVariation; set => maximumScoreForLowScoreVariation = value; }

public static double MinimumScoreForLowScoreVariation { get => minimumScoreForLowScoreVariation; set => minimumScoreForLowScoreVariation = value; }
vipeketi marked this conversation as resolved.
Show resolved Hide resolved
vipeketi marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Returns list of qnaSearch results which have low score variation.
Expand Down