From e591a4965bbf7a13cc6cceb0dca6934b5a8eba7f Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 26 Sep 2018 20:55:21 -0500 Subject: [PATCH] Fix Spotify unit test path issue. --- BotSharp.Core.UnitTest/Performance/Spotify.cs | 2 +- BotSharp.Core.UnitTest/TestEssential.cs | 2 +- BotSharp.Core/Engines/BotPredictor.cs | 2 +- BotSharp.Core/Engines/BotTrainer.cs | 2 +- BotSharp.WebHost/Settings/bot.json | 11 ++--------- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/BotSharp.Core.UnitTest/Performance/Spotify.cs b/BotSharp.Core.UnitTest/Performance/Spotify.cs index e52a8f59..10b2f43b 100644 --- a/BotSharp.Core.UnitTest/Performance/Spotify.cs +++ b/BotSharp.Core.UnitTest/Performance/Spotify.cs @@ -73,7 +73,7 @@ namespace BotSharp.Core.UnitTest.Performance }, intent.Intent)); }); - //Samples.Shuffle(); + Samples.Shuffle(); var samples = String.Join("\r\n", Samples.Select(x => $"__label__{x.Item2} {x.Item1.Query[0]}").ToList()); diff --git a/BotSharp.Core.UnitTest/TestEssential.cs b/BotSharp.Core.UnitTest/TestEssential.cs index f6257b45..fae973f3 100644 --- a/BotSharp.Core.UnitTest/TestEssential.cs +++ b/BotSharp.Core.UnitTest/TestEssential.cs @@ -20,7 +20,7 @@ namespace BotSharp.Core.UnitTest contentRoot = $"{Directory.GetCurrentDirectory()}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}BotSharp.WebHost{Path.DirectorySeparatorChar}"; contentRoot = Path.GetFullPath(contentRoot); ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); - var settings = Directory.GetFiles(contentRoot + $"..{Path.DirectorySeparatorChar}Settings{Path.DirectorySeparatorChar}", "*.json"); + var settings = Directory.GetFiles(Path.Combine(contentRoot, "Settings"), "*.json"); settings.ToList().ForEach(setting => { configurationBuilder.AddJsonFile(setting, optional: false, reloadOnChange: true); diff --git a/BotSharp.Core/Engines/BotPredictor.cs b/BotSharp.Core/Engines/BotPredictor.cs index 3edbf28a..231939b0 100644 --- a/BotSharp.Core/Engines/BotPredictor.cs +++ b/BotSharp.Core/Engines/BotPredictor.cs @@ -57,7 +57,7 @@ namespace BotSharp.Core.Engines // pipe process - var pipelines = provider.Configuration.GetValue($"Pipe:predict") + var pipelines = provider.Configuration.GetValue($"Pipe") .Split(',') .Select(x => x.Trim()) .ToList(); diff --git a/BotSharp.Core/Engines/BotTrainer.cs b/BotSharp.Core/Engines/BotTrainer.cs index cb6f3f7b..8b9ada22 100644 --- a/BotSharp.Core/Engines/BotTrainer.cs +++ b/BotSharp.Core/Engines/BotTrainer.cs @@ -89,7 +89,7 @@ namespace BotSharp.Core.Engines }; // pipe process - var pipelines = provider.Configuration.GetValue($"Pipe:train") + var pipelines = provider.Configuration.GetValue($"pipe") .Split(',') .Select(x => x.Trim()) .ToList(); diff --git a/BotSharp.WebHost/Settings/bot.json b/BotSharp.WebHost/Settings/bot.json index 7ec9c497..34593523 100644 --- a/BotSharp.WebHost/Settings/bot.json +++ b/BotSharp.WebHost/Settings/bot.json @@ -6,21 +6,14 @@ "BotSharpProvider": { }, - "Pipe": { - "train": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier", - "predict": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier" - }, + "Pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier", "BotSharpTokenizer": { "tokenizer": "TreebankTokenizer" }, "BotSharpIntentClassifier": { - "classifer": "NaiveBayesClassifier" - }, - - "BotSharpSVMClassifier": { - "wordvec": "" + "classifer": "SVMClassifier" }, "BotSharpTagger": {