NuGet 1.7.1, Simplify installation.
This commit is contained in:
parent
626b882b05
commit
f01e64a5c5
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
<RepositoryType>MIT</RepositoryType>
|
||||
<RepositoryUrl>https://github.com/Oceania2018/BotSharp</RepositoryUrl>
|
||||
<PackageTags>NLU, Chatbot, Bot, AI Bot, Artificial Intelligence, RPA</PackageTags>
|
||||
<Version>1.6.0</Version>
|
||||
<PackageTags>NLU, Chatbot, Bot, AI Bot, Artificial Intelligence</PackageTags>
|
||||
<Version>1.7.1</Version>
|
||||
<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>
|
||||
<Copyright>Since 2018 Haiping Chen</Copyright>
|
||||
<PackageProjectUrl>https://github.com/Oceania2018/BotSharp</PackageProjectUrl>
|
||||
<AssemblyVersion>1.6.0.0</AssemblyVersion>
|
||||
<AssemblyVersion>1.7.1.0</AssemblyVersion>
|
||||
<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>
|
||||
</PropertyGroup>
|
||||
|
|
@ -75,7 +75,7 @@ If you feel that this project is helpful to you, please Star on the project, we
|
|||
|
||||
<ItemGroup>
|
||||
<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="EntityFrameworkCore.BootKit" Version="1.9.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="2.1.1" />
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@ namespace BotSharp.Core.Engines
|
|||
|
||||
public String Label { get; set; }
|
||||
|
||||
public Decimal Confidence { get; set; }
|
||||
public double Confidence { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ namespace BotSharp.Core.Modules
|
|||
/// </summary>
|
||||
public class ModuleOptions
|
||||
{
|
||||
public ModuleOptions()
|
||||
{
|
||||
Path = String.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Module name
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ namespace BotSharp.Core.Modules
|
|||
/// </summary>
|
||||
public class ModulesOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Module base directory
|
||||
/// </summary>
|
||||
public String ModuleBasePath { get; set; }
|
||||
public ModulesOptions()
|
||||
{
|
||||
Modules = new List<ModuleOptions>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of module configurations.
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Platforms>AnyCPU;x64</Platforms>
|
||||
<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.
|
||||
|
||||
BotSharp.NLP has implemented below machine learning algorithms:
|
||||
|
|
@ -42,6 +42,10 @@ Naive Bayes Classifier</Description>
|
|||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bigtree.Algorithm" Version="0.1.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
|
|
|
|||
|
|
@ -131,8 +131,8 @@ namespace BotSharp.NLP.Classify
|
|||
|
||||
public List<Node[]> GetData(List<Sentence> 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)
|
||||
|
|
|
|||
|
|
@ -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]+$");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Version>0.1.0</Version>
|
||||
<Version>0.2.0</Version>
|
||||
<RepositoryUrl>https://github.com/Oceania2018/BotSharp</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@ namespace BotSharp.Platform.Abstraction
|
|||
|
||||
Task<ModelMetaData> Train(TAgent agent, TrainingCorpus corpus, BotTrainOptions options);
|
||||
|
||||
Task<AiResponse> TextRequest(AiRequest request);
|
||||
Task<TResult> TextRequest<TResult>(AiRequest request);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Version>0.1.0</Version>
|
||||
<Version>0.2.0</Version>
|
||||
<PackageProjectUrl>https://github.com/Oceania2018/BotSharp</PackageProjectUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
// if you want to override platform setting, please set corresponding value, otherwise you don't need this section.
|
||||
"dialogflowAi": {
|
||||
"botEngine": "BotSharpNLU",
|
||||
"agentStorage": "AgentStorageInMemory"
|
||||
"agentStorage": "AgentStorageInRedis"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,27 +8,22 @@
|
|||
"dataDir": "D:\\Projects\\BotSharp\\Data"
|
||||
},
|
||||
|
||||
"moduleBasePath": "C:\\Users\\haipi\\Documents\\Projects",
|
||||
"modules": [
|
||||
{
|
||||
"Name": "DialogflowAi",
|
||||
"Type": "BotSharp.Platform.Dialogflow",
|
||||
"Path": "botsharp-dialogflow\\BotSharp.Platform.Dialogflow\\bin\\Debug\\netcoreapp2.1"
|
||||
} /*,
|
||||
"Type": "BotSharp.Platform.Dialogflow"
|
||||
},
|
||||
{
|
||||
"Name": "WeixinChannel",
|
||||
"Type": "BotSharp.Channel.Weixin",
|
||||
"Path": "botsharp-channel-weixin\\BotSharp.Channel.Weixin\\bin\\Debug\\netcoreapp2.1"
|
||||
},
|
||||
"Type": "BotSharp.Channel.Weixin"
|
||||
}/*,
|
||||
{
|
||||
"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"
|
||||
}*/
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue