Exemple #1
0
        public MockVehicleSettingsValueIntent(string userInput)
        {
            if (string.IsNullOrEmpty(userInput))
            {
                throw new ArgumentNullException(nameof(userInput));
            }

            this.Entities = new VehicleSettingsValueSelectionLuis._Entities();
            this.Intents  = new Dictionary <Intent, IntentScore>();

            var intentScore = new Microsoft.Bot.Builder.IntentScore();

            intentScore.Score      = 0.9909704;
            intentScore.Properties = new Dictionary <string, object>();

            this.Intents.Add(VehicleSettingsValueSelectionLuis.Intent.SETTING_VALUE_SELECTION, intentScore);

            switch (userInput.ToLower())
            {
            case "second one":
                this.Entities.INDEX = new string[] { "second" };
                break;

            case "braking and alerts":
            case "decrease":
            case "increase":
            case "steer":
                this.Entities.VALUE = new string[] { userInput.ToLower() };
                break;
            }

            (intent, score) = this.TopIntent();
        }
        private (Intent intent, double score) ProcessUserInput()
        {
            var intentScore = new Microsoft.Bot.Builder.IntentScore();

            intentScore.Score      = 0.9909704;
            intentScore.Properties = new Dictionary <string, object>();

            switch (UserInput.ToLower())
            {
            case "what's nearby?":
                this.Intents.Add(Intent.NAVIGATION_FIND_POINTOFINTEREST, intentScore);
                break;

            case "cancel my route":
                this.Intents.Add(Intent.NAVIGATION_CANCEL_ROUTE, intentScore);
                break;

            case "find a route":
                this.Intents.Add(Intent.NAVIGATION_ROUTE_FROM_X_TO_Y, intentScore);
                break;

            case "get directions to microsoft corporation":
                this.Entities.KEYWORD = new string[] { "microsoft corporation" };
                this.Intents.Add(Intent.NAVIGATION_ROUTE_FROM_X_TO_Y, intentScore);
                break;

            case "get directions to the pharmacy":
                this.Entities.KEYWORD = new string[] { "pharmacy" };
                this.Intents.Add(Intent.NAVIGATION_ROUTE_FROM_X_TO_Y, intentScore);
                break;

            case "find a parking garage":
                this.Intents.Add(Intent.NAVIGATION_FIND_PARKING, intentScore);
                break;

            case "find a parking garage near 1635 11th ave":
                this.Entities.KEYWORD = new string[] { "1635 11th ave" };
                this.Intents.Add(Intent.NAVIGATION_FIND_PARKING, intentScore);
                break;

            case "option 1":
                this.Intents.Add(Intent.NAVIGATION_ROUTE_FROM_X_TO_Y, intentScore);
                this.Entities.number = new double[] { 1 };
                break;

            default:
                return(Intent.None, 0.0);
            }

            return(this.TopIntent());
        }
Exemple #3
0
        public MockVehicleSettingsValueIntent(string userInput)
        {
            if (string.IsNullOrEmpty(userInput))
            {
                throw new ArgumentNullException(nameof(userInput));
            }

            this.Entities = new VehicleSettingsValueSelection._Entities();
            this.Intents  = new Dictionary <Intent, IntentScore>();

            var intentScore = new Microsoft.Bot.Builder.IntentScore();

            intentScore.Score      = 0.9909704;
            intentScore.Properties = new Dictionary <string, object>();

            // This LUIS model is for followup setting clarification so we assume input for test purposes is the setting name
            this.Intents.Add(VehicleSettingsValueSelection.Intent.SETTING_VALUE_SELECTION, intentScore);
            this.Entities.VALUE = new string[] { userInput.ToLower() };

            (intent, score) = this.TopIntent();
        }
        public MockVehicleSettingsNameIntent(string userInput)
        {
            if (string.IsNullOrEmpty(userInput))
            {
                throw new ArgumentNullException(nameof(userInput));
            }

            this.Entities = new VehicleSettingsNameSelection._Entities();
            this.Intents  = new Dictionary <Intent, IntentScore>();

            this.userInput = userInput;

            var intentScore = new Microsoft.Bot.Builder.IntentScore();

            intentScore.Score      = 0.9909704;
            intentScore.Properties = new Dictionary <string, object>();

            this.Intents.Add(VehicleSettingsNameSelection.Intent.SETTING_NAME_SELECTION, intentScore);

            switch (userInput.ToLower())
            {
            case "first one":
                this.Entities.INDEX = new string[] { "first" };
                break;

            case "alerts for people in the back":
                this.Entities.SETTING = new string[] { "alerts", "people", "back" };
                break;

            case "equalizer (bass)":
            case "front":
            case "front combined air delivery mode control":
                this.Entities.SETTING = new string[] { userInput.ToLower() };
                break;
            }

            (intent, score) = this.TopIntent();
        }
Exemple #5
0
        private (Intent intent, double score) ProcessUserInput()
        {
            var intentScore = new Microsoft.Bot.Builder.IntentScore
            {
                Score      = 0.9909704,
                Properties = new Dictionary <string, object>()
            };

            switch (UserInput.ToLower())
            {
            case "set temperature to 21 degrees":
                Entities.SETTING = new string[] { "temperature" };
                Entities.AMOUNT  = new string[] { "21" };
                Entities.UNIT    = new string[] { "degrees" };
                break;

            case "increase temperature by 2":
                Entities.VALUE   = new string[] { "increase" };
                Entities.SETTING = new string[] { "temperature" };
                Entities.TYPE    = new string[] { "by" };
                Entities.AMOUNT  = new string[] { "2" };
                break;

            case "increase temperature to 24":
                Entities.VALUE   = new string[] { "increase" };
                Entities.SETTING = new string[] { "temperature" };
                Entities.AMOUNT  = new string[] { "24" };
                break;

            case "change the temperature":
                Entities.SETTING = new string[] { "temperature" };
                break;

            case "turn lane assist off":
                Entities.SETTING = new string[] { "lane assist" };
                Entities.VALUE   = new string[] { "off" };
                break;

            case "warm up the back of the car":
                Entities.SETTING = new string[] { "back" };
                Entities.VALUE   = new string[] { "warm up" };
                break;

            case "defog my windshield":
                Entities.VALUE = new string[] { "defog" };
                break;

            case "put the air on my feet":
                Entities.SETTING = new string[] { "air" };
                Entities.VALUE   = new string[] { "feet" };
                break;

            case "turn off the ac":
                Entities.SETTING = new string[] { "ac" };
                Entities.VALUE   = new string[] { "off" };
                break;

            case "increase forward automatic braking to 50%":
                Entities.SETTING = new string[] { "forward automatic braking" };
                Entities.VALUE   = new string[] { "increase" };
                Entities.AMOUNT  = new string[] { "50" };
                Entities.UNIT    = new string[] { "%" };
                break;

            case "i'm feeling cold":
                Entities.VALUE = new string[] { "cold" };
                Intents.Add(Intent.VEHICLE_SETTINGS_DECLARATIVE, intentScore);
                break;

            case "it's feeling cold in the back":
                Entities.SETTING = new string[] { "back" };
                Entities.VALUE   = new string[] { "cold" };
                Intents.Add(Intent.VEHICLE_SETTINGS_DECLARATIVE, intentScore);
                break;

            case "adjust equalizer":
                Entities.SETTING = new string[] { "equalizer" };
                break;

            case "change pedestrian detection":
                Entities.SETTING = new string[] { "pedestrian detection" };
                break;

            default:
                return(Intent.None, 0.0);
            }

            // Default is setting change apart from declarative used occasionally above
            if (Intents.Count == 0)
            {
                Intents.Add(Intent.VEHICLE_SETTINGS_CHANGE, intentScore);
            }

            return(TopIntent());
        }