Skip to content

come accross the loading corpus problem in GetIntentExpressions #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions BotSharp.Core/Engines/BotTrainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ public string Train(Agent agent)
// 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();
Expand Down
15 changes: 15 additions & 0 deletions BotSharp.RestApi/AgentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ public ActionResult Restore([FromRoute] String agentId)
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>
Expand Down
2 changes: 1 addition & 1 deletion BotSharp.WebHost/Settings/app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"Assemblies": "BotSharp.Core",
"BotPlatform": "ApiAi"
"BotPlatform": "BotSharpAi"
}