diff --git a/BotSharp.Core/Abstractions/INlpPipeline.cs b/BotSharp.Core/Abstractions/INlpPipeline.cs index 09e98807..68112a6d 100644 --- a/BotSharp.Core/Abstractions/INlpPipeline.cs +++ b/BotSharp.Core/Abstractions/INlpPipeline.cs @@ -25,10 +25,10 @@ namespace BotSharp.Core.Abstractions /// Process /// /// - /// Intermediate result + /// Intermediate result /// Meta data which is packed to model /// - Task Train(Agent agent, JObject data, PipeModel meta); - Task Predict(Agent agent, JObject data, PipeModel meta); + Task Train(Agent agent, NlpDoc doc, PipeModel meta); + Task Predict(Agent agent, NlpDoc doc, PipeModel meta); } } diff --git a/BotSharp.Core/BotSharp.Core.csproj b/BotSharp.Core/BotSharp.Core.csproj index 39d13d25..b978fb49 100644 --- a/BotSharp.Core/BotSharp.Core.csproj +++ b/BotSharp.Core/BotSharp.Core.csproj @@ -35,6 +35,7 @@ + @@ -42,7 +43,6 @@ - diff --git a/BotSharp.Core/Engines/BotEngineBase.cs b/BotSharp.Core/Engines/BotEngineBase.cs index c5854450..6b7072d8 100644 --- a/BotSharp.Core/Engines/BotEngineBase.cs +++ b/BotSharp.Core/Engines/BotEngineBase.cs @@ -2,6 +2,7 @@ using BotSharp.Core.Entities; using BotSharp.Core.Intents; using BotSharp.Core.Models; +using BotSharp.MachineLearning.NLP; using EntityFrameworkCore.BootKit; using Microsoft.EntityFrameworkCore; using Newtonsoft.Json; @@ -37,8 +38,28 @@ namespace BotSharp.Core.Engines public AIResponse TextRequest(AIRequest request) { var preditor = new BotPreditor(); - var text = preditor.Predict(agent, request); - return null; + var doc = preditor.Predict(agent, request).Result; + var parameters = new Dictionary(); + doc.Sentences[0].Entities.ForEach(x => parameters.Add(x.Entity, x.Value)); + + return new AIResponse + { + Lang = request.Language, + Timestamp = DateTime.UtcNow, + SessionId = request.SessionId, + Status = new AIResponseStatus(), + Result = new AIResponseResult + { + Score = doc.Sentences[0].Intent.Confidence, + ResolvedQuery = doc.Sentences[0].Text, + Fulfillment = new AIResponseFulfillment { }, + Parameters = parameters, + Metadata = new AIResponseMetadata + { + IntentName = doc.Sentences[0].Intent.Label + } + } + }; } public Agent LoadAgent(string id) diff --git a/BotSharp.Core/Engines/BotPreditor.cs b/BotSharp.Core/Engines/BotPreditor.cs index 6feb5855..d8345d61 100644 --- a/BotSharp.Core/Engines/BotPreditor.cs +++ b/BotSharp.Core/Engines/BotPreditor.cs @@ -5,6 +5,7 @@ using DotNetToolkit; using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Serialization; using System; using System.Collections.Generic; using System.IO; @@ -16,7 +17,7 @@ namespace BotSharp.Core.Engines { public class BotPreditor { - public async Task Predict(Agent agent, AIRequest request) + public async Task Predict(Agent agent, AIRequest request) { // load model var dir = Path.Join(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "ModelFiles", agent.Id); @@ -32,10 +33,16 @@ namespace BotSharp.Core.Engines var provider = TypeHelper.GetInstance(providerPipe.Name, assemblies) as INlpPipeline; provider.Configuration = config.GetSection(meta.Platform); - var data = JObject.FromObject(new + var data = new NlpDoc { - Text = request.Query.FirstOrDefault() - }); + Sentences = new List + { + new NlpDocSentence + { + Text = request.Query.FirstOrDefault() + } + } + }; await provider.Train(agent, data, providerPipe); meta.Pipeline.RemoveAt(0); @@ -51,7 +58,7 @@ namespace BotSharp.Core.Engines { Directory.CreateDirectory(settings.PredictDir); } - + // pipe process meta.Pipeline.ForEach(async pipeMeta => { @@ -61,7 +68,14 @@ namespace BotSharp.Core.Engines await pipe.Predict(agent, data, pipeMeta); }); - return ""; + Console.WriteLine(JsonConvert.SerializeObject(data, new JsonSerializerSettings + { + Formatting = Formatting.Indented, + NullValueHandling = NullValueHandling.Ignore, + ContractResolver = new CamelCasePropertyNamesContractResolver() + })); + + return data; } } } diff --git a/BotSharp.Core/Engines/BotTrainer.cs b/BotSharp.Core/Engines/BotTrainer.cs index 1dd1986c..7f2b1364 100644 --- a/BotSharp.Core/Engines/BotTrainer.cs +++ b/BotSharp.Core/Engines/BotTrainer.cs @@ -40,9 +40,7 @@ namespace BotSharp.Core.Engines .Where(x => x.AgentId == agentId) .ToList(); - var data = JObject.FromObject(new - { - }); + var data = new NlpDoc(); // Get NLP Provider var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); diff --git a/BotSharp.Core/Engines/CRFsuite/CRFsuiteEntityRecognizer.cs b/BotSharp.Core/Engines/CRFsuite/CRFsuiteEntityRecognizer.cs index aee09b85..d5bbae28 100644 --- a/BotSharp.Core/Engines/CRFsuite/CRFsuiteEntityRecognizer.cs +++ b/BotSharp.Core/Engines/CRFsuite/CRFsuiteEntityRecognizer.cs @@ -10,6 +10,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading; @@ -22,14 +23,13 @@ namespace BotSharp.Core.Engines.CRFsuite public IConfiguration Configuration { get; set; } public PipeSettings Settings { get; set; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { var dc = new DefaultDataContextLoader().GetDefaultDc(); var corpus = agent.Corpus; meta.Model = "ner-crf.model"; - List> tokens = data["Tokens"].ToObject>>(); List> userSays = corpus.UserSays; List> list = new List>(); @@ -41,9 +41,9 @@ namespace BotSharp.Core.Engines.CRFsuite { using (StreamWriter sw = new StreamWriter(fs)) { - for (int i = 0; i < tokens.Count; i++) + for (int i = 0; i < doc.Sentences.Count; i++) { - List curLine = Merge(tokens[i], userSays[i].Entities); + List curLine = Merge(doc.Sentences[i].Tokens, userSays[i].Entities); curLine.ForEach(trainingData => { string[] wordParams = { trainingData.Entity, trainingData.Token, trainingData.Pos, trainingData.Chunk }; @@ -134,14 +134,12 @@ namespace BotSharp.Core.Engines.CRFsuite return trainingTuple; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { - List> tokens = data["Tokens"].ToObject>>(); var uniFeatures = meta.Meta["uniFeatures"].ToString(); var biFeatures = meta.Meta["biFeatures"].ToString(); string field = meta.Meta["fields"].ToString(); string[] fields = field.Split(" "); - string rawPredictingDataFileName = Path.Join(Settings.PredictDir, "ner-crf.corpus.predict.txt"); string parsedPredictingDataFileName = Path.Join(Settings.PredictDir, "ner-crf.parsed.predict.txt"); @@ -152,9 +150,9 @@ namespace BotSharp.Core.Engines.CRFsuite using (StreamWriter sw = new StreamWriter(fs)) { List curLine = new List(); - foreach (List tokenList in tokens) + foreach (NlpDocSentence sentence in doc.Sentences) { - foreach (NlpToken token in tokenList) + foreach (NlpToken token in sentence.Tokens) { for (int i = 0 ; i < fields.Length; i++) { @@ -180,29 +178,30 @@ namespace BotSharp.Core.Engines.CRFsuite sw.Flush(); } } + new MachineLearning.CRFsuite.Ner() .NerStart(rawPredictingDataFileName, parsedPredictingDataFileName, field, uniFeatures.Split(" "), biFeatures.Split(" ")); var output = CmdHelper.Run(Path.Join(Settings.AlgorithmDir, "crfsuite"), $"tag -i -m {modelFileName} {parsedPredictingDataFileName}", false); var entities = new List(); - // - string[] entityProbabilityPairs = output.Split("\r"); - for (int i = 0 ; i < entityProbabilityPairs.Length ; i++) + + string[] entityProbabilityPairs = output.Split(Environment.NewLine).Where(x => !String.IsNullOrEmpty(x)).ToArray(); + for (int i = 0; i < entityProbabilityPairs.Length; i++) { string entityProbabilityPair = entityProbabilityPairs[i]; string entity = entityProbabilityPair.Split(":")[0]; decimal probability = decimal.Parse(entityProbabilityPair.Split(":")[1]); - NlpEntity nlpentity = new NlpEntity(); - nlpentity.Entity = entity; - nlpentity.Value = tokens[0][i].Text; - nlpentity.Confidence = probability; - entities.Add(nlpentity); + entities.Add(new NlpEntity + { + Entity = entity, + Value = doc.Sentences[0].Tokens[i].Text, + Confidence = probability + }); } + + doc.Sentences[0].Entities = entities.Where(x => x.Entity != "O").ToList(); - - - data["entities"] = JObject.FromObject(entities); if(File.Exists(rawPredictingDataFileName)) { File.Delete(rawPredictingDataFileName); @@ -211,6 +210,7 @@ namespace BotSharp.Core.Engines.CRFsuite { File.Delete(parsedPredictingDataFileName); } + return true; } } diff --git a/BotSharp.Core/Engines/Classifiers/FasttextClassifier.cs b/BotSharp.Core/Engines/Classifiers/FasttextClassifier.cs index 9383fcf5..7de0432e 100644 --- a/BotSharp.Core/Engines/Classifiers/FasttextClassifier.cs +++ b/BotSharp.Core/Engines/Classifiers/FasttextClassifier.cs @@ -17,18 +17,26 @@ namespace BotSharp.Core.Engines.Classifiers public PipeSettings Settings { get; set; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { string modelFileName = Path.Join(Settings.ModelDir, meta.Model); - string predictFileName = Path.Join(Settings.PredictDir, "test.txt"); - var output = CmdHelper.Run(Path.Join(Settings.AlgorithmDir, "fasttext"), $"predict-prob {modelFileName}.bin {predictFileName}", false); + string predictFileName = Path.Join(Settings.PredictDir, "fasttext.txt"); + File.WriteAllText(predictFileName, doc.Sentences[0].Text); - data["Intent"] = JObject.FromObject(new { Name = output.Split(' ')[0].Split("__label__")[1], Confidence = output.Split(' ')[1] }); + var output = CmdHelper.Run(Path.Join(Settings.AlgorithmDir, "fasttext"), $"predict-prob {modelFileName}.bin {predictFileName}"); + + File.Delete(predictFileName); + + doc.Sentences[0].Intent = new TextClassificationResult + { + Label = output.Split(' ')[0].Split("__label__")[1], + Confidence = decimal.Parse(output.Split(' ')[1]) + }; return true; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { meta.Model = "classification-fasttext.model"; diff --git a/BotSharp.Core/Engines/NlpDoc.cs b/BotSharp.Core/Engines/NlpDoc.cs new file mode 100644 index 00000000..2e69a536 --- /dev/null +++ b/BotSharp.Core/Engines/NlpDoc.cs @@ -0,0 +1,20 @@ +using BotSharp.MachineLearning.NLP; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.Core.Engines +{ + public class NlpDoc + { + public List Sentences { get; set; } + } + + public class NlpDocSentence + { + public string Text { get; set; } + public List Tokens { get; set; } + public List Entities { get; set; } + public TextClassificationResult Intent { get; set; } + } +} diff --git a/BotSharp.Core/Engines/SpaCy/SpaCyEntitizer.cs b/BotSharp.Core/Engines/SpaCy/SpaCyEntitizer.cs index dba99988..172fbe6b 100644 --- a/BotSharp.Core/Engines/SpaCy/SpaCyEntitizer.cs +++ b/BotSharp.Core/Engines/SpaCy/SpaCyEntitizer.cs @@ -17,12 +17,12 @@ namespace BotSharp.Core.Engines.SpaCy public IConfiguration Configuration { get; set; } public PipeSettings Settings { get; set; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { return true; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { var client = new RestClient(Configuration.GetSection("SpaCyProvider:Url").Value); var request = new RestRequest("entitize", Method.GET); diff --git a/BotSharp.Core/Engines/SpaCy/SpaCyEntityRecognizer.cs b/BotSharp.Core/Engines/SpaCy/SpaCyEntityRecognizer.cs index 328583d9..0432e00e 100644 --- a/BotSharp.Core/Engines/SpaCy/SpaCyEntityRecognizer.cs +++ b/BotSharp.Core/Engines/SpaCy/SpaCyEntityRecognizer.cs @@ -19,7 +19,7 @@ namespace BotSharp.Core.Engines.SpaCy public IConfiguration Configuration { get; set; } public PipeSettings Settings { get; set; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { String modelPath = "./entity_rec_output"; String newModelName = "test"; @@ -52,12 +52,10 @@ namespace BotSharp.Core.Engines.SpaCy var response = client.Execute(request); - data["EntityModelTrained"] = response.Data.EntityModelTrained; - return true; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { return true; } diff --git a/BotSharp.Core/Engines/SpaCy/SpaCyProvider.cs b/BotSharp.Core/Engines/SpaCy/SpaCyProvider.cs index 38b5dd27..2bdb44c8 100644 --- a/BotSharp.Core/Engines/SpaCy/SpaCyProvider.cs +++ b/BotSharp.Core/Engines/SpaCy/SpaCyProvider.cs @@ -17,7 +17,7 @@ namespace BotSharp.Core.Engines.SpaCy public IConfiguration Configuration { get; set; } public PipeSettings Settings { get; set; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { var client = new RestClient(Configuration.GetSection("SpaCyProvider:Url").Value); var request = new RestRequest("load", Method.GET); @@ -30,7 +30,7 @@ namespace BotSharp.Core.Engines.SpaCy return response.IsSuccessful; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { return true; } diff --git a/BotSharp.Core/Engines/SpaCy/SpaCyTagger.cs b/BotSharp.Core/Engines/SpaCy/SpaCyTagger.cs index bd372e71..0409e12a 100644 --- a/BotSharp.Core/Engines/SpaCy/SpaCyTagger.cs +++ b/BotSharp.Core/Engines/SpaCy/SpaCyTagger.cs @@ -17,7 +17,7 @@ namespace BotSharp.Core.Engines.SpaCy public IConfiguration Configuration { get; set; } public PipeSettings Settings { get; set; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { var client = new RestClient(Configuration.GetSection("SpaCyProvider:Url").Value); var request = new RestRequest("tagger", Method.GET); @@ -32,12 +32,11 @@ namespace BotSharp.Core.Engines.SpaCy tags.Add(response.Data.Tags); res = res && response.IsSuccessful; }); - data.Add("Tags", JToken.FromObject(tags)); - + return res; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { return true; } diff --git a/BotSharp.Core/Engines/SpaCy/SpaCyTextCategorizer.cs b/BotSharp.Core/Engines/SpaCy/SpaCyTextCategorizer.cs index 48bbf845..0154098c 100644 --- a/BotSharp.Core/Engines/SpaCy/SpaCyTextCategorizer.cs +++ b/BotSharp.Core/Engines/SpaCy/SpaCyTextCategorizer.cs @@ -18,7 +18,7 @@ namespace BotSharp.Core.Engines.SpaCy public IConfiguration Configuration { get; set; } public PipeSettings Settings { get; set; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { //var input = new List>(); @@ -54,17 +54,10 @@ namespace BotSharp.Core.Engines.SpaCy var response = client.Execute(request); - data["ModelName"] = response.Data.ModelName; - /* - //Predict - var request2 = new RestRequest("predict", Method.GET); - request2.AddParameter("text", "the roof is leaking"); - var response2 = client.Execute(request2); - */ return true; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { return true; } diff --git a/BotSharp.Core/Engines/SpaCy/SpaCyTokenizer.cs b/BotSharp.Core/Engines/SpaCy/SpaCyTokenizer.cs index ca45062a..25672ffd 100644 --- a/BotSharp.Core/Engines/SpaCy/SpaCyTokenizer.cs +++ b/BotSharp.Core/Engines/SpaCy/SpaCyTokenizer.cs @@ -19,7 +19,7 @@ namespace BotSharp.Core.Engines.SpaCy public IConfiguration Configuration { get; set; } public PipeSettings Settings { get; set; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { var client = new RestClient(Configuration.GetSection("SpaCyProvider:Url").Value); var request = new RestRequest("tokenizer", Method.GET); @@ -28,6 +28,8 @@ namespace BotSharp.Core.Engines.SpaCy var dc = new DefaultDataContextLoader().GetDefaultDc(); var corpus = agent.Corpus; + doc.Sentences = new List(); + corpus.UserSays.ForEach(usersay => { Console.WriteLine(usersay.Text); request.AddParameter("text", usersay.Text); @@ -35,16 +37,20 @@ namespace BotSharp.Core.Engines.SpaCy tokens.Add(response.Data.Tokens); + doc.Sentences.Add(new NlpDocSentence + { + Tokens = response.Data.Tokens, + Text = usersay.Text + }); + res = res && response.IsSuccessful; }); - data.Add("Tokens", JToken.FromObject(tokens)); - return res; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { var client = new RestClient(Configuration.GetSection("SpaCyProvider:Url").Value); var request = new RestRequest("tokenizer", Method.GET); @@ -52,15 +58,14 @@ namespace BotSharp.Core.Engines.SpaCy Boolean res = true; var corpus = agent.Corpus; - request.AddParameter("text", data["Text"]); + request.AddParameter("text", doc.Sentences[0].Text); var response = client.Execute(request); tokens.Add(response.Data.Tokens); res = res && response.IsSuccessful; - - data.Add("Tokens", JToken.FromObject(tokens)); + doc.Sentences[0].Tokens = tokens[0]; return true; } diff --git a/BotSharp.Core/Engines/SpaCy/SpacyFeaturizer.cs b/BotSharp.Core/Engines/SpaCy/SpacyFeaturizer.cs index 6aaa30d1..f6888b41 100644 --- a/BotSharp.Core/Engines/SpaCy/SpacyFeaturizer.cs +++ b/BotSharp.Core/Engines/SpaCy/SpacyFeaturizer.cs @@ -16,7 +16,7 @@ namespace BotSharp.Core.Engines.SpaCy public IConfiguration Configuration { get; set; } public PipeSettings Settings { get; set; } - public async Task Train(Agent agent, JObject data, PipeModel meta) + public async Task Train(Agent agent, NlpDoc doc, PipeModel meta) { var client = new RestClient(Configuration.GetSection("SpaCyProvider:Url").Value); var request = new RestRequest("featurize", Method.GET); @@ -32,12 +32,12 @@ namespace BotSharp.Core.Engines.SpaCy res = res && response.IsSuccessful; });*/ - data.Add("Features", JToken.FromObject(vectors)); + // data.Add("Features", JToken.FromObject(vectors)); return res; } - public async Task Predict(Agent agent, JObject data, PipeModel meta) + public async Task Predict(Agent agent, NlpDoc doc, PipeModel meta) { return true; } diff --git a/BotSharp.Core/Engines/TextClassificationResult.cs b/BotSharp.Core/Engines/TextClassificationResult.cs new file mode 100644 index 00000000..91273f89 --- /dev/null +++ b/BotSharp.Core/Engines/TextClassificationResult.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.Core.Engines +{ + public class TextClassificationResult + { + public String Label { get; set; } + + public Decimal Confidence { get; set; } + } +} diff --git a/BotSharp.MachineLearning/CRFsuite/Crfutils.cs b/BotSharp.MachineLearning/CRFsuite/Crfutils.cs index f725ef1d..eb1adcfd 100644 --- a/BotSharp.MachineLearning/CRFsuite/Crfutils.cs +++ b/BotSharp.MachineLearning/CRFsuite/Crfutils.cs @@ -67,30 +67,32 @@ namespace BotSharp.MachineLearning.CRFsuite { List>> Xs = new List>>(); List> X = new List>(); - StreamReader sr = new StreamReader(fiPath, Encoding.Default); - string line; - while ((line = sr.ReadLine()) != null) + using (StreamReader sr = new StreamReader(fiPath, Encoding.Default)) { - line = line.Replace("\n",""); - if (line == null || line.Length == 0) + string line; + while ((line = sr.ReadLine()) != null) { - Xs.Add(new List>(X)); - X.Clear(); - } - else - { - String[] fields = line.Split(sep); - if (fields.Count() < names.Count) + line = line.Replace("\n", ""); + if (line == null || line.Length == 0) { - // Error Exception + Xs.Add(new List>(X)); + X.Clear(); } - Dictionary item = new Dictionary(); - item.Add("F", new List()); - for (int i = 0 ; i < names.Count ; i++) + else { - item.Add(names[i], fields[i]); + String[] fields = line.Split(sep); + if (fields.Count() < names.Count) + { + // Error Exception + } + Dictionary item = new Dictionary(); + item.Add("F", new List()); + for (int i = 0; i < names.Count; i++) + { + item.Add(names[i], fields[i]); + } + X.Add(item); } - X.Add(item); } } return Xs; @@ -135,25 +137,27 @@ namespace BotSharp.MachineLearning.CRFsuite /// an extractor which to do the feature extracting work /// attributes name seperated by space /// string whihch seperated by - public void CRFFileGenerator (System.Action>> FeatureExtractor, string fields, string rawFile, string parsedName, string sep= " ") + public void CRFFileGenerator(System.Action>> FeatureExtractor, string fields, string rawFile, string parsedName, string sep = " ") { - FileStream fs = new FileStream(parsedName, FileMode.Create); - StreamWriter sw = new StreamWriter(fs); - List F = fields.Split(" ").ToList(); - List>> Xs = Readiter(rawFile, F, " "); - - foreach (List> X in Xs) + using (FileStream fs = new FileStream(parsedName, FileMode.Create)) { - if (X.Any(x => x["w"].ToString() == "")) + using (StreamWriter sw = new StreamWriter(fs)) { + List F = fields.Split(" ").ToList(); + List>> Xs = Readiter(rawFile, F, " "); + foreach (List> X in Xs) + { + if (X.Any(x => x["w"].ToString() == "")) + { + + } + FeatureExtractor(X); + OutputFeatures(sw, X, "y"); + } + sw.Flush(); } - FeatureExtractor(X); - OutputFeatures(sw, X, "y"); } - sw.Flush(); - sw.Close(); - fs.Close(); } } } \ No newline at end of file diff --git a/BotSharp.WebHost/Program.cs b/BotSharp.WebHost/Program.cs index 5fd67be8..19cc1605 100644 --- a/BotSharp.WebHost/Program.cs +++ b/BotSharp.WebHost/Program.cs @@ -27,7 +27,7 @@ namespace BotSharp.WebHost config.AddJsonFile(setting, optional: false, reloadOnChange: true); }); }) - .UseUrls("http://0.0.0.0:3116") + .UseUrls("http://0.0.0.0:3112") .UseStartup() .Build(); } diff --git a/BotSharp.WebHost/crfsuite.exe b/BotSharp.WebHost/crfsuite.exe deleted file mode 100644 index 74c7ad44..00000000 Binary files a/BotSharp.WebHost/crfsuite.exe and /dev/null differ diff --git a/BotSharp.WebHost/ner-crf.corpus.predict.txt b/BotSharp.WebHost/ner-crf.corpus.predict.txt deleted file mode 100644 index 33dadcc5..00000000 --- a/BotSharp.WebHost/ner-crf.corpus.predict.txt +++ /dev/null @@ -1,10 +0,0 @@ - when WRB - when WRB is VBZ - when WRB is VBZ the DT - when WRB is VBZ the DT next JJ - when WRB is VBZ the DT next JJ train NN - when WRB is VBZ the DT next JJ train NN in IN - when WRB is VBZ the DT next JJ train NN in IN muncher NN - when WRB is VBZ the DT next JJ train NN in IN muncher NN freiheit NN - when WRB is VBZ the DT next JJ train NN in IN muncher NN freiheit NN ? . - diff --git a/BotSharp.WebHost/ner-crf.parsed.predict.txt b/BotSharp.WebHost/ner-crf.parsed.predict.txt deleted file mode 100644 index aea6d1e2..00000000 --- a/BotSharp.WebHost/ner-crf.parsed.predict.txt +++ /dev/null @@ -1,10 +0,0 @@ - w[0]=when w[1]=when w[2]=when wl[0]=when wl[1]=when wl[2]=when pos[0]=WRB pos[1]=WRB pos[2]=WRB chk[0]= chk[1]= chk[2]= shape[0]=LLLL shape[1]=LLLL shape[2]=LLLL shaped[0]=L shaped[1]=L shaped[2]=L type[0]=AllLetter type[1]=AllLetter type[2]=AllLetter p1[0]=w p1[1]=w p1[2]=w p2[0]=wh p2[1]=wh p2[2]=wh p3[0]=whe p3[1]=whe p3[2]=whe p4[0]=when p4[1]=when p4[2]=when s1[0]=n s1[1]=n s1[2]=n s2[0]=en s2[1]=en s2[2]=en s3[0]=hen s3[1]=hen s3[2]=hen s4[0]=when s4[1]=when s4[2]=when 2d[0]=no 2d[1]=no 2d[2]=no 4d[0]=no 4d[1]=no 4d[2]=no d&a[0]=no d&a[1]=no d&a[2]=no d&-[0]=no d&-[1]=no d&-[2]=no d&/[0]=no d&/[1]=no d&/[2]=no d&,[0]=no d&,[1]=no d&,[2]=no d&.[0]=no d&.[1]=no d&.[2]=no up[0]=no up[1]=no up[2]=no iu[0]=no iu[1]=no iu[2]=no au[0]=no au[1]=no au[2]=no al[0]=yes al[1]=yes al[2]=yes ad[0]=no ad[1]=no ad[2]=no ao[0]=no ao[1]=no ao[2]=no cu[0]=no cu[1]=no cu[2]=no cl[0]=yes cl[1]=yes cl[2]=yes ca[0]=yes ca[1]=yes ca[2]=yes cd[0]=no cd[1]=no cd[2]=no cs[0]=no cs[1]=no cs[2]=no w[0]|w[1]=when|when w[1]|w[2]=when|when pos[0]|pos[1]=WRB|WRB pos[1]|pos[2]=WRB|WRB chk[0]|chk[1]=| chk[1]|chk[2]=| shaped[0]|shaped[1]=L|L shaped[1]|shaped[2]=L|L type[0]|type[1]=AllLetter|AllLetter type[1]|type[2]=AllLetter|AllLetter w[1..4]=when w[1..4]=when w[1..4]=when w[1..4]=when __BOS__ - w[-1]=when w[0]=when w[1]=when w[2]=when wl[-1]=when wl[0]=when wl[1]=when wl[2]=when pos[-1]=WRB pos[0]=WRB pos[1]=WRB pos[2]=WRB chk[-1]= chk[0]= chk[1]= chk[2]= shape[-1]=LLLL shape[0]=LLLL shape[1]=LLLL shape[2]=LLLL shaped[-1]=L shaped[0]=L shaped[1]=L shaped[2]=L type[-1]=AllLetter type[0]=AllLetter type[1]=AllLetter type[2]=AllLetter p1[-1]=w p1[0]=w p1[1]=w p1[2]=w p2[-1]=wh p2[0]=wh p2[1]=wh p2[2]=wh p3[-1]=whe p3[0]=whe p3[1]=whe p3[2]=whe p4[-1]=when p4[0]=when p4[1]=when p4[2]=when s1[-1]=n s1[0]=n s1[1]=n s1[2]=n s2[-1]=en s2[0]=en s2[1]=en s2[2]=en s3[-1]=hen s3[0]=hen s3[1]=hen s3[2]=hen s4[-1]=when s4[0]=when s4[1]=when s4[2]=when 2d[-1]=no 2d[0]=no 2d[1]=no 2d[2]=no 4d[-1]=no 4d[0]=no 4d[1]=no 4d[2]=no d&a[-1]=no d&a[0]=no d&a[1]=no d&a[2]=no d&-[-1]=no d&-[0]=no d&-[1]=no d&-[2]=no d&/[-1]=no d&/[0]=no d&/[1]=no d&/[2]=no d&,[-1]=no d&,[0]=no d&,[1]=no d&,[2]=no d&.[-1]=no d&.[0]=no d&.[1]=no d&.[2]=no up[-1]=no up[0]=no up[1]=no up[2]=no iu[-1]=no iu[0]=no iu[1]=no iu[2]=no au[-1]=no au[0]=no au[1]=no au[2]=no al[-1]=yes al[0]=yes al[1]=yes al[2]=yes ad[-1]=no ad[0]=no ad[1]=no ad[2]=no ao[-1]=no ao[0]=no ao[1]=no ao[2]=no cu[-1]=no cu[0]=no cu[1]=no cu[2]=no cl[-1]=yes cl[0]=yes cl[1]=yes cl[2]=yes ca[-1]=yes ca[0]=yes ca[1]=yes ca[2]=yes cd[-1]=no cd[0]=no cd[1]=no cd[2]=no cs[-1]=no cs[0]=no cs[1]=no cs[2]=no w[-1]|w[0]=when|when w[0]|w[1]=when|when w[1]|w[2]=when|when pos[-1]|pos[0]=WRB|WRB pos[0]|pos[1]=WRB|WRB pos[1]|pos[2]=WRB|WRB chk[-1]|chk[0]=| chk[0]|chk[1]=| chk[1]|chk[2]=| shaped[-1]|shaped[0]=L|L shaped[0]|shaped[1]=L|L shaped[1]|shaped[2]=L|L type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllLetter type[1]|type[2]=AllLetter|AllLetter w[-4..-1]=when w[1..4]=when w[1..4]=when w[1..4]=when w[1..4]=when - w[-2]=when w[-1]=when w[0]=when w[1]=when w[2]=when wl[-2]=when wl[-1]=when wl[0]=when wl[1]=when wl[2]=when pos[-2]=WRB pos[-1]=WRB pos[0]=WRB pos[1]=WRB pos[2]=WRB chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLLL shape[-1]=LLLL shape[0]=LLLL shape[1]=LLLL shape[2]=LLLL shaped[-2]=L shaped[-1]=L shaped[0]=L shaped[1]=L shaped[2]=L type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter type[1]=AllLetter type[2]=AllLetter p1[-2]=w p1[-1]=w p1[0]=w p1[1]=w p1[2]=w p2[-2]=wh p2[-1]=wh p2[0]=wh p2[1]=wh p2[2]=wh p3[-2]=whe p3[-1]=whe p3[0]=whe p3[1]=whe p3[2]=whe p4[-2]=when p4[-1]=when p4[0]=when p4[1]=when p4[2]=when s1[-2]=n s1[-1]=n s1[0]=n s1[1]=n s1[2]=n s2[-2]=en s2[-1]=en s2[0]=en s2[1]=en s2[2]=en s3[-2]=hen s3[-1]=hen s3[0]=hen s3[1]=hen s3[2]=hen s4[-2]=when s4[-1]=when s4[0]=when s4[1]=when s4[2]=when 2d[-2]=no 2d[-1]=no 2d[0]=no 2d[1]=no 2d[2]=no 4d[-2]=no 4d[-1]=no 4d[0]=no 4d[1]=no 4d[2]=no d&a[-2]=no d&a[-1]=no d&a[0]=no d&a[1]=no d&a[2]=no d&-[-2]=no d&-[-1]=no d&-[0]=no d&-[1]=no d&-[2]=no d&/[-2]=no d&/[-1]=no d&/[0]=no d&/[1]=no d&/[2]=no d&,[-2]=no d&,[-1]=no d&,[0]=no d&,[1]=no d&,[2]=no d&.[-2]=no d&.[-1]=no d&.[0]=no d&.[1]=no d&.[2]=no up[-2]=no up[-1]=no up[0]=no up[1]=no up[2]=no iu[-2]=no iu[-1]=no iu[0]=no iu[1]=no iu[2]=no au[-2]=no au[-1]=no au[0]=no au[1]=no au[2]=no al[-2]=yes al[-1]=yes al[0]=yes al[1]=yes al[2]=yes ad[-2]=no ad[-1]=no ad[0]=no ad[1]=no ad[2]=no ao[-2]=no ao[-1]=no ao[0]=no ao[1]=no ao[2]=no cu[-2]=no cu[-1]=no cu[0]=no cu[1]=no cu[2]=no cl[-2]=yes cl[-1]=yes cl[0]=yes cl[1]=yes cl[2]=yes ca[-2]=yes ca[-1]=yes ca[0]=yes ca[1]=yes ca[2]=yes cd[-2]=no cd[-1]=no cd[0]=no cd[1]=no cd[2]=no cs[-2]=no cs[-1]=no cs[0]=no cs[1]=no cs[2]=no w[-2]|w[-1]=when|when w[-1]|w[0]=when|when w[0]|w[1]=when|when w[1]|w[2]=when|when pos[-2]|pos[-1]=WRB|WRB pos[-1]|pos[0]=WRB|WRB pos[0]|pos[1]=WRB|WRB pos[1]|pos[2]=WRB|WRB chk[-2]|chk[-1]=| chk[-1]|chk[0]=| chk[0]|chk[1]=| chk[1]|chk[2]=| shaped[-2]|shaped[-1]=L|L shaped[-1]|shaped[0]=L|L shaped[0]|shaped[1]=L|L shaped[1]|shaped[2]=L|L type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllLetter type[1]|type[2]=AllLetter|AllLetter w[-4..-1]=when w[-4..-1]=when w[1..4]=when w[1..4]=when w[1..4]=when w[1..4]=when - w[-2]=when w[-1]=when w[0]=when w[1]=when w[2]=when wl[-2]=when wl[-1]=when wl[0]=when wl[1]=when wl[2]=when pos[-2]=WRB pos[-1]=WRB pos[0]=WRB pos[1]=WRB pos[2]=WRB chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLLL shape[-1]=LLLL shape[0]=LLLL shape[1]=LLLL shape[2]=LLLL shaped[-2]=L shaped[-1]=L shaped[0]=L shaped[1]=L shaped[2]=L type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter type[1]=AllLetter type[2]=AllLetter p1[-2]=w p1[-1]=w p1[0]=w p1[1]=w p1[2]=w p2[-2]=wh p2[-1]=wh p2[0]=wh p2[1]=wh p2[2]=wh p3[-2]=whe p3[-1]=whe p3[0]=whe p3[1]=whe p3[2]=whe p4[-2]=when p4[-1]=when p4[0]=when p4[1]=when p4[2]=when s1[-2]=n s1[-1]=n s1[0]=n s1[1]=n s1[2]=n s2[-2]=en s2[-1]=en s2[0]=en s2[1]=en s2[2]=en s3[-2]=hen s3[-1]=hen s3[0]=hen s3[1]=hen s3[2]=hen s4[-2]=when s4[-1]=when s4[0]=when s4[1]=when s4[2]=when 2d[-2]=no 2d[-1]=no 2d[0]=no 2d[1]=no 2d[2]=no 4d[-2]=no 4d[-1]=no 4d[0]=no 4d[1]=no 4d[2]=no d&a[-2]=no d&a[-1]=no d&a[0]=no d&a[1]=no d&a[2]=no d&-[-2]=no d&-[-1]=no d&-[0]=no d&-[1]=no d&-[2]=no d&/[-2]=no d&/[-1]=no d&/[0]=no d&/[1]=no d&/[2]=no d&,[-2]=no d&,[-1]=no d&,[0]=no d&,[1]=no d&,[2]=no d&.[-2]=no d&.[-1]=no d&.[0]=no d&.[1]=no d&.[2]=no up[-2]=no up[-1]=no up[0]=no up[1]=no up[2]=no iu[-2]=no iu[-1]=no iu[0]=no iu[1]=no iu[2]=no au[-2]=no au[-1]=no au[0]=no au[1]=no au[2]=no al[-2]=yes al[-1]=yes al[0]=yes al[1]=yes al[2]=yes ad[-2]=no ad[-1]=no ad[0]=no ad[1]=no ad[2]=no ao[-2]=no ao[-1]=no ao[0]=no ao[1]=no ao[2]=no cu[-2]=no cu[-1]=no cu[0]=no cu[1]=no cu[2]=no cl[-2]=yes cl[-1]=yes cl[0]=yes cl[1]=yes cl[2]=yes ca[-2]=yes ca[-1]=yes ca[0]=yes ca[1]=yes ca[2]=yes cd[-2]=no cd[-1]=no cd[0]=no cd[1]=no cd[2]=no cs[-2]=no cs[-1]=no cs[0]=no cs[1]=no cs[2]=no w[-2]|w[-1]=when|when w[-1]|w[0]=when|when w[0]|w[1]=when|when w[1]|w[2]=when|when pos[-2]|pos[-1]=WRB|WRB pos[-1]|pos[0]=WRB|WRB pos[0]|pos[1]=WRB|WRB pos[1]|pos[2]=WRB|WRB chk[-2]|chk[-1]=| chk[-1]|chk[0]=| chk[0]|chk[1]=| chk[1]|chk[2]=| shaped[-2]|shaped[-1]=L|L shaped[-1]|shaped[0]=L|L shaped[0]|shaped[1]=L|L shaped[1]|shaped[2]=L|L type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllLetter type[1]|type[2]=AllLetter|AllLetter w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[1..4]=when w[1..4]=when w[1..4]=when w[1..4]=when - w[-2]=when w[-1]=when w[0]=when w[1]=when w[2]=when wl[-2]=when wl[-1]=when wl[0]=when wl[1]=when wl[2]=when pos[-2]=WRB pos[-1]=WRB pos[0]=WRB pos[1]=WRB pos[2]=WRB chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLLL shape[-1]=LLLL shape[0]=LLLL shape[1]=LLLL shape[2]=LLLL shaped[-2]=L shaped[-1]=L shaped[0]=L shaped[1]=L shaped[2]=L type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter type[1]=AllLetter type[2]=AllLetter p1[-2]=w p1[-1]=w p1[0]=w p1[1]=w p1[2]=w p2[-2]=wh p2[-1]=wh p2[0]=wh p2[1]=wh p2[2]=wh p3[-2]=whe p3[-1]=whe p3[0]=whe p3[1]=whe p3[2]=whe p4[-2]=when p4[-1]=when p4[0]=when p4[1]=when p4[2]=when s1[-2]=n s1[-1]=n s1[0]=n s1[1]=n s1[2]=n s2[-2]=en s2[-1]=en s2[0]=en s2[1]=en s2[2]=en s3[-2]=hen s3[-1]=hen s3[0]=hen s3[1]=hen s3[2]=hen s4[-2]=when s4[-1]=when s4[0]=when s4[1]=when s4[2]=when 2d[-2]=no 2d[-1]=no 2d[0]=no 2d[1]=no 2d[2]=no 4d[-2]=no 4d[-1]=no 4d[0]=no 4d[1]=no 4d[2]=no d&a[-2]=no d&a[-1]=no d&a[0]=no d&a[1]=no d&a[2]=no d&-[-2]=no d&-[-1]=no d&-[0]=no d&-[1]=no d&-[2]=no d&/[-2]=no d&/[-1]=no d&/[0]=no d&/[1]=no d&/[2]=no d&,[-2]=no d&,[-1]=no d&,[0]=no d&,[1]=no d&,[2]=no d&.[-2]=no d&.[-1]=no d&.[0]=no d&.[1]=no d&.[2]=no up[-2]=no up[-1]=no up[0]=no up[1]=no up[2]=no iu[-2]=no iu[-1]=no iu[0]=no iu[1]=no iu[2]=no au[-2]=no au[-1]=no au[0]=no au[1]=no au[2]=no al[-2]=yes al[-1]=yes al[0]=yes al[1]=yes al[2]=yes ad[-2]=no ad[-1]=no ad[0]=no ad[1]=no ad[2]=no ao[-2]=no ao[-1]=no ao[0]=no ao[1]=no ao[2]=no cu[-2]=no cu[-1]=no cu[0]=no cu[1]=no cu[2]=no cl[-2]=yes cl[-1]=yes cl[0]=yes cl[1]=yes cl[2]=yes ca[-2]=yes ca[-1]=yes ca[0]=yes ca[1]=yes ca[2]=yes cd[-2]=no cd[-1]=no cd[0]=no cd[1]=no cd[2]=no cs[-2]=no cs[-1]=no cs[0]=no cs[1]=no cs[2]=no w[-2]|w[-1]=when|when w[-1]|w[0]=when|when w[0]|w[1]=when|when w[1]|w[2]=when|when pos[-2]|pos[-1]=WRB|WRB pos[-1]|pos[0]=WRB|WRB pos[0]|pos[1]=WRB|WRB pos[1]|pos[2]=WRB|WRB chk[-2]|chk[-1]=| chk[-1]|chk[0]=| chk[0]|chk[1]=| chk[1]|chk[2]=| shaped[-2]|shaped[-1]=L|L shaped[-1]|shaped[0]=L|L shaped[0]|shaped[1]=L|L shaped[1]|shaped[2]=L|L type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllLetter type[1]|type[2]=AllLetter|AllLetter w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[1..4]=when w[1..4]=when w[1..4]=when w[1..4]=when - w[-2]=when w[-1]=when w[0]=when w[1]=when w[2]=when wl[-2]=when wl[-1]=when wl[0]=when wl[1]=when wl[2]=when pos[-2]=WRB pos[-1]=WRB pos[0]=WRB pos[1]=WRB pos[2]=WRB chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLLL shape[-1]=LLLL shape[0]=LLLL shape[1]=LLLL shape[2]=LLLL shaped[-2]=L shaped[-1]=L shaped[0]=L shaped[1]=L shaped[2]=L type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter type[1]=AllLetter type[2]=AllLetter p1[-2]=w p1[-1]=w p1[0]=w p1[1]=w p1[2]=w p2[-2]=wh p2[-1]=wh p2[0]=wh p2[1]=wh p2[2]=wh p3[-2]=whe p3[-1]=whe p3[0]=whe p3[1]=whe p3[2]=whe p4[-2]=when p4[-1]=when p4[0]=when p4[1]=when p4[2]=when s1[-2]=n s1[-1]=n s1[0]=n s1[1]=n s1[2]=n s2[-2]=en s2[-1]=en s2[0]=en s2[1]=en s2[2]=en s3[-2]=hen s3[-1]=hen s3[0]=hen s3[1]=hen s3[2]=hen s4[-2]=when s4[-1]=when s4[0]=when s4[1]=when s4[2]=when 2d[-2]=no 2d[-1]=no 2d[0]=no 2d[1]=no 2d[2]=no 4d[-2]=no 4d[-1]=no 4d[0]=no 4d[1]=no 4d[2]=no d&a[-2]=no d&a[-1]=no d&a[0]=no d&a[1]=no d&a[2]=no d&-[-2]=no d&-[-1]=no d&-[0]=no d&-[1]=no d&-[2]=no d&/[-2]=no d&/[-1]=no d&/[0]=no d&/[1]=no d&/[2]=no d&,[-2]=no d&,[-1]=no d&,[0]=no d&,[1]=no d&,[2]=no d&.[-2]=no d&.[-1]=no d&.[0]=no d&.[1]=no d&.[2]=no up[-2]=no up[-1]=no up[0]=no up[1]=no up[2]=no iu[-2]=no iu[-1]=no iu[0]=no iu[1]=no iu[2]=no au[-2]=no au[-1]=no au[0]=no au[1]=no au[2]=no al[-2]=yes al[-1]=yes al[0]=yes al[1]=yes al[2]=yes ad[-2]=no ad[-1]=no ad[0]=no ad[1]=no ad[2]=no ao[-2]=no ao[-1]=no ao[0]=no ao[1]=no ao[2]=no cu[-2]=no cu[-1]=no cu[0]=no cu[1]=no cu[2]=no cl[-2]=yes cl[-1]=yes cl[0]=yes cl[1]=yes cl[2]=yes ca[-2]=yes ca[-1]=yes ca[0]=yes ca[1]=yes ca[2]=yes cd[-2]=no cd[-1]=no cd[0]=no cd[1]=no cd[2]=no cs[-2]=no cs[-1]=no cs[0]=no cs[1]=no cs[2]=no w[-2]|w[-1]=when|when w[-1]|w[0]=when|when w[0]|w[1]=when|when w[1]|w[2]=when|when pos[-2]|pos[-1]=WRB|WRB pos[-1]|pos[0]=WRB|WRB pos[0]|pos[1]=WRB|WRB pos[1]|pos[2]=WRB|WRB chk[-2]|chk[-1]=| chk[-1]|chk[0]=| chk[0]|chk[1]=| chk[1]|chk[2]=| shaped[-2]|shaped[-1]=L|L shaped[-1]|shaped[0]=L|L shaped[0]|shaped[1]=L|L shaped[1]|shaped[2]=L|L type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllLetter type[1]|type[2]=AllLetter|AllLetter w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[1..4]=when w[1..4]=when w[1..4]=when - w[-2]=when w[-1]=when w[0]=when w[1]=when w[2]=when wl[-2]=when wl[-1]=when wl[0]=when wl[1]=when wl[2]=when pos[-2]=WRB pos[-1]=WRB pos[0]=WRB pos[1]=WRB pos[2]=WRB chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLLL shape[-1]=LLLL shape[0]=LLLL shape[1]=LLLL shape[2]=LLLL shaped[-2]=L shaped[-1]=L shaped[0]=L shaped[1]=L shaped[2]=L type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter type[1]=AllLetter type[2]=AllLetter p1[-2]=w p1[-1]=w p1[0]=w p1[1]=w p1[2]=w p2[-2]=wh p2[-1]=wh p2[0]=wh p2[1]=wh p2[2]=wh p3[-2]=whe p3[-1]=whe p3[0]=whe p3[1]=whe p3[2]=whe p4[-2]=when p4[-1]=when p4[0]=when p4[1]=when p4[2]=when s1[-2]=n s1[-1]=n s1[0]=n s1[1]=n s1[2]=n s2[-2]=en s2[-1]=en s2[0]=en s2[1]=en s2[2]=en s3[-2]=hen s3[-1]=hen s3[0]=hen s3[1]=hen s3[2]=hen s4[-2]=when s4[-1]=when s4[0]=when s4[1]=when s4[2]=when 2d[-2]=no 2d[-1]=no 2d[0]=no 2d[1]=no 2d[2]=no 4d[-2]=no 4d[-1]=no 4d[0]=no 4d[1]=no 4d[2]=no d&a[-2]=no d&a[-1]=no d&a[0]=no d&a[1]=no d&a[2]=no d&-[-2]=no d&-[-1]=no d&-[0]=no d&-[1]=no d&-[2]=no d&/[-2]=no d&/[-1]=no d&/[0]=no d&/[1]=no d&/[2]=no d&,[-2]=no d&,[-1]=no d&,[0]=no d&,[1]=no d&,[2]=no d&.[-2]=no d&.[-1]=no d&.[0]=no d&.[1]=no d&.[2]=no up[-2]=no up[-1]=no up[0]=no up[1]=no up[2]=no iu[-2]=no iu[-1]=no iu[0]=no iu[1]=no iu[2]=no au[-2]=no au[-1]=no au[0]=no au[1]=no au[2]=no al[-2]=yes al[-1]=yes al[0]=yes al[1]=yes al[2]=yes ad[-2]=no ad[-1]=no ad[0]=no ad[1]=no ad[2]=no ao[-2]=no ao[-1]=no ao[0]=no ao[1]=no ao[2]=no cu[-2]=no cu[-1]=no cu[0]=no cu[1]=no cu[2]=no cl[-2]=yes cl[-1]=yes cl[0]=yes cl[1]=yes cl[2]=yes ca[-2]=yes ca[-1]=yes ca[0]=yes ca[1]=yes ca[2]=yes cd[-2]=no cd[-1]=no cd[0]=no cd[1]=no cd[2]=no cs[-2]=no cs[-1]=no cs[0]=no cs[1]=no cs[2]=no w[-2]|w[-1]=when|when w[-1]|w[0]=when|when w[0]|w[1]=when|when w[1]|w[2]=when|when pos[-2]|pos[-1]=WRB|WRB pos[-1]|pos[0]=WRB|WRB pos[0]|pos[1]=WRB|WRB pos[1]|pos[2]=WRB|WRB chk[-2]|chk[-1]=| chk[-1]|chk[0]=| chk[0]|chk[1]=| chk[1]|chk[2]=| shaped[-2]|shaped[-1]=L|L shaped[-1]|shaped[0]=L|L shaped[0]|shaped[1]=L|L shaped[1]|shaped[2]=L|L type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllLetter type[1]|type[2]=AllLetter|AllLetter w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[1..4]=when w[1..4]=when - w[-2]=when w[-1]=when w[0]=when w[1]=when wl[-2]=when wl[-1]=when wl[0]=when wl[1]=when pos[-2]=WRB pos[-1]=WRB pos[0]=WRB pos[1]=WRB chk[-2]= chk[-1]= chk[0]= chk[1]= shape[-2]=LLLL shape[-1]=LLLL shape[0]=LLLL shape[1]=LLLL shaped[-2]=L shaped[-1]=L shaped[0]=L shaped[1]=L type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter type[1]=AllLetter p1[-2]=w p1[-1]=w p1[0]=w p1[1]=w p2[-2]=wh p2[-1]=wh p2[0]=wh p2[1]=wh p3[-2]=whe p3[-1]=whe p3[0]=whe p3[1]=whe p4[-2]=when p4[-1]=when p4[0]=when p4[1]=when s1[-2]=n s1[-1]=n s1[0]=n s1[1]=n s2[-2]=en s2[-1]=en s2[0]=en s2[1]=en s3[-2]=hen s3[-1]=hen s3[0]=hen s3[1]=hen s4[-2]=when s4[-1]=when s4[0]=when s4[1]=when 2d[-2]=no 2d[-1]=no 2d[0]=no 2d[1]=no 4d[-2]=no 4d[-1]=no 4d[0]=no 4d[1]=no d&a[-2]=no d&a[-1]=no d&a[0]=no d&a[1]=no d&-[-2]=no d&-[-1]=no d&-[0]=no d&-[1]=no d&/[-2]=no d&/[-1]=no d&/[0]=no d&/[1]=no d&,[-2]=no d&,[-1]=no d&,[0]=no d&,[1]=no d&.[-2]=no d&.[-1]=no d&.[0]=no d&.[1]=no up[-2]=no up[-1]=no up[0]=no up[1]=no iu[-2]=no iu[-1]=no iu[0]=no iu[1]=no au[-2]=no au[-1]=no au[0]=no au[1]=no al[-2]=yes al[-1]=yes al[0]=yes al[1]=yes ad[-2]=no ad[-1]=no ad[0]=no ad[1]=no ao[-2]=no ao[-1]=no ao[0]=no ao[1]=no cu[-2]=no cu[-1]=no cu[0]=no cu[1]=no cl[-2]=yes cl[-1]=yes cl[0]=yes cl[1]=yes ca[-2]=yes ca[-1]=yes ca[0]=yes ca[1]=yes cd[-2]=no cd[-1]=no cd[0]=no cd[1]=no cs[-2]=no cs[-1]=no cs[0]=no cs[1]=no w[-2]|w[-1]=when|when w[-1]|w[0]=when|when w[0]|w[1]=when|when pos[-2]|pos[-1]=WRB|WRB pos[-1]|pos[0]=WRB|WRB pos[0]|pos[1]=WRB|WRB chk[-2]|chk[-1]=| chk[-1]|chk[0]=| chk[0]|chk[1]=| shaped[-2]|shaped[-1]=L|L shaped[-1]|shaped[0]=L|L shaped[0]|shaped[1]=L|L type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllLetter w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[1..4]=when - w[-2]=when w[-1]=when w[0]=when wl[-2]=when wl[-1]=when wl[0]=when pos[-2]=WRB pos[-1]=WRB pos[0]=WRB chk[-2]= chk[-1]= chk[0]= shape[-2]=LLLL shape[-1]=LLLL shape[0]=LLLL shaped[-2]=L shaped[-1]=L shaped[0]=L type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter p1[-2]=w p1[-1]=w p1[0]=w p2[-2]=wh p2[-1]=wh p2[0]=wh p3[-2]=whe p3[-1]=whe p3[0]=whe p4[-2]=when p4[-1]=when p4[0]=when s1[-2]=n s1[-1]=n s1[0]=n s2[-2]=en s2[-1]=en s2[0]=en s3[-2]=hen s3[-1]=hen s3[0]=hen s4[-2]=when s4[-1]=when s4[0]=when 2d[-2]=no 2d[-1]=no 2d[0]=no 4d[-2]=no 4d[-1]=no 4d[0]=no d&a[-2]=no d&a[-1]=no d&a[0]=no d&-[-2]=no d&-[-1]=no d&-[0]=no d&/[-2]=no d&/[-1]=no d&/[0]=no d&,[-2]=no d&,[-1]=no d&,[0]=no d&.[-2]=no d&.[-1]=no d&.[0]=no up[-2]=no up[-1]=no up[0]=no iu[-2]=no iu[-1]=no iu[0]=no au[-2]=no au[-1]=no au[0]=no al[-2]=yes al[-1]=yes al[0]=yes ad[-2]=no ad[-1]=no ad[0]=no ao[-2]=no ao[-1]=no ao[0]=no cu[-2]=no cu[-1]=no cu[0]=no cl[-2]=yes cl[-1]=yes cl[0]=yes ca[-2]=yes ca[-1]=yes ca[0]=yes cd[-2]=no cd[-1]=no cd[0]=no cs[-2]=no cs[-1]=no cs[0]=no w[-2]|w[-1]=when|when w[-1]|w[0]=when|when pos[-2]|pos[-1]=WRB|WRB pos[-1]|pos[0]=WRB|WRB chk[-2]|chk[-1]=| chk[-1]|chk[0]=| shaped[-2]|shaped[-1]=L|L shaped[-1]|shaped[0]=L|L type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when w[-4..-1]=when __EOS__ - diff --git a/BotSharp.sln b/BotSharp.sln index 6c089b5e..c3bb81a6 100644 --- a/BotSharp.sln +++ b/BotSharp.sln @@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.WebHost", "BotShar EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.MachineLearning", "BotSharp.MachineLearning\BotSharp.MachineLearning.csproj", "{E664115A-AE86-49E9-8AE4-D4589A568CD7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetToolkit", "..\DotNetToolkit\DotNetToolkit\DotNetToolkit.csproj", "{49F8D187-599E-458F-8567-40FCD146CFFA}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -41,10 +39,6 @@ Global {E664115A-AE86-49E9-8AE4-D4589A568CD7}.Debug|Any CPU.Build.0 = Debug|Any CPU {E664115A-AE86-49E9-8AE4-D4589A568CD7}.Release|Any CPU.ActiveCfg = Release|Any CPU {E664115A-AE86-49E9-8AE4-D4589A568CD7}.Release|Any CPU.Build.0 = Release|Any CPU - {49F8D187-599E-458F-8567-40FCD146CFFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {49F8D187-599E-458F-8567-40FCD146CFFA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {49F8D187-599E-458F-8567-40FCD146CFFA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {49F8D187-599E-458F-8567-40FCD146CFFA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE