Esempio n. 1
0
        public void ParseLuisIntentTestsShouldReturnEmptyObject()
        {
            // act
            IntentWithScore intentWithScore = luisBusinessLogic.ParseLuisIntent(emptyLuisResponse);

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

            //assert
            Assert.Equal(expectedLuisNoneIntent, intentWithScore.TopScoringIntent);
        }
Esempio n. 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);
        }
Esempio n. 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");
 }