示例#1
0
        public void ParseLuisIntentTestsShouldReturnEmptyObject()
        {
            // act
            IntentWithScore intentWithScore = luisBusinessLogic.ParseLuisIntent(emptyLuisResponse);

            //assert
            Assert.Null(intentWithScore.TopScoringIntent);
        }
示例#2
0
        public void ParseLuisIntentTestsShouldReturnNoneIntent()
        {
            // act
            IntentWithScore intentWithScore = luisBusinessLogic.ParseLuisIntent(noneLuisResponse);

            //assert
            Assert.Equal(expectedLuisNoneIntent, intentWithScore.TopScoringIntent);
        }
示例#3
0
        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);
        }
示例#4
0
 public IEnumerable <string> FilterLuisIntents(IntentWithScore intentWithScore)
 {
     throw new NotImplementedException();
 }
 public bool IsIntentAccurate(IntentWithScore intentWithScore)
 {
     return(intentWithScore.Score >= luisSettings.IntentAccuracyThreshold && intentWithScore.TopScoringIntent.ToUpperInvariant() != "NONE");
 }