Merge branch 'master' into master

This commit is contained in:
Spongebob5 2018-10-24 16:25:03 +08:00 committed by GitHub
commit 2cf34c7d4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 326 additions and 170 deletions

1
.gitignore vendored
View file

@ -290,3 +290,4 @@ __pycache__/
/Data /Data
/docs/_build /docs/_build
*.RestApi.xml *.RestApi.xml
/BotSharp.WebHost/App_Data/AgentStorage

View file

@ -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<TAgent> : IAgentStorage<TAgent>
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<TAgent> FetchById(string agentId)
{
string dataPath = Path.Combine(storageDir, agentId + ".json");
if (File.Exists(dataPath))
{
string json = File.ReadAllText(dataPath);
return JsonConvert.DeserializeObject<TAgent>(json);
}
else
{
return default(TAgent);
}
}
public async Task<TAgent> 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<TAgent>(json);
if (agent.Name.ToLower() == agentName.ToLower())
{
return agent;
}
}
return default(TAgent);
}
public async Task<bool> 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<int> PurgeAllAgents()
{
var files = Directory.GetFiles(storageDir);
for (int i = 0; i < files.Length; i++)
{
File.Delete(files[i]);
}
return files.Length;
}
public async Task<List<TAgent>> Query()
{
var agents = new List<TAgent>();
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<TAgent>(json);
agents.Add(agent);
}
return agents;
}
}
}

View file

@ -85,7 +85,7 @@ namespace BotSharp.Core.AgentStorage
{ {
var keys = csredis.Keys($"{prefix}*"); 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(); return keys.Count();
} }

View file

@ -17,6 +17,7 @@ namespace BotSharp.Core.AgentStorage
services.AddSingleton<AgentStorageInMemory<TAgent>>(); services.AddSingleton<AgentStorageInMemory<TAgent>>();
services.AddSingleton<AgentStorageInRedis<TAgent>>(); services.AddSingleton<AgentStorageInRedis<TAgent>>();
services.AddSingleton<AgentStorageInFile<TAgent>>();
services.AddSingleton(factory => services.AddSingleton(factory =>
{ {
@ -30,6 +31,10 @@ namespace BotSharp.Core.AgentStorage
{ {
return factory.GetService<AgentStorageInMemory<TAgent>>(); return factory.GetService<AgentStorageInMemory<TAgent>>();
} }
else if (key.Equals("AgentStorageInFile"))
{
return factory.GetService<AgentStorageInFile<TAgent>>();
}
else else
{ {
throw new ArgumentException($"Not Support key : {key}"); throw new ArgumentException($"Not Support key : {key}");

View file

@ -20,14 +20,14 @@
If you feel that this project is helpful to you, please Star on the project, we will be very grateful.</Description> If you feel that this project is helpful to you, please Star on the project, we will be very grateful.</Description>
<RepositoryType>MIT</RepositoryType> <RepositoryType>MIT</RepositoryType>
<RepositoryUrl>https://github.com/Oceania2018/BotSharp</RepositoryUrl> <RepositoryUrl>https://github.com/Oceania2018/BotSharp</RepositoryUrl>
<PackageTags>NLU, Chatbot, Bot, AI Bot, Artificial Intelligence, RPA</PackageTags> <PackageTags>NLU, Chatbot, Bot, AI Bot, Artificial Intelligence</PackageTags>
<Version>1.6.0</Version> <Version>1.7.2</Version>
<PackageReleaseNotes>Monthly Update. <PackageReleaseNotes>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.</PackageReleaseNotes> If you feel that this project is helpful to you, please Star on the project, we will be very grateful.</PackageReleaseNotes>
<Copyright>Since 2018 Haiping Chen</Copyright> <Copyright>Since 2018 Haiping Chen</Copyright>
<PackageProjectUrl>https://github.com/Oceania2018/BotSharp</PackageProjectUrl> <PackageProjectUrl>https://github.com/Oceania2018/BotSharp</PackageProjectUrl>
<AssemblyVersion>1.6.0.0</AssemblyVersion> <AssemblyVersion>1.7.2.0</AssemblyVersion>
<PackageIconUrl>https://raw.githubusercontent.com/Oceania2018/BotSharp/master/BotSharp.WebHost/wwwroot/images/BotSharp.png</PackageIconUrl> <PackageIconUrl>https://raw.githubusercontent.com/Oceania2018/BotSharp/master/BotSharp.WebHost/wwwroot/images/BotSharp.png</PackageIconUrl>
<PackageLicenseUrl>https://github.com/Oceania2018/BotSharp/blob/master/LICENSE</PackageLicenseUrl> <PackageLicenseUrl>https://github.com/Oceania2018/BotSharp/blob/master/LICENSE</PackageLicenseUrl>
</PropertyGroup> </PropertyGroup>
@ -75,7 +75,7 @@ If you feel that this project is helpful to you, please Star on the project, we
<ItemGroup> <ItemGroup>
<PackageReference Include="Colorful.Console" Version="1.2.9" /> <PackageReference Include="Colorful.Console" Version="1.2.9" />
<PackageReference Include="CSRedisCore" Version="2.6.13" /> <PackageReference Include="CSRedisCore" Version="3.0.5" />
<PackageReference Include="DotNetToolkit" Version="1.6.0" /> <PackageReference Include="DotNetToolkit" Version="1.6.0" />
<PackageReference Include="EntityFrameworkCore.BootKit" Version="1.9.1" /> <PackageReference Include="EntityFrameworkCore.BootKit" Version="1.9.1" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="2.1.1" /> <PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="2.1.1" />

View file

@ -72,13 +72,13 @@ namespace BotSharp.Core.Engines
await pipe.Predict(agent, data, pipeModel); 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 Console.WriteLine(JsonConvert.SerializeObject(data, new JsonSerializerSettings
{ {
Formatting = Formatting.Indented, Formatting = Formatting.Indented,
NullValueHandling = NullValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore,
ContractResolver = new CamelCasePropertyNamesContractResolver() ContractResolver = new CamelCasePropertyNamesContractResolver()
})); }));*/
return data; return data;
} }

View file

@ -56,7 +56,7 @@ namespace BotSharp.Core.Engines.BotSharp
{ {
Classifier = "BotSharpIntentClassifier", Classifier = "BotSharpIntentClassifier",
Label = result.First().Item1, Label = result.First().Item1,
Confidence = (decimal)result.First().Item2 Confidence = result.First().Item2
}; };
return true; return true;

View file

@ -10,6 +10,6 @@ namespace BotSharp.Core.Engines
public String Label { get; set; } public String Label { get; set; }
public Decimal Confidence { get; set; } public double Confidence { get; set; }
} }
} }

View file

@ -9,6 +9,11 @@ namespace BotSharp.Core.Modules
/// </summary> /// </summary>
public class ModuleOptions public class ModuleOptions
{ {
public ModuleOptions()
{
Path = String.Empty;
}
/// <summary> /// <summary>
/// Module name /// Module name
/// </summary> /// </summary>

View file

@ -9,10 +9,10 @@ namespace BotSharp.Core.Modules
/// </summary> /// </summary>
public class ModulesOptions public class ModulesOptions
{ {
/// <summary> public ModulesOptions()
/// Module base directory {
/// </summary> Modules = new List<ModuleOptions>();
public String ModuleBasePath { get; set; } }
/// <summary> /// <summary>
/// List of module configurations. /// List of module configurations.

View file

@ -32,6 +32,11 @@ namespace BotSharp.Core.Modules
throw new ArgumentNullException(nameof(configuration)); throw new ArgumentNullException(nameof(configuration));
ModulesOptions options = configuration.Get<ModulesOptions>(); ModulesOptions options = configuration.Get<ModulesOptions>();
if (options.Modules.Count == 0)
{
Console.WriteLine($"Platform emulator not found.", Color.Red);
}
this._modules = options.Modules this._modules = options.Modules
.Select(s => .Select(s =>
{ {
@ -48,6 +53,7 @@ namespace BotSharp.Core.Modules
else else
{ {
IModule module = (IModule)Activator.CreateInstance(type); IModule module = (IModule)Activator.CreateInstance(type);
Console.WriteLine($"Loaded module \"{s.Type}\"", Color.Green);
return module; return module;
} }
} }
@ -82,6 +88,7 @@ namespace BotSharp.Core.Modules
{ {
foreach (IModule module in this._modules) foreach (IModule module in this._modules)
{ {
if (module == null) continue;
module.Configure(app, env); module.Configure(app, env);
} }
} }

View file

@ -22,8 +22,11 @@ namespace Microsoft.Extensions.DependencyInjection
Console.WriteLine(); Console.WriteLine();
options.Modules.ForEach(module => { options.Modules.ForEach(module => {
if (String.IsNullOrEmpty(module.Path))
var dllPath = Path.Combine(options.ModuleBasePath, module.Path, $"{module.Type}.dll"); {
module.Path = AppContext.BaseDirectory;
}
var dllPath = Path.Combine(module.Path, $"{module.Type}.dll");
if (File.Exists(dllPath)) if (File.Exists(dllPath))
{ {
Assembly library = AssemblyLoadContext.Default.LoadFromAssemblyPath(dllPath); Assembly library = AssemblyLoadContext.Default.LoadFromAssemblyPath(dllPath);
@ -36,15 +39,14 @@ namespace Microsoft.Extensions.DependencyInjection
new Formatter(dllPath, Color.Yellow) new Formatter(dllPath, Color.Yellow)
}; };
Console.WriteLineFormatted("Loaded {0} module, type: {1}, path: {2}", Color.White, settings); Console.WriteLineFormatted("Loaded {0} module, type: {1}, path: {2}", Color.White, settings);
Console.WriteLine();
} }
else 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();
} }
} }
} }

View file

@ -36,6 +36,8 @@ namespace BotSharp.Core
public async Task<TAgent> LoadAgentFromFile<TImporter>(string dataDir) where TImporter : IAgentImporter<TAgent>, new() public async Task<TAgent> LoadAgentFromFile<TImporter>(string dataDir) where TImporter : IAgentImporter<TAgent>, new()
{ {
Console.WriteLine($"Loading agent from folder {dataDir}");
var meta = LoadMeta(dataDir); var meta = LoadMeta(dataDir);
var importer = new TImporter var importer = new TImporter
{ {
@ -54,6 +56,8 @@ namespace BotSharp.Core
// Load system buildin entities // Load system buildin entities
await importer.LoadBuildinEntities(agent); await importer.LoadBuildinEntities(agent);
Console.WriteLine($"Loaded agent: {agent.Name} {agent.Id}");
return agent; return agent;
} }

View file

@ -15,7 +15,7 @@ namespace BotSharp.Core
public PlatformSettingsBase() public PlatformSettingsBase()
{ {
BotEngine = "BotSharpNLU"; BotEngine = "BotSharpNLU";
AgentStorage = "AgentStorageInMemory"; AgentStorage = "AgentStorageInFile";
} }
public string BotEngine { get; set; } public string BotEngine { get; set; }

View file

@ -4,7 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<Platforms>AnyCPU;x64</Platforms> <Platforms>AnyCPU;x64</Platforms>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.4.0</Version> <Version>0.5.0</Version>
<Description>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. <Description>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: BotSharp.NLP has implemented below machine learning algorithms:
@ -42,12 +42,13 @@ Naive Bayes Classifier</Description>
<Optimize>false</Optimize> <Optimize>false</Optimize>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Bigtree.Algorithm" Version="0.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Bigtree.MachineLearning\Bigtree.Algorithm\Bigtree.Algorithm.csproj" />
</ItemGroup>
</Project> </Project>

View file

@ -131,8 +131,8 @@ namespace BotSharp.NLP.Classify
public List<Node[]> GetData(List<Sentence> sentences, ClassifyOptions options) public List<Node[]> GetData(List<Sentence> sentences, ClassifyOptions options)
{ {
//var extractor = new CountFeatureExtractor(); var extractor = new CountFeatureExtractor();
var extractor = new Word2VecFeatureExtractor(); //var extractor = new Word2VecFeatureExtractor();
extractor.ModelFile = options.Word2VecFilePath; extractor.ModelFile = options.Word2VecFilePath;
extractor.Sentences = sentences; extractor.Sentences = sentences;
if(features != null) if(features != null)

View file

@ -46,7 +46,7 @@ namespace BotSharp.NLP.Tokenize
{ {
get get
{ {
return Regex.IsMatch(Text, @"^[a-zA-Z]+$"); return Regex.IsMatch(Text, @"^[a-zA-Z]+|[\u4e00-\u9fa5]+$");
} }
} }

View file

@ -3,7 +3,8 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.1.0</Version> <Version>0.2.0</Version>
<RepositoryUrl>https://github.com/Oceania2018/BotSharp</RepositoryUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -47,6 +47,6 @@ namespace BotSharp.Platform.Abstraction
Task<ModelMetaData> Train(TAgent agent, TrainingCorpus corpus, BotTrainOptions options); Task<ModelMetaData> Train(TAgent agent, TrainingCorpus corpus, BotTrainOptions options);
Task<AiResponse> TextRequest(AiRequest request); Task<TResult> TextRequest<TResult>(AiRequest request);
} }
} }

View file

@ -3,7 +3,8 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.1.0</Version> <Version>0.2.0</Version>
<PackageProjectUrl>https://github.com/Oceania2018/BotSharp</PackageProjectUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -13,7 +13,7 @@ namespace BotSharp.Platform.Models.MachineLearning
public String AgentId { get; set; } public String AgentId { get; set; }
[Required] [Required]
public decimal MinConfidence { get; set; } public double MinConfidence { get; set; }
[Required] [Required]
[MaxLength(64)] [MaxLength(64)]

View file

@ -30,11 +30,13 @@
<ItemGroup> <ItemGroup>
<Compile Remove="App_Data\AgentArchive\**" /> <Compile Remove="App_Data\AgentArchive\**" />
<Compile Remove="App_Data\AgentStorage\**" />
<Compile Remove="App_Data\Corpus\**" /> <Compile Remove="App_Data\Corpus\**" />
<Compile Remove="App_Data\Projects\**" /> <Compile Remove="App_Data\Projects\**" />
<Compile Remove="PublishOutput\**" /> <Compile Remove="PublishOutput\**" />
<Compile Remove="publish\**" /> <Compile Remove="publish\**" />
<Content Remove="App_Data\AgentArchive\**" /> <Content Remove="App_Data\AgentArchive\**" />
<Content Remove="App_Data\AgentStorage\**" />
<Content Remove="App_Data\Corpus\**" /> <Content Remove="App_Data\Corpus\**" />
<Content Remove="App_Data\DbInitializer\**" /> <Content Remove="App_Data\DbInitializer\**" />
<Content Remove="App_Data\Projects\**" /> <Content Remove="App_Data\Projects\**" />
@ -42,11 +44,13 @@
<Content Remove="PublishOutput\**" /> <Content Remove="PublishOutput\**" />
<Content Remove="publish\**" /> <Content Remove="publish\**" />
<EmbeddedResource Remove="App_Data\AgentArchive\**" /> <EmbeddedResource Remove="App_Data\AgentArchive\**" />
<EmbeddedResource Remove="App_Data\AgentStorage\**" />
<EmbeddedResource Remove="App_Data\Corpus\**" /> <EmbeddedResource Remove="App_Data\Corpus\**" />
<EmbeddedResource Remove="App_Data\Projects\**" /> <EmbeddedResource Remove="App_Data\Projects\**" />
<EmbeddedResource Remove="PublishOutput\**" /> <EmbeddedResource Remove="PublishOutput\**" />
<EmbeddedResource Remove="publish\**" /> <EmbeddedResource Remove="publish\**" />
<None Remove="App_Data\AgentArchive\**" /> <None Remove="App_Data\AgentArchive\**" />
<None Remove="App_Data\AgentStorage\**" />
<None Remove="App_Data\Corpus\**" /> <None Remove="App_Data\Corpus\**" />
<None Remove="App_Data\DbInitializer\**" /> <None Remove="App_Data\DbInitializer\**" />
<None Remove="App_Data\Projects\**" /> <None Remove="App_Data\Projects\**" />
@ -87,6 +91,9 @@
<Content Update="Settings\app.json"> <Content Update="Settings\app.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Update="Settings\channels.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="Settings\DialogflowAi.json"> <Content Update="Settings\DialogflowAi.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

View file

@ -10,7 +10,7 @@
"pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier", "pipe": "BotSharpTokenizer, BotSharpTagger, BotSharpCRFNer, BotSharpIntentClassifier",
"botSharpTokenizer": { "botSharpTokenizer": {
"tokenizer": "TreebankTokenizer" "tokenizer": "JiebaTokenizer"
}, },
"botSharpIntentClassifier": { "botSharpIntentClassifier": {
@ -19,18 +19,11 @@
}, },
"botSharpTagger": { "botSharpTagger": {
"tagger": "NGramTagger" "tagger": "JiebaTagger"
}, },
"botSharpCRFNer": { "botSharpCRFNer": {
"template": "|App_Data|CRFLite/template.en" "template": "|App_Data|CRFLite/template.en"
},
"witAiEntityRecognizer": {
"url": "https://api.wit.ai",
"resource": "message",
"serverAccessToken": "SERVER_ACCESS_TOKEN",
"version": "20180811"
} }
} }
} }

View file

@ -1,7 +1,7 @@
{ {
// if you want to override platform setting, please set corresponding value, otherwise you don't need this section. // if you want to override platform setting, please set corresponding value, otherwise you don't need this section.
"dialogflowAi": { "dialogflowAi": {
"botEngine": "BotSharpNLU", "botEngine": "BotSharpNLU",
"agentStorage": "AgentStorageInMemory" "agentStorage": "AgentStorageInFile"
} }
} }

View file

@ -1,36 +1,21 @@
{ {
"version": "0.1.0", "version": "0.1.0",
"assemblies": "BotSharp.Core", "assemblies": "BotSharp.Core",
"platformModuleName": "ArticulateAi", "platformModuleName": "DialogflowAi",
"machineLearning": { "modules": [
"dataDir": "D:\\Projects\\BotSharp\\Data" /*{
"Name": "DialogflowAi",
"Type": "BotSharp.Platform.Dialogflow"
}, },
{
"moduleBasePath": "C:\\Users\\haipi\\Documents\\Projects", "Name": "RasaAi",
"modules": [ "Type": "BotSharp.Platform.Rasa",
/* },
{ {
"Name": "DialogflowAi", "Name": "ArticulateAi",
"Type": "BotSharp.Platform.Dialogflow", "Type": "BotSharp.Platform.Articulate",
"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"
}
]
} }

View file

@ -0,0 +1,9 @@
{
"TokenAuthentication": {
"SecretKey": "lfo54FYneUCJNL2EjP9ZxQ==",
"Issuer": "BotSharp",
"Audience": "BotSharp",
"CookieName": "token",
"Subject": "BotSharp"
}
}

View file

@ -0,0 +1,7 @@
{
"weixinChannel": {
"token": "botsharp",
"encodingAESKey": "",
"appId": ""
}
}

View file

@ -1,11 +1,12 @@
{ {
"Database": { "Database": {
"Default": "Redis", "Default": "File",
"ConnectionStrings": { "ConnectionStrings": {
"InMemory": "DataSource=:memory:", "InMemory": "DataSource=:memory:",
"Redis": "127.0.0.1:6379,defaultDatabase=BotSharp,poolsize=50,ssl=false,writeBuffer=10240,prefix=agent_", "Redis": "127.0.0.1:6379,defaultDatabase=BotSharp,poolsize=50,ssl=false,writeBuffer=10240,prefix=agent_",
"Sqlite": "Data Source=|DataDirectory|BotSharp.db;", "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"
} }
} }
} }

View file

@ -40,7 +40,7 @@ namespace BotSharp.WebHost
options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
}); });
PlatformModuleAssembyLoader.LoadAssemblies(Configuration, assembly => mvcBuilder.AddApplicationPart(assembly)); //PlatformModuleAssembyLoader.LoadAssemblies(Configuration, assembly => mvcBuilder.AddApplicationPart(assembly));
this.modulesStartup.ConfigureServices(services); this.modulesStartup.ConfigureServices(services);

View file

@ -22,14 +22,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Abstracti
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Models", "BotSharp.Platform.Models\BotSharp.Platform.Models.csproj", "{C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.Platform.Models", "BotSharp.Platform.Models\BotSharp.Platform.Models.csproj", "{C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}"
EndProject 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 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
ARTICULATE|Any CPU = ARTICULATE|Any CPU ARTICULATE|Any CPU = ARTICULATE|Any CPU
@ -42,6 +34,8 @@ Global
RASA|x64 = RASA|x64 RASA|x64 = RASA|x64
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64 Release|x64 = Release|x64
Test|Any CPU = Test|Any CPU
Test|x64 = Test|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{95780673-2A1A-4953-962F-C46CBFDD07FF}.ARTICULATE|Any CPU.ActiveCfg = ARTICULATE|Any CPU {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|Any CPU.Build.0 = Release|Any CPU
{95780673-2A1A-4953-962F-C46CBFDD07FF}.Release|x64.ActiveCfg = Release|x64 {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}.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.ActiveCfg = Release|Any CPU
{03DCA427-327A-4FC9-9A2F-57D17F16708C}.ARTICULATE|Any CPU.Build.0 = 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 {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|Any CPU.Build.0 = Release|Any CPU
{03DCA427-327A-4FC9-9A2F-57D17F16708C}.Release|x64.ActiveCfg = Release|x64 {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}.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.ActiveCfg = ARTICULATE|Any CPU
{C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.ARTICULATE|Any CPU.Build.0 = 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 {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|Any CPU.Build.0 = Release|Any CPU
{C2FDC855-BD88-4041-B0FF-3AA8A1C11A22}.Release|x64.ActiveCfg = Release|x64 {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}.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.ActiveCfg = ARTICULATE|Any CPU
{8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.ARTICULATE|Any CPU.Build.0 = 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 {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|Any CPU.Build.0 = Release|Any CPU
{8A1F6277-FFCB-4CCD-B798-876D8BE525A9}.Release|x64.ActiveCfg = Release|x64 {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}.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.ActiveCfg = ARTICULATE|Any CPU
{30F80E7D-951A-4E8F-9C3C-2C866528EABD}.ARTICULATE|Any CPU.Build.0 = 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 {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|Any CPU.Build.0 = Release|Any CPU
{30F80E7D-951A-4E8F-9C3C-2C866528EABD}.Release|x64.ActiveCfg = Release|x64 {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}.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.ActiveCfg = Release|Any CPU
{62F08F9F-16C2-4754-90B0-B604DC18AE23}.ARTICULATE|Any CPU.Build.0 = 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 {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|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.ActiveCfg = Release|Any CPU
{62F08F9F-16C2-4754-90B0-B604DC18AE23}.Release|x64.Build.0 = 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.ActiveCfg = Release|Any CPU
{C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.ARTICULATE|Any CPU.Build.0 = 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 {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|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.ActiveCfg = Release|Any CPU
{C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Release|x64.Build.0 = 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 {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Test|Any CPU.ActiveCfg = Release|Any CPU
{4F74387F-7101-428C-B918-38BC5ACCB0A6}.ARTICULATE|Any CPU.Build.0 = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Test|Any CPU.Build.0 = Release|Any CPU
{4F74387F-7101-428C-B918-38BC5ACCB0A6}.ARTICULATE|x64.ActiveCfg = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Test|x64.ActiveCfg = Release|Any CPU
{4F74387F-7101-428C-B918-38BC5ACCB0A6}.ARTICULATE|x64.Build.0 = Release|Any CPU {C4F2EAE5-F2C7-4F52-9DB2-7E76D7080C72}.Test|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
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View file

@ -7,6 +7,14 @@ services:
networks: ['botsharp-network'] networks: ['botsharp-network']
environment: environment:
- API_URL - 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: botsharp:
image: botsharpdocker/botsharp-rasa:latest image: botsharpdocker/botsharp-rasa:latest

View file

@ -47,6 +47,8 @@ templates_path = ['_templates']
# You can specify multiple suffix as a list of string: # You can specify multiple suffix as a list of string:
# #
# source_suffix = ['.rst', '.md'] # source_suffix = ['.rst', '.md']
from recommonmark.parser import CommonMarkParser
source_parsers = {'.md': CommonMarkParser}
source_suffix = ['.rst', '.md'] source_suffix = ['.rst', '.md']
# The master toctree document. # The master toctree document.

View file

@ -52,7 +52,8 @@ The main documentation for the site is organized into a couple sections:
.. toctree:: .. toctree::
:maxdepth: 3 :maxdepth: 3
:caption: User Documentation: :caption: User Documentation:
overview
installation installation
agent/import-agent agent/import-agent
agent/train-agent agent/train-agent

56
docs/overview.md Normal file
View file

@ -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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
docs/static/screenshots/Agent_sent.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View file

@ -15,7 +15,8 @@ grammar_cjkRuby: true
加载的项目为botsharp-channel-weixin和botsharp-dialogflow两个项目。 加载的项目为botsharp-channel-weixin和botsharp-dialogflow两个项目。
项目botsharp-channel-weixin为腾讯微信BotSharp的通道模块加载此项目可以省去编写微信通道模块的过程当然也可以根据自己的需求去编写微信的通道模块。 项目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) ![](./集成微信公众号图片/图片1.png)
@ -32,6 +33,7 @@ grammar_cjkRuby: true
![](./集成微信公众号图片/BotSharp运行结果.png) ![](./集成微信公众号图片/BotSharp运行结果.png)
运行成功后,打开网址为(http://localhost:3112/index.html) 的网页此网页所显示的为BotSharp的接口列表。 运行成功后,打开网址为(http://localhost:3112/index.html) 的网页此网页所显示的为BotSharp的接口列表。
![](./集成微信公众号图片/3112.png) ![](./集成微信公众号图片/3112.png)
@ -55,6 +57,7 @@ grammar_cjkRuby: true
![](./集成微信公众号图片/ngrok黑窗体.png) ![](./集成微信公众号图片/ngrok黑窗体.png)
其中http://sss.ngrok.xiaomiqiu.cn 即为映射的外网IP。 其中http://sss.ngrok.xiaomiqiu.cn 即为映射的外网IP。
**2)填写接口配置信息** **2)填写接口配置信息**