diff --git a/.gitignore b/.gitignore index 585f8689..f0892edc 100644 --- a/.gitignore +++ b/.gitignore @@ -290,3 +290,4 @@ __pycache__/ /Data /docs/_build *.RestApi.xml +/BotSharp.WebHost/App_Data/AgentStorage diff --git a/BotSharp.Core/AgentStorage/AgentStorageInFile.cs b/BotSharp.Core/AgentStorage/AgentStorageInFile.cs new file mode 100644 index 00000000..a930be30 --- /dev/null +++ b/BotSharp.Core/AgentStorage/AgentStorageInFile.cs @@ -0,0 +1,115 @@ +using BotSharp.Platform.Abstraction; +using BotSharp.Platform.Models; +using CSRedis; +using Microsoft.Extensions.Configuration; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BotSharp.Core.AgentStorage +{ + public class AgentStorageInFile : IAgentStorage + where TAgent : AgentBase + { + private static CSRedisClient csredis; + private static string prefix = String.Empty; + + private static string storageDir; + + public AgentStorageInFile() + { + IConfiguration config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); + var db = config.GetSection("Database:Default").Value; + storageDir = config.GetSection($"Database:ConnectionStrings:{db}").Value; + string contentDir = AppDomain.CurrentDomain.GetData("DataPath").ToString(); + storageDir = storageDir.Replace("|DataDirectory|", contentDir + Path.DirectorySeparatorChar); + + if (!Directory.Exists(storageDir)) + { + Directory.CreateDirectory(storageDir); + } + } + + public async Task FetchById(string agentId) + { + string dataPath = Path.Combine(storageDir, agentId + ".json"); + if (File.Exists(dataPath)) + { + string json = File.ReadAllText(dataPath); + return JsonConvert.DeserializeObject(json); + } + else + { + return default(TAgent); + } + } + + public async Task FetchByName(string agentName) + { + var files = Directory.GetFiles(storageDir); + for (int i = 0; i < files.Length; i++) + { + var file = files[i]; + string json = File.ReadAllText(file); + var agent = JsonConvert.DeserializeObject(json); + if (agent.Name.ToLower() == agentName.ToLower()) + { + return agent; + } + } + + return default(TAgent); + } + + public async Task Persist(TAgent agent) + { + if (String.IsNullOrEmpty(agent.Id)) + { + agent.Id = Guid.NewGuid().ToString(); + } + + var json = JsonConvert.SerializeObject(agent, new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + Formatting = Formatting.Indented, + }); + + string dataPath = Path.Combine(storageDir, agent.Id + ".json"); + + File.WriteAllText(dataPath, json); + + return true; + } + + public async Task PurgeAllAgents() + { + var files = Directory.GetFiles(storageDir); + for (int i = 0; i < files.Length; i++) + { + File.Delete(files[i]); + } + + return files.Length; + } + + public async Task> Query() + { + var agents = new List(); + + var files = Directory.GetFiles(storageDir); + for (int i = 0; i < files.Length; i++) + { + var file = files[i]; + string json = File.ReadAllText(file); + var agent = JsonConvert.DeserializeObject(json); + agents.Add(agent); + } + + return agents; + } + } +} diff --git a/BotSharp.Core/AgentStorage/AgentStorageInRedis.cs b/BotSharp.Core/AgentStorage/AgentStorageInRedis.cs index dc7ee711..7fb03532 100644 --- a/BotSharp.Core/AgentStorage/AgentStorageInRedis.cs +++ b/BotSharp.Core/AgentStorage/AgentStorageInRedis.cs @@ -85,7 +85,7 @@ namespace BotSharp.Core.AgentStorage { var keys = csredis.Keys($"{prefix}*"); - csredis.Remove(keys.Select(x => x.Substring(prefix.Length)).ToArray()); + csredis.Del(keys.Select(x => x.Substring(prefix.Length)).ToArray()); return keys.Count(); } diff --git a/BotSharp.Core/AgentStorage/AgentStorageServiceRegister.cs b/BotSharp.Core/AgentStorage/AgentStorageServiceRegister.cs index 535bb2d1..3c8f30c7 100644 --- a/BotSharp.Core/AgentStorage/AgentStorageServiceRegister.cs +++ b/BotSharp.Core/AgentStorage/AgentStorageServiceRegister.cs @@ -17,6 +17,7 @@ namespace BotSharp.Core.AgentStorage services.AddSingleton>(); services.AddSingleton>(); + services.AddSingleton>(); services.AddSingleton(factory => { @@ -30,6 +31,10 @@ namespace BotSharp.Core.AgentStorage { return factory.GetService>(); } + else if (key.Equals("AgentStorageInFile")) + { + return factory.GetService>(); + } else { throw new ArgumentException($"Not Support key : {key}"); diff --git a/BotSharp.Core/BotSharp.Core.csproj b/BotSharp.Core/BotSharp.Core.csproj index 63225fc6..127c3644 100644 --- a/BotSharp.Core/BotSharp.Core.csproj +++ b/BotSharp.Core/BotSharp.Core.csproj @@ -20,14 +20,14 @@ If you feel that this project is helpful to you, please Star on the project, we will be very grateful. MIT https://github.com/Oceania2018/BotSharp - NLU, Chatbot, Bot, AI Bot, Artificial Intelligence, RPA - 1.6.0 + NLU, Chatbot, Bot, AI Bot, Artificial Intelligence + 1.7.2 Monthly Update. -Integrated with Articulate UI. +Integrated with Tencent Wechat. If you feel that this project is helpful to you, please Star on the project, we will be very grateful. Since 2018 Haiping Chen https://github.com/Oceania2018/BotSharp - 1.6.0.0 + 1.7.2.0 https://raw.githubusercontent.com/Oceania2018/BotSharp/master/BotSharp.WebHost/wwwroot/images/BotSharp.png https://github.com/Oceania2018/BotSharp/blob/master/LICENSE @@ -75,7 +75,7 @@ If you feel that this project is helpful to you, please Star on the project, we - + diff --git a/BotSharp.Core/Engines/BotPredictor.cs b/BotSharp.Core/Engines/BotPredictor.cs index f4a29339..ec9c6f7d 100644 --- a/BotSharp.Core/Engines/BotPredictor.cs +++ b/BotSharp.Core/Engines/BotPredictor.cs @@ -72,13 +72,13 @@ namespace BotSharp.Core.Engines await pipe.Predict(agent, data, pipeModel); } - Console.WriteLine($"Prediction result:", Color.Green); + /*Console.WriteLine($"Prediction result:", Color.Green); Console.WriteLine(JsonConvert.SerializeObject(data, new JsonSerializerSettings { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore, ContractResolver = new CamelCasePropertyNamesContractResolver() - })); + }));*/ return data; } diff --git a/BotSharp.Core/Engines/BotSharp/BotSharpIntentClassifier.cs b/BotSharp.Core/Engines/BotSharp/BotSharpIntentClassifier.cs index 4c83f663..3b4caf5a 100644 --- a/BotSharp.Core/Engines/BotSharp/BotSharpIntentClassifier.cs +++ b/BotSharp.Core/Engines/BotSharp/BotSharpIntentClassifier.cs @@ -56,7 +56,7 @@ namespace BotSharp.Core.Engines.BotSharp { Classifier = "BotSharpIntentClassifier", Label = result.First().Item1, - Confidence = (decimal)result.First().Item2 + Confidence = result.First().Item2 }; return true; diff --git a/BotSharp.Core/Engines/TextClassificationResult.cs b/BotSharp.Core/Engines/TextClassificationResult.cs index 2da49b71..a415ec83 100644 --- a/BotSharp.Core/Engines/TextClassificationResult.cs +++ b/BotSharp.Core/Engines/TextClassificationResult.cs @@ -10,6 +10,6 @@ namespace BotSharp.Core.Engines public String Label { get; set; } - public Decimal Confidence { get; set; } + public double Confidence { get; set; } } } diff --git a/BotSharp.Core/Modules/ModuleOptions.cs b/BotSharp.Core/Modules/ModuleOptions.cs index ef9b1587..a043f1d9 100644 --- a/BotSharp.Core/Modules/ModuleOptions.cs +++ b/BotSharp.Core/Modules/ModuleOptions.cs @@ -9,6 +9,11 @@ namespace BotSharp.Core.Modules /// public class ModuleOptions { + public ModuleOptions() + { + Path = String.Empty; + } + /// /// Module name /// diff --git a/BotSharp.Core/Modules/ModulesOptions.cs b/BotSharp.Core/Modules/ModulesOptions.cs index bb92f94c..3748e504 100644 --- a/BotSharp.Core/Modules/ModulesOptions.cs +++ b/BotSharp.Core/Modules/ModulesOptions.cs @@ -9,10 +9,10 @@ namespace BotSharp.Core.Modules /// public class ModulesOptions { - /// - /// Module base directory - /// - public String ModuleBasePath { get; set; } + public ModulesOptions() + { + Modules = new List(); + } /// /// List of module configurations. diff --git a/BotSharp.Core/Modules/ModulesStartup.cs b/BotSharp.Core/Modules/ModulesStartup.cs index 3dbae39c..16ccc2e6 100644 --- a/BotSharp.Core/Modules/ModulesStartup.cs +++ b/BotSharp.Core/Modules/ModulesStartup.cs @@ -32,6 +32,11 @@ namespace BotSharp.Core.Modules throw new ArgumentNullException(nameof(configuration)); ModulesOptions options = configuration.Get(); + if (options.Modules.Count == 0) + { + Console.WriteLine($"Platform emulator not found.", Color.Red); + } + this._modules = options.Modules .Select(s => { @@ -48,6 +53,7 @@ namespace BotSharp.Core.Modules else { IModule module = (IModule)Activator.CreateInstance(type); + Console.WriteLine($"Loaded module \"{s.Type}\"", Color.Green); return module; } } @@ -82,6 +88,7 @@ namespace BotSharp.Core.Modules { foreach (IModule module in this._modules) { + if (module == null) continue; module.Configure(app, env); } } diff --git a/BotSharp.Core/Modules/PlatformModuleAssembyLoader.cs b/BotSharp.Core/Modules/PlatformModuleAssembyLoader.cs index 3ab13098..5c390dab 100644 --- a/BotSharp.Core/Modules/PlatformModuleAssembyLoader.cs +++ b/BotSharp.Core/Modules/PlatformModuleAssembyLoader.cs @@ -22,8 +22,11 @@ namespace Microsoft.Extensions.DependencyInjection Console.WriteLine(); options.Modules.ForEach(module => { - - var dllPath = Path.Combine(options.ModuleBasePath, module.Path, $"{module.Type}.dll"); + if (String.IsNullOrEmpty(module.Path)) + { + module.Path = AppContext.BaseDirectory; + } + var dllPath = Path.Combine(module.Path, $"{module.Type}.dll"); if (File.Exists(dllPath)) { Assembly library = AssemblyLoadContext.Default.LoadFromAssemblyPath(dllPath); @@ -36,15 +39,14 @@ namespace Microsoft.Extensions.DependencyInjection new Formatter(dllPath, Color.Yellow) }; Console.WriteLineFormatted("Loaded {0} module, type: {1}, path: {2}", Color.White, settings); + Console.WriteLine(); } else { - Console.WriteLine($"Can't load {module.Type} assembly from {dllPath}."); + Console.WriteFormatted($"Can't load {module.Type} assembly from {dllPath}.", Color.Red); + Console.WriteLine(); } - }); - - Console.WriteLine(); } } } diff --git a/BotSharp.Core/PlatformBuilderBase.cs b/BotSharp.Core/PlatformBuilderBase.cs index 1d991f6a..334f8c2b 100644 --- a/BotSharp.Core/PlatformBuilderBase.cs +++ b/BotSharp.Core/PlatformBuilderBase.cs @@ -36,6 +36,8 @@ namespace BotSharp.Core public async Task LoadAgentFromFile(string dataDir) where TImporter : IAgentImporter, new() { + Console.WriteLine($"Loading agent from folder {dataDir}"); + var meta = LoadMeta(dataDir); var importer = new TImporter { @@ -54,6 +56,8 @@ namespace BotSharp.Core // Load system buildin entities await importer.LoadBuildinEntities(agent); + Console.WriteLine($"Loaded agent: {agent.Name} {agent.Id}"); + return agent; } diff --git a/BotSharp.Core/PlatformSettingsBase.cs b/BotSharp.Core/PlatformSettingsBase.cs index a2d00268..5eeebd92 100644 --- a/BotSharp.Core/PlatformSettingsBase.cs +++ b/BotSharp.Core/PlatformSettingsBase.cs @@ -15,7 +15,7 @@ namespace BotSharp.Core public PlatformSettingsBase() { BotEngine = "BotSharpNLU"; - AgentStorage = "AgentStorageInMemory"; + AgentStorage = "AgentStorageInFile"; } public string BotEngine { get; set; } diff --git a/BotSharp.NLP/BotSharp.NLP.csproj b/BotSharp.NLP/BotSharp.NLP.csproj index b2c4c12f..99ce811d 100644 --- a/BotSharp.NLP/BotSharp.NLP.csproj +++ b/BotSharp.NLP/BotSharp.NLP.csproj @@ -4,7 +4,7 @@ netstandard2.0 AnyCPU;x64 true - 0.4.0 + 0.5.0 Botsharp.NLP is a set of tools for building C# programs to work with human language data. It can be used in common tasks like POS, NER and text classification in the NLP or NLU field. BotSharp.NLP has implemented below machine learning algorithms: @@ -42,12 +42,13 @@ Naive Bayes Classifier false + + DEBUG;TRACE + + + - - - - diff --git a/BotSharp.NLP/Classify/SVMClassifier.cs b/BotSharp.NLP/Classify/SVMClassifier.cs index 9c5d8220..330a006a 100644 --- a/BotSharp.NLP/Classify/SVMClassifier.cs +++ b/BotSharp.NLP/Classify/SVMClassifier.cs @@ -131,8 +131,8 @@ namespace BotSharp.NLP.Classify public List GetData(List sentences, ClassifyOptions options) { - //var extractor = new CountFeatureExtractor(); - var extractor = new Word2VecFeatureExtractor(); + var extractor = new CountFeatureExtractor(); + //var extractor = new Word2VecFeatureExtractor(); extractor.ModelFile = options.Word2VecFilePath; extractor.Sentences = sentences; if(features != null) diff --git a/BotSharp.NLP/Tokenize/Token.cs b/BotSharp.NLP/Tokenize/Token.cs index 4013fe52..f19ef2ee 100644 --- a/BotSharp.NLP/Tokenize/Token.cs +++ b/BotSharp.NLP/Tokenize/Token.cs @@ -46,7 +46,7 @@ namespace BotSharp.NLP.Tokenize { get { - return Regex.IsMatch(Text, @"^[a-zA-Z]+$"); + return Regex.IsMatch(Text, @"^[a-zA-Z]+|[\u4e00-\u9fa5]+$"); } } diff --git a/BotSharp.Platform.Abstraction/BotSharp.Platform.Abstraction.csproj b/BotSharp.Platform.Abstraction/BotSharp.Platform.Abstraction.csproj index 58913343..1766d5fd 100644 --- a/BotSharp.Platform.Abstraction/BotSharp.Platform.Abstraction.csproj +++ b/BotSharp.Platform.Abstraction/BotSharp.Platform.Abstraction.csproj @@ -3,7 +3,8 @@ netstandard2.0 true - 0.1.0 + 0.2.0 + https://github.com/Oceania2018/BotSharp diff --git a/BotSharp.Platform.Abstraction/IPlatformBuilder.cs b/BotSharp.Platform.Abstraction/IPlatformBuilder.cs index f9f7cb9e..0a58b276 100644 --- a/BotSharp.Platform.Abstraction/IPlatformBuilder.cs +++ b/BotSharp.Platform.Abstraction/IPlatformBuilder.cs @@ -47,6 +47,6 @@ namespace BotSharp.Platform.Abstraction Task Train(TAgent agent, TrainingCorpus corpus, BotTrainOptions options); - Task TextRequest(AiRequest request); + Task TextRequest(AiRequest request); } } diff --git a/BotSharp.Platform.Models/BotSharp.Platform.Models.csproj b/BotSharp.Platform.Models/BotSharp.Platform.Models.csproj index 715df064..c940c0e2 100644 --- a/BotSharp.Platform.Models/BotSharp.Platform.Models.csproj +++ b/BotSharp.Platform.Models/BotSharp.Platform.Models.csproj @@ -3,7 +3,8 @@ netstandard2.0 true - 0.1.0 + 0.2.0 + https://github.com/Oceania2018/BotSharp diff --git a/BotSharp.Platform.Models/MachineLearning/AgentMlConfig.cs b/BotSharp.Platform.Models/MachineLearning/AgentMlConfig.cs index 13ab2740..9e3900a9 100644 --- a/BotSharp.Platform.Models/MachineLearning/AgentMlConfig.cs +++ b/BotSharp.Platform.Models/MachineLearning/AgentMlConfig.cs @@ -13,7 +13,7 @@ namespace BotSharp.Platform.Models.MachineLearning public String AgentId { get; set; } [Required] - public decimal MinConfidence { get; set; } + public double MinConfidence { get; set; } [Required] [MaxLength(64)] diff --git a/BotSharp.WebHost/BotSharp.WebHost.csproj b/BotSharp.WebHost/BotSharp.WebHost.csproj index aa577598..a145174e 100644 --- a/BotSharp.WebHost/BotSharp.WebHost.csproj +++ b/BotSharp.WebHost/BotSharp.WebHost.csproj @@ -30,11 +30,13 @@ + + @@ -42,11 +44,13 @@ + + @@ -87,6 +91,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/BotSharp.WebHost/Settings/BotSharpNLU.json b/BotSharp.WebHost/Settings/BotSharpNLU.json index e40068cf..ba0c4bca 100644 --- a/BotSharp.WebHost/Settings/BotSharpNLU.json +++ b/BotSharp.WebHost/Settings/BotSharpNLU.json @@ -10,7 +10,7 @@ "pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier", "botSharpTokenizer": { - "tokenizer": "TreebankTokenizer" + "tokenizer": "JiebaTokenizer" }, "botSharpIntentClassifier": { @@ -19,18 +19,11 @@ }, "botSharpTagger": { - "tagger": "NGramTagger" + "tagger": "JiebaTagger" }, "botSharpCRFNer": { "template": "|App_Data|CRFLite/template.en" - }, - - "witAiEntityRecognizer": { - "url": "https://api.wit.ai", - "resource": "message", - "serverAccessToken": "SERVER_ACCESS_TOKEN", - "version": "20180811" } } } diff --git a/BotSharp.WebHost/Settings/DialogflowAi.json b/BotSharp.WebHost/Settings/DialogflowAi.json index dba3a169..062c51ce 100644 --- a/BotSharp.WebHost/Settings/DialogflowAi.json +++ b/BotSharp.WebHost/Settings/DialogflowAi.json @@ -1,7 +1,7 @@ { // if you want to override platform setting, please set corresponding value, otherwise you don't need this section. - "dialogflowAi": { - "botEngine": "BotSharpNLU", - "agentStorage": "AgentStorageInMemory" - } + "dialogflowAi": { + "botEngine": "BotSharpNLU", + "agentStorage": "AgentStorageInFile" + } } diff --git a/BotSharp.WebHost/Settings/app.json b/BotSharp.WebHost/Settings/app.json index 29d958c8..c79a99a9 100644 --- a/BotSharp.WebHost/Settings/app.json +++ b/BotSharp.WebHost/Settings/app.json @@ -1,36 +1,21 @@ { - "version": "0.1.0", - "assemblies": "BotSharp.Core", + "version": "0.1.0", + "assemblies": "BotSharp.Core", - "platformModuleName": "ArticulateAi", + "platformModuleName": "DialogflowAi", - "machineLearning": { - "dataDir": "D:\\Projects\\BotSharp\\Data" + "modules": [ + /*{ + "Name": "DialogflowAi", + "Type": "BotSharp.Platform.Dialogflow" }, - - "moduleBasePath": "C:\\Users\\haipi\\Documents\\Projects", - "modules": [ - /* - { - "Name": "DialogflowAi", - "Type": "BotSharp.Platform.Dialogflow", - "Path": "botsharp-dialogflow\\BotSharp.Platform.Dialogflow\\bin\\Debug\\netcoreapp2.1" - } - { - "Name": "WeixinChannel", - "Type": "BotSharp.Channel.Weixin", - "Path": "botsharp-channel-weixin\\BotSharp.Channel.Weixin\\bin\\Debug\\netcoreapp2.1" - }, - { - "Name": "RasaAi", - "Type": "BotSharp.Platform.Rasa", - "Path": "botsharp-rasa\\BotSharp.Platform.Rasa\\bin\\Debug\\netcoreapp2.1" - }, - */ - { - "Name": "ArticulateAi", - "Type": "BotSharp.Platform.Articulate", - "Path": "botsharp-articulate\\BotSharp.Platform.Articulate\\bin\\Debug\\netcoreapp2.1" - } - ] + { + "Name": "RasaAi", + "Type": "BotSharp.Platform.Rasa", + }, + { + "Name": "ArticulateAi", + "Type": "BotSharp.Platform.Articulate", + }*/ + ] } diff --git a/BotSharp.WebHost/Settings/channels.json b/BotSharp.WebHost/Settings/channels.json new file mode 100644 index 00000000..a73f7f4a --- /dev/null +++ b/BotSharp.WebHost/Settings/channels.json @@ -0,0 +1,9 @@ +{ + "TokenAuthentication": { + "SecretKey": "lfo54FYneUCJNL2EjP9ZxQ==", + "Issuer": "BotSharp", + "Audience": "BotSharp", + "CookieName": "token", + "Subject": "BotSharp" + } +} diff --git a/BotSharp.WebHost/Settings/channels.weixin.json b/BotSharp.WebHost/Settings/channels.weixin.json new file mode 100644 index 00000000..38bf69db --- /dev/null +++ b/BotSharp.WebHost/Settings/channels.weixin.json @@ -0,0 +1,7 @@ +{ + "weixinChannel": { + "token": "botsharp", + "encodingAESKey": "", + "appId": "" + } +} diff --git a/BotSharp.WebHost/Settings/db.json b/BotSharp.WebHost/Settings/db.json index 63b7fcae..4482fb34 100644 --- a/BotSharp.WebHost/Settings/db.json +++ b/BotSharp.WebHost/Settings/db.json @@ -1,11 +1,12 @@ { "Database": { - "Default": "Redis", + "Default": "File", "ConnectionStrings": { "InMemory": "DataSource=:memory:", "Redis": "127.0.0.1:6379,defaultDatabase=BotSharp,poolsize=50,ssl=false,writeBuffer=10240,prefix=agent_", "Sqlite": "Data Source=|DataDirectory|BotSharp.db;", - "SqlServer": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=BotSharp;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" + "SqlServer": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=BotSharp;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", + "File": "|DataDirectory|AgentStorage" } } } \ No newline at end of file diff --git a/BotSharp.WebHost/Startup.cs b/BotSharp.WebHost/Startup.cs index 9ef2eecf..57853e80 100644 --- a/BotSharp.WebHost/Startup.cs +++ b/BotSharp.WebHost/Startup.cs @@ -40,7 +40,7 @@ namespace BotSharp.WebHost options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); }); - PlatformModuleAssembyLoader.LoadAssemblies(Configuration, assembly => mvcBuilder.AddApplicationPart(assembly)); + //PlatformModuleAssembyLoader.LoadAssemblies(Configuration, assembly => mvcBuilder.AddApplicationPart(assembly)); this.modulesStartup.ConfigureServices(services); diff --git a/BotSharp.sln b/BotSharp.sln index 6d6c745a..0dd12b6c 100644 --- a/BotSharp.sln +++ b/BotSharp.sln @@ -22,14 +22,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Abstracti EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Models", "BotSharp.Platform.Models\BotSharp.Platform.Models.csproj", "{C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Dialogflow", "..\botsharp-dialogflow\BotSharp.Platform.Dialogflow\BotSharp.Platform.Dialogflow.csproj", "{4F74387F-7101-428C-B918-38BC5ACCB0A6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bigtree.Algorithm", "..\Bigtree.MachineLearning\Bigtree.Algorithm\Bigtree.Algorithm.csproj", "{F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NumSharp", "..\NumSharp\src\NumSharp\NumSharp.csproj", "{92604F14-2C41-47CD-BED5-A7F2D08CA3D7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Articulate", "..\botsharp-articulate\BotSharp.Platform.Articulate\BotSharp.Platform.Articulate.csproj", "{55ACA669-7D5E-443D-9AB6-D38F4001B676}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution ARTICULATE|Any CPU = ARTICULATE|Any CPU @@ -42,6 +34,8 @@ Global RASA|x64 = RASA|x64 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 + Test|Any CPU = Test|Any CPU + Test|x64 = Test|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {95780673-2A1A-4953-962F-C46CBFDD07FF}.ARTICULATE|Any CPU.ActiveCfg = ARTICULATE|Any CPU @@ -64,6 +58,10 @@ Global {95780673-2A1A-4953-962F-C46CBFDD07FF}.Release|Any CPU.Build.0 = Release|Any CPU {95780673-2A1A-4953-962F-C46CBFDD07FF}.Release|x64.ActiveCfg = Release|x64 {95780673-2A1A-4953-962F-C46CBFDD07FF}.Release|x64.Build.0 = Release|x64 + {95780673-2A1A-4953-962F-C46CBFDD07FF}.Test|Any CPU.ActiveCfg = ARTICULATE|Any CPU + {95780673-2A1A-4953-962F-C46CBFDD07FF}.Test|Any CPU.Build.0 = ARTICULATE|Any CPU + {95780673-2A1A-4953-962F-C46CBFDD07FF}.Test|x64.ActiveCfg = RASA|x64 + {95780673-2A1A-4953-962F-C46CBFDD07FF}.Test|x64.Build.0 = RASA|x64 {03DCA427-327A-4FC9-9A2F-57D17F16708C}.ARTICULATE|Any CPU.ActiveCfg = Release|Any CPU {03DCA427-327A-4FC9-9A2F-57D17F16708C}.ARTICULATE|Any CPU.Build.0 = Release|Any CPU {03DCA427-327A-4FC9-9A2F-57D17F16708C}.ARTICULATE|x64.ActiveCfg = Release|x64 @@ -84,6 +82,10 @@ Global {03DCA427-327A-4FC9-9A2F-57D17F16708C}.Release|Any CPU.Build.0 = Release|Any CPU {03DCA427-327A-4FC9-9A2F-57D17F16708C}.Release|x64.ActiveCfg = Release|x64 {03DCA427-327A-4FC9-9A2F-57D17F16708C}.Release|x64.Build.0 = Release|x64 + {03DCA427-327A-4FC9-9A2F-57D17F16708C}.Test|Any CPU.ActiveCfg = Release|Any CPU + {03DCA427-327A-4FC9-9A2F-57D17F16708C}.Test|Any CPU.Build.0 = Release|Any CPU + {03DCA427-327A-4FC9-9A2F-57D17F16708C}.Test|x64.ActiveCfg = Release|x64 + {03DCA427-327A-4FC9-9A2F-57D17F16708C}.Test|x64.Build.0 = Release|x64 {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.ARTICULATE|Any CPU.ActiveCfg = ARTICULATE|Any CPU {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.ARTICULATE|Any CPU.Build.0 = ARTICULATE|Any CPU {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.ARTICULATE|x64.ActiveCfg = ARTICULATE|x64 @@ -104,6 +106,10 @@ Global {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.Release|Any CPU.Build.0 = Release|Any CPU {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.Release|x64.ActiveCfg = Release|x64 {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.Release|x64.Build.0 = Release|x64 + {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.Test|Any CPU.ActiveCfg = RASA NLU|Any CPU + {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.Test|Any CPU.Build.0 = RASA NLU|Any CPU + {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.Test|x64.ActiveCfg = RASA|x64 + {C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.Test|x64.Build.0 = RASA|x64 {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.ARTICULATE|Any CPU.ActiveCfg = ARTICULATE|Any CPU {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.ARTICULATE|Any CPU.Build.0 = ARTICULATE|Any CPU {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.ARTICULATE|x64.ActiveCfg = ARTICULATE|x64 @@ -124,6 +130,10 @@ Global {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.Release|Any CPU.Build.0 = Release|Any CPU {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.Release|x64.ActiveCfg = Release|x64 {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.Release|x64.Build.0 = Release|x64 + {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.Test|Any CPU.ActiveCfg = RASA NLU|Any CPU + {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.Test|Any CPU.Build.0 = RASA NLU|Any CPU + {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.Test|x64.ActiveCfg = RASA|x64 + {8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.Test|x64.Build.0 = RASA|x64 {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.ARTICULATE|Any CPU.ActiveCfg = ARTICULATE|Any CPU {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.ARTICULATE|Any CPU.Build.0 = ARTICULATE|Any CPU {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.ARTICULATE|x64.ActiveCfg = ARTICULATE|x64 @@ -144,6 +154,10 @@ Global {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.Release|Any CPU.Build.0 = Release|Any CPU {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.Release|x64.ActiveCfg = Release|x64 {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.Release|x64.Build.0 = Release|x64 + {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.Test|Any CPU.ActiveCfg = RASA NLU|Any CPU + {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.Test|Any CPU.Build.0 = RASA NLU|Any CPU + {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.Test|x64.ActiveCfg = RASA|x64 + {30F80E7D-951A-4E8F-9C3C-2C866528EABD}.Test|x64.Build.0 = RASA|x64 {62F08F9F-16C2-4754-90B0-B604DC18AE23}.ARTICULATE|Any CPU.ActiveCfg = Release|Any CPU {62F08F9F-16C2-4754-90B0-B604DC18AE23}.ARTICULATE|Any CPU.Build.0 = Release|Any CPU {62F08F9F-16C2-4754-90B0-B604DC18AE23}.ARTICULATE|x64.ActiveCfg = Release|Any CPU @@ -164,6 +178,10 @@ Global {62F08F9F-16C2-4754-90B0-B604DC18AE23}.Release|Any CPU.Build.0 = Release|Any CPU {62F08F9F-16C2-4754-90B0-B604DC18AE23}.Release|x64.ActiveCfg = Release|Any CPU {62F08F9F-16C2-4754-90B0-B604DC18AE23}.Release|x64.Build.0 = Release|Any CPU + {62F08F9F-16C2-4754-90B0-B604DC18AE23}.Test|Any CPU.ActiveCfg = Release|Any CPU + {62F08F9F-16C2-4754-90B0-B604DC18AE23}.Test|Any CPU.Build.0 = Release|Any CPU + {62F08F9F-16C2-4754-90B0-B604DC18AE23}.Test|x64.ActiveCfg = Release|Any CPU + {62F08F9F-16C2-4754-90B0-B604DC18AE23}.Test|x64.Build.0 = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.ARTICULATE|Any CPU.ActiveCfg = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.ARTICULATE|Any CPU.Build.0 = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.ARTICULATE|x64.ActiveCfg = Release|Any CPU @@ -184,86 +202,10 @@ Global {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Release|Any CPU.Build.0 = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Release|x64.ActiveCfg = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Release|x64.Build.0 = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.ARTICULATE|Any CPU.ActiveCfg = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.ARTICULATE|Any CPU.Build.0 = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.ARTICULATE|x64.ActiveCfg = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.ARTICULATE|x64.Build.0 = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.Debug|x64.ActiveCfg = Debug|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.Debug|x64.Build.0 = Debug|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.DIALOGFLOW|Any CPU.ActiveCfg = Debug|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.DIALOGFLOW|Any CPU.Build.0 = Debug|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.DIALOGFLOW|x64.ActiveCfg = Debug|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.DIALOGFLOW|x64.Build.0 = Debug|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.RASA|Any CPU.ActiveCfg = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.RASA|Any CPU.Build.0 = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.RASA|x64.ActiveCfg = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.RASA|x64.Build.0 = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.Release|Any CPU.Build.0 = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.Release|x64.ActiveCfg = Release|Any CPU - {4F74387F-7101-428C-B918-38BC5ACCB0A6}.Release|x64.Build.0 = Release|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.ARTICULATE|Any CPU.ActiveCfg = ARTICULATE|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.ARTICULATE|Any CPU.Build.0 = ARTICULATE|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.ARTICULATE|x64.ActiveCfg = ARTICULATE|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.ARTICULATE|x64.Build.0 = ARTICULATE|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.Debug|x64.ActiveCfg = Debug|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.Debug|x64.Build.0 = Debug|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.DIALOGFLOW|Any CPU.ActiveCfg = DIALOGFLOW|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.DIALOGFLOW|Any CPU.Build.0 = DIALOGFLOW|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.DIALOGFLOW|x64.ActiveCfg = DIALOGFLOW|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.DIALOGFLOW|x64.Build.0 = DIALOGFLOW|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.RASA|Any CPU.ActiveCfg = RASA|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.RASA|Any CPU.Build.0 = RASA|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.RASA|x64.ActiveCfg = RASA|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.RASA|x64.Build.0 = RASA|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.Release|Any CPU.Build.0 = Release|Any CPU - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.Release|x64.ActiveCfg = Release|x64 - {F09DB3FB-0ADF-4351-95BC-0B004BCB4C54}.Release|x64.Build.0 = Release|x64 - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.ARTICULATE|Any CPU.ActiveCfg = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.ARTICULATE|Any CPU.Build.0 = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.ARTICULATE|x64.ActiveCfg = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.ARTICULATE|x64.Build.0 = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.Debug|x64.ActiveCfg = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.Debug|x64.Build.0 = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.DIALOGFLOW|Any CPU.ActiveCfg = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.DIALOGFLOW|Any CPU.Build.0 = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.DIALOGFLOW|x64.ActiveCfg = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.DIALOGFLOW|x64.Build.0 = Debug|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.RASA|Any CPU.ActiveCfg = Release|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.RASA|Any CPU.Build.0 = Release|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.RASA|x64.ActiveCfg = Release|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.RASA|x64.Build.0 = Release|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.Release|Any CPU.Build.0 = Release|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.Release|x64.ActiveCfg = Release|Any CPU - {92604F14-2C41-47CD-BED5-A7F2D08CA3D7}.Release|x64.Build.0 = Release|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.ARTICULATE|Any CPU.ActiveCfg = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.ARTICULATE|Any CPU.Build.0 = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.ARTICULATE|x64.ActiveCfg = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.ARTICULATE|x64.Build.0 = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.Debug|x64.ActiveCfg = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.Debug|x64.Build.0 = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.DIALOGFLOW|Any CPU.ActiveCfg = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.DIALOGFLOW|Any CPU.Build.0 = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.DIALOGFLOW|x64.ActiveCfg = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.DIALOGFLOW|x64.Build.0 = Debug|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.RASA|Any CPU.ActiveCfg = Release|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.RASA|Any CPU.Build.0 = Release|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.RASA|x64.ActiveCfg = Release|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.RASA|x64.Build.0 = Release|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.Release|Any CPU.Build.0 = Release|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.Release|x64.ActiveCfg = Release|Any CPU - {55ACA669-7D5E-443D-9AB6-D38F4001B676}.Release|x64.Build.0 = Release|Any CPU + {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Test|Any CPU.ActiveCfg = Release|Any CPU + {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Test|Any CPU.Build.0 = Release|Any CPU + {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Test|x64.ActiveCfg = Release|Any CPU + {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Test|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/dockerfiles/docker-compose-articulateui.yml b/dockerfiles/docker-compose-articulateui.yml index 4fd6d49b..276c443f 100644 --- a/dockerfiles/docker-compose-articulateui.yml +++ b/dockerfiles/docker-compose-articulateui.yml @@ -7,6 +7,14 @@ services: networks: ['botsharp-network'] environment: - API_URL + + api: + image: samtecspg/articulate-api:0.12.1 + ports: ['0.0.0.0:7500:7500'] + networks: ['botsharp-network'] + entrypoint: ['node', 'start.js'] + environment: + - SWAGGER_BASE_PATH botsharp: image: botsharpdocker/botsharp-rasa:latest diff --git a/docs/conf.py b/docs/conf.py index 3c645669..55c01b58 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,6 +47,8 @@ templates_path = ['_templates'] # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] +from recommonmark.parser import CommonMarkParser +source_parsers = {'.md': CommonMarkParser} source_suffix = ['.rst', '.md'] # The master toctree document. diff --git a/docs/index.rst b/docs/index.rst index 5d17ce69..9f9fff7f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -52,7 +52,8 @@ The main documentation for the site is organized into a couple sections: .. toctree:: :maxdepth: 3 :caption: User Documentation: - + + overview installation agent/import-agent agent/train-agent diff --git a/docs/overview.md b/docs/overview.md new file mode 100644 index 00000000..d49509d5 --- /dev/null +++ b/docs/overview.md @@ -0,0 +1,56 @@ +# BotSharp Overview +*Bo Peng & Haiping Chen --10/10/2018* + +BotSharp is an open source machine learning framework for AI Bot platform builder. This project involves natural language understanding and audio processing technologies, and aims to promote the development and application of intelligent robot assistants in information systems. Out of the box machine learning algorithms allow ordinary programmers to develop artificial intelligence applications faster and easier. + +BotSharp is an high compatible and high scalable platform builder. It is in accordance with components princple strictly, decouples every part that needed in the platform builder. So you can choose different UI/UX, or pick up a different NLP Tagger, or select a more advanced algrithm to do NER task. They are all modulized based on unfied interfaces. + +![ ](./static/screenshots/BotSharp_arch.png "BotSharp Architecture Chart") +From the chart ahead we can see that based on botsharp you can launch your own chatbot platform with 3 components: + +- Storage module: Botsharp supports memory and redis DB 2 methods. +- Corpus extractor: To format data in template to feed into botsharp trainer. +- NLU engine. Botsharp initiate a exclusive NLU engine and are open to users. + +BotSharp let you build conversational interfaces on top of your products and services by providing a natural language understanding (NLU) engine to process and understand natural language inut. + +Tradational computer interfaces require structured data, which makes the use of these interfaces unnatural and sometime difficult. While machine learning interfaces are data driven, which computer can find the logic or information behind the unstructured data(sentences). + +For example. an simple request may like "Can you play country music?". Other users may ask "play some romantic songs." + +Even with this simple question, you can see conversational experience are hard to implemented. Interpreting and processing natural language requires a very robust language parser that has the capable of understanding the nuances of language. + +Your code would have to handle all these different types of requests ro carry out the same logic: looking up some forecast information for a feature. For this reason, a traditional computer interface would tend to force users to input a well-known, standard request at the detriment of the user experience, because it's just easier. + +However, BotSharp lets you easily achieve a conversational user experience by handling the natural language understanding (NLU) for you.When you use BotSharp, you can create agents that can understand the meaning of natural language and the nuances and trainslate that to structured meaning your software can understand. + +## Agent +An agent helps you process user sentences (unstructure data) into structure data that you can use to return an appropriate response. +![](./static/screenshots/Agent_sent.png) +When users say something, your agent matches the user utterance to an exactly matched intent or closely matched intent. Besides, the agent will return extra information about named entities which you need from the utterance. This can be name, location date or a host of other data categories (entities). You can define both the intent and the entities in your training data sets. You can also define what else to extact in your training phares as well.Then you can send a response to user to continue the conversation or to just end the conversation. It is very simple to create your own agent in BotSharp. The only thing you need is to assign you agent a name and a brief discription. +![](./static/screenshots/Agent_Workflow.png) + + +## Intent +To define how conversations work, you create intents in your agent that map user input to response. Generally an intent represents one dialog turn in a conversation. For example, you could create an music control angent recognise and responds to users. If a user said "Can you play Rihanna's Diamonds?". Your agent will do intent matching to music play intent, and responds to users a corresponding reply. It usually prompts users for another utterance which your agent will attempt to match another intent, and the conversation continues. + +### Training Phrases +Training Phrases are collections of possible utterances that users might say to match a intent. You don't have to define every possible utterance of what user say. While we recommend users could define as more expression way as possible. It will help improve the robot understanding ability a lot. + +![](./static/screenshots/articulatescreenshot.png) +From the chart above we can see: An Intent consist of four main components: + +- Intent name: The name of the intent +- Training phrases: Examples of what users can say to match a particular intent. BotSharp will automaticlly expand these phrases to match similar user utterances. +- Actions and parameters: Define how relevant information (Entities) are extracted from user utterances. You can use these parameters (entities) as input into other logic, such as looking up information, carry out a task, or returning a response. +- Response: An utterance that is spoken or displayed back to the user. +## Named Entity +Named Entity is BotSharp mechanism for identfying and extacting useful data from user utterance text inputs. The difference between intent and entity is: intents allows your agent to understand the motivation behind a particular user input, on the other hand entities are used to extract out specific pieces of information that user mentions. Any important data you want to get from a user's request have a corresponding entity. + +### Annotation Entities +Training Phrases allow your agent to successfully match user input to an intent. In order to help your agent with this matching process. You can annotate training phrases with entities. Entitty is a host of categories. For example, locations, organizations, persons and numbers are all entities. Annotation refers to the linking of words or values within training phrases to their corresponding entities. You can manually annotate you training phrases. Once a word or phrase is annotated, it will be highlight in your training phrases. + +For example, imagine that you defined a training phrase like "Can you play Rihanna's Diamond please?" You can annotate Rihanna as an artist and Diamond as a song here. This annotation tells BotSharp to match more variations. like "Can you play Beattle's Hey Jude please?", or any other variation that have an artist and a song name combination. If you didn't annotate the phrase.For "Can you play Rihanna's Diamond" speaking, the agent would match user input that contained "Rihanna" and "Diamond" exactly, but not any other artists and any other songs. We recommend users could annotation properly in order to have a impressive intent classification experience. + +## Channels + When you already trained a chatbot on Botsharp, you may want it to play a really role in life. So we intergrate some popular channels in Botsharp including Twilio, facebook messenger, Telegram, WeChat and some other RPAs. These channels can make your robot "real" in life. For example, on facebook when a user visit your page and sends you a message, they can talk to your agent. You can also set a virtral assistant based on Twilio to chat with your clients for ordering, consulting, problem solving and many other business processes. \ No newline at end of file diff --git a/docs/static/screenshots/Agent_Workflow.png b/docs/static/screenshots/Agent_Workflow.png new file mode 100644 index 00000000..a497a4f0 Binary files /dev/null and b/docs/static/screenshots/Agent_Workflow.png differ diff --git a/docs/static/screenshots/Agent_sent.png b/docs/static/screenshots/Agent_sent.png new file mode 100644 index 00000000..e95d9a72 Binary files /dev/null and b/docs/static/screenshots/Agent_sent.png differ diff --git a/docs/static/screenshots/BotSharp_arch.png b/docs/static/screenshots/BotSharp_arch.png new file mode 100644 index 00000000..aa79db42 Binary files /dev/null and b/docs/static/screenshots/BotSharp_arch.png differ diff --git a/docs/static/screenshots/articulatescreenshot.png b/docs/static/screenshots/articulatescreenshot.png new file mode 100644 index 00000000..3d36689f Binary files /dev/null and b/docs/static/screenshots/articulatescreenshot.png differ diff --git a/docs/集成微信公众号/README.md b/docs/集成微信公众号/README.md index 89a48f55..ac2fa6d2 100644 --- a/docs/集成微信公众号/README.md +++ b/docs/集成微信公众号/README.md @@ -15,7 +15,8 @@ grammar_cjkRuby: true 加载的项目为botsharp-channel-weixin和botsharp-dialogflow两个项目。 项目botsharp-channel-weixin为腾讯微信BotSharp的通道模块,加载此项目可以省去编写微信通道模块的过程,当然也可以根据自己的需求去编写微信的通道模块。 -项目文件botsharp-channel-weixin下载地址(https://github.com/Oceania2018/botsharp-channel-weixin) 将botsharp-channel-weixin和botsharp-dialogflow项目放置到BotSharp同级的目录下。并加载到BotSharp中。 + +项目文件botsharp-channel-weixin下载地址(https://github.com/Oceania2018/botsharp-channel-weixin)将botsharp-channel-weixin和botsharp-dialogflow项目放置到BotSharp同级的目录下。并加载到BotSharp中。 ![](./集成微信公众号图片/图片1.png) @@ -32,6 +33,7 @@ grammar_cjkRuby: true ![](./集成微信公众号图片/BotSharp运行结果.png) + 运行成功后,打开网址为(http://localhost:3112/index.html) 的网页,此网页所显示的为BotSharp的接口列表。 ![](./集成微信公众号图片/3112.png) @@ -55,6 +57,7 @@ grammar_cjkRuby: true ![](./集成微信公众号图片/ngrok黑窗体.png) + 其中http://sss.ngrok.xiaomiqiu.cn 即为映射的外网IP。 **2)填写接口配置信息**