diff --git a/BotSharp.Core/Engines/BotPreditor.cs b/BotSharp.Core/Engines/BotPreditor.cs index 260a36f24..e1b3a7706 100644 --- a/BotSharp.Core/Engines/BotPreditor.cs +++ b/BotSharp.Core/Engines/BotPreditor.cs @@ -43,9 +43,15 @@ public async Task Predict(Agent agent, AIRequest request) var settings = new PipeSettings { ModelDir = Path.Join(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "ModelFiles", agent.Id), + PredictDir = Path.Join(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "Predicts"), AlgorithmDir = Path.Join(AppDomain.CurrentDomain.GetData("ContentRootPath").ToString(), "Algorithms") }; + if (!Directory.Exists(settings.PredictDir)) + { + Directory.CreateDirectory(settings.PredictDir); + } + // pipe process meta.Pipeline.ForEach(async pipeMeta => { diff --git a/BotSharp.Core/Engines/CRFsuite/CRFsuiteEntityRecognizer.cs b/BotSharp.Core/Engines/CRFsuite/CRFsuiteEntityRecognizer.cs index 8614ed7fd..fb06cd778 100644 --- a/BotSharp.Core/Engines/CRFsuite/CRFsuiteEntityRecognizer.cs +++ b/BotSharp.Core/Engines/CRFsuite/CRFsuiteEntityRecognizer.cs @@ -64,7 +64,9 @@ public async Task Train(Agent agent, JObject data, PipeModel meta) new MachineLearning.CRFsuite.Ner() .NerStart(rawTrainingDataFileName, parsedTrainingDataFileName, fields, uniFeatures.Split(" "), biFeatures.Split(" ")); - CmdHelper.Run(Path.Join(Settings.AlgorithmDir, "crfsuite"), $"learn -m {modelFileName} {parsedTrainingDataFileName}"); // --split=3 -x + var algorithmDir = Path.Join(AppDomain.CurrentDomain.GetData("ContentRootPath").ToString(), "Algorithms"); + + CmdHelper.Run(Path.Join(algorithmDir, "crfsuite"), $"learn -m {modelFileName} {parsedTrainingDataFileName}"); // --split=3 -x Console.WriteLine($"Saved model to {modelFileName}"); meta.Meta = new JObject(); @@ -134,6 +136,68 @@ public List Merge(List tokens, List Predict(Agent agent, JObject data, 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"); + string modelFileName = Path.Join(Settings.ModelDir, meta.Model); + + using (FileStream fs = new FileStream(rawPredictingDataFileName, FileMode.Create)) + { + using (StreamWriter sw = new StreamWriter(fs)) + { + List curLine = new List(); + foreach (List tokenList in tokens) + { + foreach (NlpToken token in tokenList) + { + for (int i = 0 ; i < fields.Length; i++) + { + if (fields[i] == "y") { + curLine.Add(""); + } + else if (fields[i] == "w") { + curLine.Add(token.Text); + } + else if (fields[i] == "pos") { + curLine.Add(token.Tag); + } + else if (fields[i] == "chk") { + curLine.Add(""); + } + } + sw.Write(string.Join(" ", curLine) + "\n"); + curLine.Clear(); + } + sw.Write("\n"); + + } + 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}"); + + var entities = new List(); + // + + + data["entities"] = JObject.FromObject(entities); + if(File.Exists(rawPredictingDataFileName)) + { + File.Delete(rawPredictingDataFileName); + } + if(File.Exists(parsedPredictingDataFileName)) + { + File.Delete(parsedPredictingDataFileName); + } return true; } } diff --git a/BotSharp.Core/Engines/Classifiers/FasttextClassifier.cs b/BotSharp.Core/Engines/Classifiers/FasttextClassifier.cs index 388d0b9bb..01283ab1f 100644 --- a/BotSharp.Core/Engines/Classifiers/FasttextClassifier.cs +++ b/BotSharp.Core/Engines/Classifiers/FasttextClassifier.cs @@ -14,6 +14,7 @@ namespace BotSharp.Core.Engines.Classifiers public class FasttextClassifier : INlpPipeline { public IConfiguration Configuration { get; set; } + public PipeSettings Settings { get; set; } public async Task Predict(Agent agent, JObject data, PipeModel meta) diff --git a/BotSharp.Core/Engines/PipeSettings.cs b/BotSharp.Core/Engines/PipeSettings.cs index 1c699a6dc..cee75ef10 100644 --- a/BotSharp.Core/Engines/PipeSettings.cs +++ b/BotSharp.Core/Engines/PipeSettings.cs @@ -9,5 +9,6 @@ public class PipeSettings public string TrainDir { get; set; } public string ModelDir { get; set; } public string AlgorithmDir { get; set; } + public string PredictDir { get; set; } } } diff --git a/BotSharp.Core/Engines/SpaCy/SpaCyTokenizer.cs b/BotSharp.Core/Engines/SpaCy/SpaCyTokenizer.cs index 7e4d28eff..ca45062a8 100644 --- a/BotSharp.Core/Engines/SpaCy/SpaCyTokenizer.cs +++ b/BotSharp.Core/Engines/SpaCy/SpaCyTokenizer.cs @@ -46,6 +46,22 @@ public async Task Train(Agent agent, JObject data, PipeModel meta) public async Task Predict(Agent agent, JObject data, PipeModel meta) { + var client = new RestClient(Configuration.GetSection("SpaCyProvider:Url").Value); + var request = new RestRequest("tokenizer", Method.GET); + List> tokens = new List>(); + Boolean res = true; + var corpus = agent.Corpus; + + request.AddParameter("text", data["Text"]); + var response = client.Execute(request); + + tokens.Add(response.Data.Tokens); + + res = res && response.IsSuccessful; + + + data.Add("Tokens", JToken.FromObject(tokens)); + return true; } diff --git a/BotSharp.RestApi/Dialogs/DialogController.cs b/BotSharp.RestApi/Dialogs/DialogController.cs index 701c541d8..4ec6894bb 100644 --- a/BotSharp.RestApi/Dialogs/DialogController.cs +++ b/BotSharp.RestApi/Dialogs/DialogController.cs @@ -46,7 +46,7 @@ public ActionResult Query([FromBody] QueryModel request) var aIResponse = _platform.TextRequest(new AIRequest { Timezone = request.Timezone, - Contexts = request.Contexts.Select(x => new AIContext { Name = x }).ToList(), + Contexts = request?.Contexts?.Select(x => new AIContext { Name = x })?.ToList(), Language = request.Lang, Query = new String[] { request.Query } }); diff --git a/BotSharp.WebHost/Algorithms/crfsuite b/BotSharp.WebHost/Algorithms/crfsuite new file mode 100755 index 000000000..3fab0c91f Binary files /dev/null and b/BotSharp.WebHost/Algorithms/crfsuite differ diff --git a/BotSharp.WebHost/App_Data/Predicts/ner-crf.corpus.predict.txt b/BotSharp.WebHost/App_Data/Predicts/ner-crf.corpus.predict.txt new file mode 100644 index 000000000..4ae3515c2 --- /dev/null +++ b/BotSharp.WebHost/App_Data/Predicts/ner-crf.corpus.predict.txt @@ -0,0 +1,10 @@ + when WRB + is VBZ + the DT + next JJ + train NN + in IN + muncher NN + freiheit NN + ? . + diff --git a/BotSharp.WebHost/App_Data/Predicts/ner-crf.parsed.predict.txt b/BotSharp.WebHost/App_Data/Predicts/ner-crf.parsed.predict.txt new file mode 100644 index 000000000..8d1c34846 --- /dev/null +++ b/BotSharp.WebHost/App_Data/Predicts/ner-crf.parsed.predict.txt @@ -0,0 +1,10 @@ + w[0]=when w[1]=is w[2]=the wl[0]=when wl[1]=is wl[2]=the pos[0]=WRB pos[1]=VBZ pos[2]=DT chk[0]= chk[1]= chk[2]= shape[0]=LLLL shape[1]=LL shape[2]=LLL shaped[0]=L shaped[1]=L shaped[2]=L type[0]=AllLetter type[1]=AllLetter type[2]=AllLetter p1[0]=w p1[1]=i p1[2]=t p2[0]=wh p2[1]=is p2[2]=th p3[0]=whe p3[1]= p3[2]=the p4[0]=when p4[1]= p4[2]= s1[0]=n s1[1]=s s1[2]=e s2[0]=en s2[1]=is s2[2]=he s3[0]=hen s3[1]= s3[2]=the s4[0]=when s4[1]= s4[2]= 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|is w[1]|w[2]=is|the pos[0]|pos[1]=WRB|VBZ pos[1]|pos[2]=VBZ|DT 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]=is w[1..4]=the w[1..4]=next w[1..4]=train __BOS__ + w[-1]=when w[0]=is w[1]=the w[2]=next wl[-1]=when wl[0]=is wl[1]=the wl[2]=next pos[-1]=WRB pos[0]=VBZ pos[1]=DT pos[2]=JJ chk[-1]= chk[0]= chk[1]= chk[2]= shape[-1]=LLLL shape[0]=LL shape[1]=LLL 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]=i p1[1]=t p1[2]=n p2[-1]=wh p2[0]=is p2[1]=th p2[2]=ne p3[-1]=whe p3[0]= p3[1]=the p3[2]=nex p4[-1]=when p4[0]= p4[1]= p4[2]=next s1[-1]=n s1[0]=s s1[1]=e s1[2]=t s2[-1]=en s2[0]=is s2[1]=he s2[2]=xt s3[-1]=hen s3[0]= s3[1]=the s3[2]=ext s4[-1]=when s4[0]= s4[1]= s4[2]=next 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|is w[0]|w[1]=is|the w[1]|w[2]=the|next pos[-1]|pos[0]=WRB|VBZ pos[0]|pos[1]=VBZ|DT pos[1]|pos[2]=DT|JJ 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]=the w[1..4]=next w[1..4]=train w[1..4]=in + w[-2]=when w[-1]=is w[0]=the w[1]=next w[2]=train wl[-2]=when wl[-1]=is wl[0]=the wl[1]=next wl[2]=train pos[-2]=WRB pos[-1]=VBZ pos[0]=DT pos[1]=JJ pos[2]=NN chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLLL shape[-1]=LL shape[0]=LLL shape[1]=LLLL shape[2]=LLLLL 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]=i p1[0]=t p1[1]=n p1[2]=t p2[-2]=wh p2[-1]=is p2[0]=th p2[1]=ne p2[2]=tr p3[-2]=whe p3[-1]= p3[0]=the p3[1]=nex p3[2]=tra p4[-2]=when p4[-1]= p4[0]= p4[1]=next p4[2]=trai s1[-2]=n s1[-1]=s s1[0]=e s1[1]=t s1[2]=n s2[-2]=en s2[-1]=is s2[0]=he s2[1]=xt s2[2]=in s3[-2]=hen s3[-1]= s3[0]=the s3[1]=ext s3[2]=ain s4[-2]=when s4[-1]= s4[0]= s4[1]=next s4[2]=rain 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|is w[-1]|w[0]=is|the w[0]|w[1]=the|next w[1]|w[2]=next|train pos[-2]|pos[-1]=WRB|VBZ pos[-1]|pos[0]=VBZ|DT pos[0]|pos[1]=DT|JJ pos[1]|pos[2]=JJ|NN 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]=is w[1..4]=next w[1..4]=train w[1..4]=in w[1..4]=muncher + w[-2]=is w[-1]=the w[0]=next w[1]=train w[2]=in wl[-2]=is wl[-1]=the wl[0]=next wl[1]=train wl[2]=in pos[-2]=VBZ pos[-1]=DT pos[0]=JJ pos[1]=NN pos[2]=IN chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LL shape[-1]=LLL shape[0]=LLLL shape[1]=LLLLL shape[2]=LL 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]=i p1[-1]=t p1[0]=n p1[1]=t p1[2]=i p2[-2]=is p2[-1]=th p2[0]=ne p2[1]=tr p2[2]=in p3[-2]= p3[-1]=the p3[0]=nex p3[1]=tra p3[2]= p4[-2]= p4[-1]= p4[0]=next p4[1]=trai p4[2]= s1[-2]=s s1[-1]=e s1[0]=t s1[1]=n s1[2]=n s2[-2]=is s2[-1]=he s2[0]=xt s2[1]=in s2[2]=in s3[-2]= s3[-1]=the s3[0]=ext s3[1]=ain s3[2]= s4[-2]= s4[-1]= s4[0]=next s4[1]=rain s4[2]= 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]=is|the w[-1]|w[0]=the|next w[0]|w[1]=next|train w[1]|w[2]=train|in pos[-2]|pos[-1]=VBZ|DT pos[-1]|pos[0]=DT|JJ pos[0]|pos[1]=JJ|NN pos[1]|pos[2]=NN|IN 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]=is w[-4..-1]=the w[1..4]=train w[1..4]=in w[1..4]=muncher w[1..4]=freiheit + w[-2]=the w[-1]=next w[0]=train w[1]=in w[2]=muncher wl[-2]=the wl[-1]=next wl[0]=train wl[1]=in wl[2]=muncher pos[-2]=DT pos[-1]=JJ pos[0]=NN pos[1]=IN pos[2]=NN chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLL shape[-1]=LLLL shape[0]=LLLLL shape[1]=LL shape[2]=LLLLLLL 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]=t p1[-1]=n p1[0]=t p1[1]=i p1[2]=m p2[-2]=th p2[-1]=ne p2[0]=tr p2[1]=in p2[2]=mu p3[-2]=the p3[-1]=nex p3[0]=tra p3[1]= p3[2]=mun p4[-2]= p4[-1]=next p4[0]=trai p4[1]= p4[2]=munc s1[-2]=e s1[-1]=t s1[0]=n s1[1]=n s1[2]=r s2[-2]=he s2[-1]=xt s2[0]=in s2[1]=in s2[2]=er s3[-2]=the s3[-1]=ext s3[0]=ain s3[1]= s3[2]=her s4[-2]= s4[-1]=next s4[0]=rain s4[1]= s4[2]=cher 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]=the|next w[-1]|w[0]=next|train w[0]|w[1]=train|in w[1]|w[2]=in|muncher pos[-2]|pos[-1]=DT|JJ pos[-1]|pos[0]=JJ|NN pos[0]|pos[1]=NN|IN pos[1]|pos[2]=IN|NN 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]=is w[-4..-1]=the w[-4..-1]=next w[1..4]=in w[1..4]=muncher w[1..4]=freiheit w[1..4]=? + w[-2]=next w[-1]=train w[0]=in w[1]=muncher w[2]=freiheit wl[-2]=next wl[-1]=train wl[0]=in wl[1]=muncher wl[2]=freiheit pos[-2]=JJ pos[-1]=NN pos[0]=IN pos[1]=NN pos[2]=NN chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLLL shape[-1]=LLLLL shape[0]=LL shape[1]=LLLLLLL shape[2]=LLLLLLLL 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]=n p1[-1]=t p1[0]=i p1[1]=m p1[2]=f p2[-2]=ne p2[-1]=tr p2[0]=in p2[1]=mu p2[2]=fr p3[-2]=nex p3[-1]=tra p3[0]= p3[1]=mun p3[2]=fre p4[-2]=next p4[-1]=trai p4[0]= p4[1]=munc p4[2]=frei s1[-2]=t s1[-1]=n s1[0]=n s1[1]=r s1[2]=t s2[-2]=xt s2[-1]=in s2[0]=in s2[1]=er s2[2]=it s3[-2]=ext s3[-1]=ain s3[0]= s3[1]=her s3[2]=eit s4[-2]=next s4[-1]=rain s4[0]= s4[1]=cher s4[2]=heit 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]=next|train w[-1]|w[0]=train|in w[0]|w[1]=in|muncher w[1]|w[2]=muncher|freiheit pos[-2]|pos[-1]=JJ|NN pos[-1]|pos[0]=NN|IN pos[0]|pos[1]=IN|NN pos[1]|pos[2]=NN|NN 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]=is w[-4..-1]=the w[-4..-1]=next w[-4..-1]=train w[1..4]=muncher w[1..4]=freiheit w[1..4]=? + w[-2]=train w[-1]=in w[0]=muncher w[1]=freiheit w[2]=? wl[-2]=train wl[-1]=in wl[0]=muncher wl[1]=freiheit wl[2]=? pos[-2]=NN pos[-1]=IN pos[0]=NN pos[1]=NN pos[2]=. chk[-2]= chk[-1]= chk[0]= chk[1]= chk[2]= shape[-2]=LLLLL shape[-1]=LL shape[0]=LLLLLLL shape[1]=LLLLLLLL shape[2]=; shaped[-2]=L shaped[-1]=L shaped[0]=L shaped[1]=L shaped[2]=; type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter type[1]=AllLetter type[2]=AllSymbol p1[-2]=t p1[-1]=i p1[0]=m p1[1]=f p1[2]=? p2[-2]=tr p2[-1]=in p2[0]=mu p2[1]=fr p2[2]= p3[-2]=tra p3[-1]= p3[0]=mun p3[1]=fre p3[2]= p4[-2]=trai p4[-1]= p4[0]=munc p4[1]=frei p4[2]= s1[-2]=n s1[-1]=n s1[0]=r s1[1]=t s1[2]=? s2[-2]=in s2[-1]=in s2[0]=er s2[1]=it s2[2]= s3[-2]=ain s3[-1]= s3[0]=her s3[1]=eit s3[2]= s4[-2]=rain s4[-1]= s4[0]=cher s4[1]=heit s4[2]= 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]=no 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]=yes 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]=no ca[-2]=yes ca[-1]=yes ca[0]=yes ca[1]=yes ca[2]=no 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]=yes w[-2]|w[-1]=train|in w[-1]|w[0]=in|muncher w[0]|w[1]=muncher|freiheit w[1]|w[2]=freiheit|? pos[-2]|pos[-1]=NN|IN pos[-1]|pos[0]=IN|NN pos[0]|pos[1]=NN|NN pos[1]|pos[2]=NN|. 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|; type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllLetter type[1]|type[2]=AllLetter|AllSymbol w[-4..-1]=the w[-4..-1]=next w[-4..-1]=train w[-4..-1]=in w[1..4]=freiheit w[1..4]=? + w[-2]=in w[-1]=muncher w[0]=freiheit w[1]=? wl[-2]=in wl[-1]=muncher wl[0]=freiheit wl[1]=? pos[-2]=IN pos[-1]=NN pos[0]=NN pos[1]=. chk[-2]= chk[-1]= chk[0]= chk[1]= shape[-2]=LL shape[-1]=LLLLLLL shape[0]=LLLLLLLL shape[1]=; shaped[-2]=L shaped[-1]=L shaped[0]=L shaped[1]=; type[-2]=AllLetter type[-1]=AllLetter type[0]=AllLetter type[1]=AllSymbol p1[-2]=i p1[-1]=m p1[0]=f p1[1]=? p2[-2]=in p2[-1]=mu p2[0]=fr p2[1]= p3[-2]= p3[-1]=mun p3[0]=fre p3[1]= p4[-2]= p4[-1]=munc p4[0]=frei p4[1]= s1[-2]=n s1[-1]=r s1[0]=t s1[1]=? s2[-2]=in s2[-1]=er s2[0]=it s2[1]= s3[-2]= s3[-1]=her s3[0]=eit s3[1]= s4[-2]= s4[-1]=cher s4[0]=heit s4[1]= 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]=no ad[-2]=no ad[-1]=no ad[0]=no ad[1]=no ao[-2]=no ao[-1]=no ao[0]=no ao[1]=yes cu[-2]=no cu[-1]=no cu[0]=no cu[1]=no cl[-2]=yes cl[-1]=yes cl[0]=yes cl[1]=no ca[-2]=yes ca[-1]=yes ca[0]=yes ca[1]=no cd[-2]=no cd[-1]=no cd[0]=no cd[1]=no cs[-2]=no cs[-1]=no cs[0]=no cs[1]=yes w[-2]|w[-1]=in|muncher w[-1]|w[0]=muncher|freiheit w[0]|w[1]=freiheit|? pos[-2]|pos[-1]=IN|NN pos[-1]|pos[0]=NN|NN pos[0]|pos[1]=NN|. 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|; type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllLetter type[0]|type[1]=AllLetter|AllSymbol w[-4..-1]=next w[-4..-1]=train w[-4..-1]=in w[-4..-1]=muncher w[1..4]=? + w[-2]=muncher w[-1]=freiheit w[0]=? wl[-2]=muncher wl[-1]=freiheit wl[0]=? pos[-2]=NN pos[-1]=NN pos[0]=. chk[-2]= chk[-1]= chk[0]= shape[-2]=LLLLLLL shape[-1]=LLLLLLLL shape[0]=; shaped[-2]=L shaped[-1]=L shaped[0]=; type[-2]=AllLetter type[-1]=AllLetter type[0]=AllSymbol p1[-2]=m p1[-1]=f p1[0]=? p2[-2]=mu p2[-1]=fr p2[0]= p3[-2]=mun p3[-1]=fre p3[0]= p4[-2]=munc p4[-1]=frei p4[0]= s1[-2]=r s1[-1]=t s1[0]=? s2[-2]=er s2[-1]=it s2[0]= s3[-2]=her s3[-1]=eit s3[0]= s4[-2]=cher s4[-1]=heit s4[0]= 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]=no ad[-2]=no ad[-1]=no ad[0]=no ao[-2]=no ao[-1]=no ao[0]=yes cu[-2]=no cu[-1]=no cu[0]=no cl[-2]=yes cl[-1]=yes cl[0]=no ca[-2]=yes ca[-1]=yes ca[0]=no cd[-2]=no cd[-1]=no cd[0]=no cs[-2]=no cs[-1]=no cs[0]=yes w[-2]|w[-1]=muncher|freiheit w[-1]|w[0]=freiheit|? pos[-2]|pos[-1]=NN|NN pos[-1]|pos[0]=NN|. chk[-2]|chk[-1]=| chk[-1]|chk[0]=| shaped[-2]|shaped[-1]=L|L shaped[-1]|shaped[0]=L|; type[-2]|type[-1]=AllLetter|AllLetter type[-1]|type[0]=AllLetter|AllSymbol w[-4..-1]=train w[-4..-1]=in w[-4..-1]=muncher w[-4..-1]=freiheit __EOS__ + diff --git a/BotSharp.WebHost/ner-crf.corpus.predict.txt b/BotSharp.WebHost/ner-crf.corpus.predict.txt new file mode 100644 index 000000000..33dadcc5a --- /dev/null +++ b/BotSharp.WebHost/ner-crf.corpus.predict.txt @@ -0,0 +1,10 @@ + 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 new file mode 100644 index 000000000..aea6d1e2e --- /dev/null +++ b/BotSharp.WebHost/ner-crf.parsed.predict.txt @@ -0,0 +1,10 @@ + 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__ +