Ejemplo n.º 1
0
        /// <inheritdoc/>
        public INLUTrainClient CreateTrainInstance(IConfiguration configuration, string settingsPath)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            var luisConfiguration = new LuisConfiguration(configuration);
            var luisTemplate      = settingsPath != null
                ? JObject.Parse(File.ReadAllText(settingsPath)).ToObject <LuisApp>()
                : new LuisApp();

            var luisClient = new LuisTrainClient(luisConfiguration);

            return(new LuisNLUTrainClient(
                       luisConfiguration,
                       luisTemplate,
                       luisClient));
        }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public INLUTrainClient CreateTrainInstance(IConfiguration configuration, string settingsPath)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            var luisConfiguration = new LuisConfiguration(configuration);
            var luisSettings      = settingsPath != null
                ? JsonConvert.DeserializeObject <LuisSettings>(File.ReadAllText(settingsPath))
                : new LuisSettings();

            var luisClient = new LuisTrainClient(luisConfiguration);

            return(new LuisNLUTrainClient(
                       luisConfiguration,
                       luisSettings,
                       luisClient));
        }