public String CognizeDebug(String query)
        {
            var startlightResponse = IntentClassificatorSingleton.Instance.Cognize(query);

            logger.LogDebug($"[{LogPrefix.Processing}]: Starlight returned the following object for the query {query}: {startlightResponse}");

            var utterance  = new Utterance(startlightResponse);
            var highIntent = utterance.Intents.First(i => i.Score == utterance.Intents.Max(i => i.Score));

            logger.LogInformation($"[{LogPrefix.Analysis}]: The intent with the highest score for the query {query} was {highIntent.Name}, with a score of {highIntent.Score}");

            utterance.Response = Response.ResponseController.SetResponse(utterance);

            if (highIntent.Score <= .80)
            {
                logger.LogWarning($"[{LogPrefix.Processing}]: Polaris AI was not able to understand the query {query}. Highest intent score: {highIntent.Score}");
            }

            if (highIntent.Score <= .50)
            {
                logger.LogWarning($"[{LogPrefix.Analysis}]: The intent with the highest score for query {query} scored lower than 50%. Intent score {highIntent.Score}");
            }

            return(utterance.GetDebugLog());
        }
Exemplo n.º 2
0
        public static String CognizeDebug(String query)
        {
            Utterance utterance = new Utterance(
                IntentClassificatorSingleton.Instance.Cognize(query));

            utterance.Response = Response.ResponseController.SetResponse(utterance);

            return(utterance.GetDebugLog());
        }
Exemplo n.º 3
0
        public static String CognizeDebug(String query)
        {
            Log.Logger.Debug($"DEBUG: CognizeDebug called with query: {query}");
            Utterance utterance = new Utterance(
                IntentClassificatorSingleton.Instance.Cognize(query));

            utterance.Response = Response.ResponseController.SetResponse(utterance);

            return(utterance.GetDebugLog());
        }
Exemplo n.º 4
0
        public static String CognizeDebug(String query)
        {
            var start = DateTime.Now;

            Log.Information("query is {query}", query);
            Utterance utterance = new Utterance(
                IntentClassificatorSingleton.Instance.Cognize(query));

            Log.Information("the utternece is a questions? : {utterance}", utterance.IsQuestion.ToString());
            utterance.Response = Response.ResponseController.SetResponse(utterance);
            Log.Information("Utterence responce is {response}", utterance.Response);
            var end = DateTime.Now;

            Log.Information("Time to get a responce from starlight is {time}", (end - start));
            return(utterance.GetDebugLog());
        }