Merge branch 'master' of https://github.com/Oceania2018/BotSharp
This commit is contained in:
commit
fd8f6204e6
|
|
@ -178,5 +178,12 @@ namespace BotSharp.Core.Engines
|
||||||
|
|
||||||
return corpus;
|
return corpus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void Train()
|
||||||
|
{
|
||||||
|
var trainer = new BotTrainer(agent.Id, dc);
|
||||||
|
trainer.Train(agent);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ namespace BotSharp.Core.Engines.BotSharp
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Train()
|
public override void Train()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using BotSharp.Core.Engines;
|
using BotSharp.Core.Engines;
|
||||||
|
using BotSharp.Core.Engines.BotSharp;
|
||||||
using BotSharp.Core.Models;
|
using BotSharp.Core.Models;
|
||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -13,13 +14,9 @@ namespace BotSharp.UnitTest
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void TrainingTest()
|
public void TrainingTest()
|
||||||
{
|
{
|
||||||
var config = new AIConfiguration("", SupportedLanguage.English) { AgentId = BOT_ID };
|
var ai = new BotSharpAi();
|
||||||
config.SessionId = Guid.NewGuid().ToString();
|
ai.LoadAgent(BOT_ID);
|
||||||
|
ai.Train();
|
||||||
var rasa = new RasaAi();
|
|
||||||
|
|
||||||
var trainer = new BotTrainer(BOT_ID, dc);
|
|
||||||
trainer.Train(rasa.LoadAgent(BOT_ID));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ namespace BotSharp.UnitTest
|
||||||
|
|
||||||
public TestEssential()
|
public TestEssential()
|
||||||
{
|
{
|
||||||
contentRoot = $"{Directory.GetCurrentDirectory()}\\..\\..\\..\\..\\BotSharp.WebHost\\";
|
contentRoot = $"{Directory.GetCurrentDirectory()}{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}BotSharp.WebHost{Path.DirectorySeparatorChar}";
|
||||||
|
|
||||||
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
|
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder();
|
||||||
var settings = Directory.GetFiles(contentRoot + $"{Path.DirectorySeparatorChar}Settings{Path.DirectorySeparatorChar}", "*.json");
|
var settings = Directory.GetFiles(contentRoot + $"Settings{Path.DirectorySeparatorChar}", "*.json");
|
||||||
settings.ToList().ForEach(setting =>
|
settings.ToList().ForEach(setting =>
|
||||||
{
|
{
|
||||||
configurationBuilder.AddJsonFile(setting, optional: false, reloadOnChange: true);
|
configurationBuilder.AddJsonFile(setting, optional: false, reloadOnChange: true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue