public void ParseLuisIntentTestsShouldReturnEmptyObject() { // act IntentWithScore intentWithScore = luisBusinessLogic.ParseLuisIntent(emptyLuisResponse); //assert Assert.Null(intentWithScore.TopScoringIntent); }
public void ParseLuisIntentTestsShouldReturnNoneIntent() { // act IntentWithScore intentWithScore = luisBusinessLogic.ParseLuisIntent(noneLuisResponse); //assert Assert.Equal(expectedLuisNoneIntent, intentWithScore.TopScoringIntent); }
public void ApplyThresholdTestsShouldMatchUpperthreshold() { // arrange List <string> topNIntents = new List <string> { "Eviction", "child abuse", "traffic ticket", "divorce" }; IntentWithScore intentWithScore = new IntentWithScore { IsSuccessful = true, Score = 0.1M, TopScoringIntent = "Eviction", TopNIntents = topNIntents }; var expectedhreshold = true; //act var threshold = luisBusinessLogic.IsIntentAccurate(intentWithScore); //assert Assert.Equal(expectedhreshold, threshold); }
public IEnumerable <string> FilterLuisIntents(IntentWithScore intentWithScore) { throw new NotImplementedException(); }
public bool IsIntentAccurate(IntentWithScore intentWithScore) { return(intentWithScore.Score >= luisSettings.IntentAccuracyThreshold && intentWithScore.TopScoringIntent.ToUpperInvariant() != "NONE"); }