come accross the loading corpus problem in GetIntentExpressions
This commit is contained in:
parent
4666fd1e8f
commit
c6ea723976
|
|
@ -46,15 +46,16 @@ namespace BotSharp.Core.Engines
|
|||
// Get NLP Provider
|
||||
var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration");
|
||||
var assemblies = (string[])AppDomain.CurrentDomain.GetData("Assemblies");
|
||||
string providerName = config.GetSection($"{config}:Provider").Value;
|
||||
var platform = config.GetSection($"BotPlatform").Value;
|
||||
string providerName = config.GetSection($"{platform}:Provider").Value;
|
||||
var provider = TypeHelper.GetInstance(providerName, assemblies) as INlpPipeline;
|
||||
provider.Configuration = config.GetSection("BotSharpAi");
|
||||
provider.Configuration = config.GetSection(platform);
|
||||
provider.Process(agent, data);
|
||||
|
||||
//var corpus = agent.GrabCorpus(dc);
|
||||
|
||||
// pipe process
|
||||
var pipelines = config.GetSection($"{config}:Pipe").Value
|
||||
var pipelines = provider.Configuration.GetSection($"Pipe").Value
|
||||
.Split(',')
|
||||
.Select(x => x.Trim())
|
||||
.ToList();
|
||||
|
|
|
|||
|
|
@ -37,6 +37,21 @@ namespace BotSharp.RestApi
|
|||
return Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restore a agent from a uploaded zip file
|
||||
/// </summary>
|
||||
/// <param name="agentId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{agentId}")]
|
||||
public string Train([FromRoute] String agentId)
|
||||
{
|
||||
var ai = new BotSharpAi();
|
||||
ai.LoadAgent("bff7605c-3db5-44dc-9ba7-1c9be2832318");
|
||||
ai.Train();
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dump agent
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"Assemblies": "BotSharp.Core",
|
||||
"BotPlatform": "ApiAi"
|
||||
"BotPlatform": "BotSharpAi"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue