Exemplo n.º 1
0
        private static string ConvertToHint(EntityRecognizer recognizer)
        {
            var entityList = new List <string>();

            foreach (var item in recognizer.Entries)
            {
                //Avoid giving synonyms in Hints.
                if (string.IsNullOrEmpty(item.Reference))
                {
                    entityList.Add(item.Value);
                }
            }

            return(string.Join("|", entityList));
        }
Exemplo n.º 2
0
        public async Task TestTelemetryDoesNotLogByDefault()
        {
            var telemetryClient = new Mock <IBotTelemetryClient>();
            var recognizer      = new EntityRecognizer()
            {
                TelemetryClient = telemetryClient.Object
            };
            var dialogContext = GetDialogContext(nameof(TestTelemetryDoesNotLogByDefault), "gobble gobble");

            var(logPersonalInformation, _) = recognizer.LogPersonalInformation.TryGetValue(dialogContext.State);
            Assert.False(logPersonalInformation);

            var result = await recognizer.RecognizeAsync(dialogContext, dialogContext.Context.Activity, CancellationToken.None);

            Assert.NotNull(result);
            Assert.Empty(result.Intents);
            Assert.Empty(result.Entities);
            Assert.Equal(0, telemetryClient.Invocations.Count);
        }
Exemplo n.º 3
0
 public IndexModel(AppDbContext db)
 {
     _db = db;
     _entityRecognizer = new EntityRecognizer(db);
 }