From 921e1fbc0c9e74bf07b9e8d36e8041345f6e325a Mon Sep 17 00:00:00 2001 From: Bolo <36342729+PppBr@users.noreply.github.com> Date: Fri, 3 Aug 2018 17:18:40 -0500 Subject: [PATCH] add sebis agent --- .../Abstractions/IHookDbInitializer.cs | 19 + .../Abstractions/IInitializationLoader.cs | 14 + BotSharp.Core/Accounts/AccountCore.cs | 64 + .../Accounts/AccountDbInitializer.cs | 39 + BotSharp.Core/Accounts/User.cs | 60 + BotSharp.Core/Accounts/UserAuth.cs | 36 + BotSharp.Core/BotSharp.Core.csproj | 7 +- BotSharp.Core/Engines/BotEngineBase.cs | 5 +- BotSharp.Core/Engines/BotTrainer.cs | 13 +- BotSharp.Core/Engines/DbInitializer.cs | 33 + .../Dialogflow/AgentImporterInDialogflow.cs | 6 +- BotSharp.Core/Engines/Rasa/RasaAi.cs | 9 +- .../Engines/Sebis/AgentImporterInSebis.cs | 162 + BotSharp.Core/Engines/Sebis/SebisAgent.cs | 20 + BotSharp.Core/Engines/Sebis/SebisIntent.cs | 16 + .../Engines/Sebis/SebisIntentExpression.cs | 12 + .../Sebis/SebisIntentExpressionPart.cs | 16 + BotSharp.RestApi/AgentController.cs | 7 +- .../AuthenticationController.cs | 63 + .../Authentication/VmUserLogin.cs | 22 + BotSharp.RestApi/BotSharp.RestApi.csproj | 13 + BotSharp.UI/README.md | 2 +- BotSharp.UI/src/config/config.js | 5 +- BotSharp.UI/src/main.js | 2 +- BotSharp.UI/src/views/account/login.vue | 2 +- BotSharp.UI/src/views/account/settings.vue | 4 +- BotSharp.UnitTest/AgentTest.cs | 3 +- BotSharp.UnitTest/TestEssential.cs | 7 +- .../DbInitializer/Accounts/users.json | 12 + .../Agents/Sebis/Airport/agent.json | 4 + .../Agents/Sebis/Airport/corpus.json | 4243 +++++++++++++++++ .../App_Data/DbInitializer/Agents/agents.json | 8 + BotSharp.WebHost/InitializationLoader.cs | 26 + BotSharp.WebHost/Settings/auth.json | 9 + BotSharp.WebHost/Startup.cs | 29 +- BotSharp.sln | 2 +- 36 files changed, 4952 insertions(+), 42 deletions(-) create mode 100644 BotSharp.Core/Abstractions/IHookDbInitializer.cs create mode 100644 BotSharp.Core/Abstractions/IInitializationLoader.cs create mode 100644 BotSharp.Core/Accounts/AccountCore.cs create mode 100644 BotSharp.Core/Accounts/AccountDbInitializer.cs create mode 100644 BotSharp.Core/Accounts/User.cs create mode 100644 BotSharp.Core/Accounts/UserAuth.cs create mode 100644 BotSharp.Core/Engines/DbInitializer.cs create mode 100644 BotSharp.Core/Engines/Sebis/AgentImporterInSebis.cs create mode 100644 BotSharp.Core/Engines/Sebis/SebisAgent.cs create mode 100644 BotSharp.Core/Engines/Sebis/SebisIntent.cs create mode 100644 BotSharp.Core/Engines/Sebis/SebisIntentExpression.cs create mode 100644 BotSharp.Core/Engines/Sebis/SebisIntentExpressionPart.cs create mode 100644 BotSharp.RestApi/Authentication/AuthenticationController.cs create mode 100644 BotSharp.RestApi/Authentication/VmUserLogin.cs create mode 100644 BotSharp.WebHost/App_Data/DbInitializer/Accounts/users.json create mode 100644 BotSharp.WebHost/App_Data/DbInitializer/Agents/Sebis/Airport/agent.json create mode 100644 BotSharp.WebHost/App_Data/DbInitializer/Agents/Sebis/Airport/corpus.json create mode 100644 BotSharp.WebHost/InitializationLoader.cs create mode 100644 BotSharp.WebHost/Settings/auth.json diff --git a/BotSharp.Core/Abstractions/IHookDbInitializer.cs b/BotSharp.Core/Abstractions/IHookDbInitializer.cs new file mode 100644 index 000000000..f0e86df66 --- /dev/null +++ b/BotSharp.Core/Abstractions/IHookDbInitializer.cs @@ -0,0 +1,19 @@ +using EntityFrameworkCore.BootKit; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.Core.Abstractions +{ + /// + /// Initialize data for modules + /// + public interface IHookDbInitializer + { + /// + /// value smaller is higher priority + /// + int Priority { get; } + void Load(Database dc); + } +} diff --git a/BotSharp.Core/Abstractions/IInitializationLoader.cs b/BotSharp.Core/Abstractions/IInitializationLoader.cs new file mode 100644 index 000000000..befa988a3 --- /dev/null +++ b/BotSharp.Core/Abstractions/IInitializationLoader.cs @@ -0,0 +1,14 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.Core.Abstractions +{ + public interface IInitializationLoader + { + int Priority { get; } + void Initialize(IConfiguration config, IHostingEnvironment env); + } +} diff --git a/BotSharp.Core/Accounts/AccountCore.cs b/BotSharp.Core/Accounts/AccountCore.cs new file mode 100644 index 000000000..8c048c6b3 --- /dev/null +++ b/BotSharp.Core/Accounts/AccountCore.cs @@ -0,0 +1,64 @@ +using DotNetToolkit; +using EntityFrameworkCore.BootKit; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BotSharp.Core.Accounts +{ + public class AccountCore + { + private Database _dc; + private IConfiguration _config; + + public AccountCore(Database dc = null) + { + if (dc == null) + { + dc = new DefaultDataContextLoader().GetDefaultDc(); + } + else + { + _dc = dc; + } + + _config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); + } + + public void CreateUser(User user) + { + user.Authenticaiton.IsActivated = false; + user.Authenticaiton.Salt = PasswordHelper.GetSalt(); + user.Authenticaiton.Password = PasswordHelper.Hash(user.Authenticaiton.Password, user.Authenticaiton.Salt); + user.Authenticaiton.ActivationCode = Guid.NewGuid().ToString("N"); + + _dc.Transaction(() => + { + _dc.Table().Add(user); + }); + + + $"Created user {user.Email}, user id: {user.Id}".Log(LogLevel.INFO); + } + + public void Activate(string activationCode) + { + var activation = _dc.Table().FirstOrDefault(x => x.ActivationCode == activationCode && !x.IsActivated); + if (activation == null) + { + } + else + { + _dc.Transaction(() => + { + activation = _dc.Table().FirstOrDefault(x => x.ActivationCode == activationCode); + activation.ActivationCode = String.Empty; + activation.IsActivated = true; + activation.UpdatedTime = DateTime.UtcNow; + }); + } + } + } +} diff --git a/BotSharp.Core/Accounts/AccountDbInitializer.cs b/BotSharp.Core/Accounts/AccountDbInitializer.cs new file mode 100644 index 000000000..0e55e6e03 --- /dev/null +++ b/BotSharp.Core/Accounts/AccountDbInitializer.cs @@ -0,0 +1,39 @@ +using BotSharp.Core.Abstractions; +using EntityFrameworkCore.BootKit; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; + +namespace BotSharp.Core.Accounts +{ + public class AccountDbInitializer : IHookDbInitializer + { + public int Priority => 100; + + public void Load(Database dc) + { + ImportAccount(dc); + } + + private void ImportAccount(Database dc) + { + var dataPath = Path.Join(AppDomain.CurrentDomain.GetData("DataPath").ToString(), "DbInitializer", "Accounts"); + string json = File.ReadAllText(Path.Join(dataPath, "users.json")); + + var users = JsonConvert.DeserializeObject>(json); + users.ForEach(user => + { + if (!dc.Table().Any(x => x.UserName == user.UserName)) + { + var core = new AccountCore(dc); + core.CreateUser(user); + core.Activate(user.Authenticaiton.ActivationCode); + } + }); + + } + } +} diff --git a/BotSharp.Core/Accounts/User.cs b/BotSharp.Core/Accounts/User.cs new file mode 100644 index 000000000..c33816eda --- /dev/null +++ b/BotSharp.Core/Accounts/User.cs @@ -0,0 +1,60 @@ +using EntityFrameworkCore.BootKit; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; + +namespace BotSharp.Core.Accounts +{ + /// + /// User profile + /// + [Table("User")] + public class User : DbRecord, IDbRecord + { + [Required] + [StringLength(64)] + public String UserName { get; set; } + + [Required] + [StringLength(64)] + [DataType(DataType.EmailAddress)] + public String Email { get; set; } + + [StringLength(32)] + public String FirstName { get; set; } + + [StringLength(32)] + public String LastName { get; set; } + + [MaxLength(256)] + public String Description { get; set; } + + [Required] + [DataType(DataType.DateTime)] + public DateTime SignupDate { get; set; } + + [DataType(DataType.Date)] + public DateTime? Birthday { get; set; } + + [MaxLength(36)] + public String Nationality { get; set; } + + [NotMapped] + public String FullName + { + get + { + return FirstName + (String.IsNullOrEmpty(LastName) ? "" : " " + LastName); + } + } + + public UserAuth Authenticaiton { get; set; } + + public User() + { + SignupDate = DateTime.UtcNow; + } + } +} diff --git a/BotSharp.Core/Accounts/UserAuth.cs b/BotSharp.Core/Accounts/UserAuth.cs new file mode 100644 index 000000000..1079ed4ee --- /dev/null +++ b/BotSharp.Core/Accounts/UserAuth.cs @@ -0,0 +1,36 @@ +using EntityFrameworkCore.BootKit; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Text; + +namespace BotSharp.Core.Accounts +{ + /// + /// User authentication + /// + [Table("UserAuth")] + public class UserAuth : DbRecord, IDbRecord + { + [StringLength(36)] + public String UserId { get; set; } + + [Required] + [StringLength(256)] + [DataType(DataType.Password)] + public String Password { get; set; } + + [Required] + [StringLength(64)] + public String Salt { get; set; } + + [StringLength(32)] + public String ActivationCode { get; set; } + + public Boolean IsActivated { get; set; } + + [ForeignKey("UserId")] + public User User { get; set; } + } +} diff --git a/BotSharp.Core/BotSharp.Core.csproj b/BotSharp.Core/BotSharp.Core.csproj index 871040fe7..6378b2af1 100644 --- a/BotSharp.Core/BotSharp.Core.csproj +++ b/BotSharp.Core/BotSharp.Core.csproj @@ -12,11 +12,11 @@ true Haiping Chen - BotSharp Chabot Platform + BotSharp Chatbot Platform Open source chatbot platform which is written in C# runs on .Net Core and is enterprise oriented. Integrated with multiple bot engines besides BotSharp bot engine. Modulized pipeline design make NLP tasks plugin easily. Abstract platform and NLP task, migrate existed chatbot from a platform into another platform perfectly through dump and restore. MIT https://github.com/Oceania2018/BotSharp - NLU, Chatbot, Bot, AI Bot + NLU, Chatbot, Bot, AI Bot, Artificial Intelligence, RPA 1.4.0 Add NLP pipeline. Support training model by input context. Since 2018 Haiping Chen @@ -36,7 +36,8 @@ - + + diff --git a/BotSharp.Core/Engines/BotEngineBase.cs b/BotSharp.Core/Engines/BotEngineBase.cs index 69056c501..62251799c 100644 --- a/BotSharp.Core/Engines/BotEngineBase.cs +++ b/BotSharp.Core/Engines/BotEngineBase.cs @@ -28,7 +28,8 @@ public abstract class BotEngineBase public BotEngineBase() { dc = new DefaultDataContextLoader().GetDefaultDc(); - DbInitializerPath = $"{Database.ContentRootPath}App_Data{Path.DirectorySeparatorChar}DbInitializer{Path.DirectorySeparatorChar}"; + string dataPath = AppDomain.CurrentDomain.GetData("DataPath").ToString(); + DbInitializerPath = Path.Join(dataPath, $"DbInitializer"); } public Agent LoadAgent(string id) @@ -62,7 +63,7 @@ public Agent LoadAgent(string id) { var importer = new TAgentImporter(); - string dataDir = $"{DbInitializerPath}Agents{Path.DirectorySeparatorChar}"; + string dataDir = Path.Join(DbInitializerPath, "Agents"); int row = dc.DbTran(() => { diff --git a/BotSharp.Core/Engines/BotTrainer.cs b/BotSharp.Core/Engines/BotTrainer.cs index b6c6c9940..c5b6984f0 100644 --- a/BotSharp.Core/Engines/BotTrainer.cs +++ b/BotSharp.Core/Engines/BotTrainer.cs @@ -8,6 +8,7 @@ using DotNetToolkit; using EntityFrameworkCore.BootKit; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; using Newtonsoft.Json.Linq; namespace BotSharp.Core.Engines @@ -43,22 +44,24 @@ public string Train(Agent agent) }); // Get NLP Provider - string providerName = Database.Configuration.GetSection($"{config}:Provider").Value; - var provider = TypeHelper.GetInstance(providerName, Database.Assemblies) as INlpPipeline; - provider.Configuration = Database.Configuration.GetSection("BotSharpAi"); + var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); + var assemblies = (string[])AppDomain.CurrentDomain.GetData("Assemblies"); + string providerName = config.GetSection($"{config}:Provider").Value; + var provider = TypeHelper.GetInstance(providerName, assemblies) as INlpPipeline; + provider.Configuration = config.GetSection("BotSharpAi"); provider.Process(agent, data); //var corpus = agent.GrabCorpus(dc); // pipe process - var pipelines = Database.Configuration.GetSection($"{config}:Pipe").Value + var pipelines = config.GetSection($"{config}:Pipe").Value .Split(',') .Select(x => x.Trim()) .ToList(); pipelines.ForEach(pipeName => { - var pipe = TypeHelper.GetInstance(pipeName, Database.Assemblies) as INlpPipeline; + var pipe = TypeHelper.GetInstance(pipeName, assemblies) as INlpPipeline; pipe.Configuration = provider.Configuration; pipe.Process(agent, data); }); diff --git a/BotSharp.Core/Engines/DbInitializer.cs b/BotSharp.Core/Engines/DbInitializer.cs new file mode 100644 index 000000000..d9d5c066e --- /dev/null +++ b/BotSharp.Core/Engines/DbInitializer.cs @@ -0,0 +1,33 @@ +using BotSharp.Core.Abstractions; +using DotNetToolkit; +using EntityFrameworkCore.BootKit; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BotSharp.Core.Engines +{ + public class DbInitializer : IInitializationLoader + { + public int Priority => 1; + + public void Initialize(IConfiguration config, IHostingEnvironment env) + { + var dc = new DefaultDataContextLoader().GetDefaultDc(); + + var assemblies = (string[])AppDomain.CurrentDomain.GetData("Assemblies"); + var instances = TypeHelper.GetInstanceWithInterface(assemblies); + + // initial app db order by priority + instances.OrderBy(x => x.Priority).ToList() + .ForEach(instance => + { + Console.WriteLine($"DbInitializer: {instance.ToString()}"); + dc.Transaction(() => instance.Load(dc)); + }); + } + } +} diff --git a/BotSharp.Core/Engines/Dialogflow/AgentImporterInDialogflow.cs b/BotSharp.Core/Engines/Dialogflow/AgentImporterInDialogflow.cs index 3a6a10160..b76c9d2c9 100644 --- a/BotSharp.Core/Engines/Dialogflow/AgentImporterInDialogflow.cs +++ b/BotSharp.Core/Engines/Dialogflow/AgentImporterInDialogflow.cs @@ -28,7 +28,7 @@ public class AgentImporterInDialogflow : IAgentImporter public Agent LoadAgent(AgentImportHeader agentHeader, string agentDir) { // load agent profile - string data = File.ReadAllText($"{agentDir}{Path.DirectorySeparatorChar}Dialogflow{Path.DirectorySeparatorChar}{agentHeader.Name}{Path.DirectorySeparatorChar}agent.json"); + string data = File.ReadAllText(Path.Join(agentDir, "Dialogflow", $"agentHeader.Name{Path.DirectorySeparatorChar}agent.json")); var agent = JsonConvert.DeserializeObject(data); agent.Name = agentHeader.Name; agent.Id = agentHeader.Id; @@ -56,7 +56,7 @@ public Agent LoadAgent(AgentImportHeader agentHeader, string agentDir) public void LoadCustomEntities(Agent agent, string agentDir) { agent.Entities = new List(); - string entityDir = $"{agentDir}{Path.DirectorySeparatorChar}Dialogflow{Path.DirectorySeparatorChar}{agent.Name}{Path.DirectorySeparatorChar}entities"; + string entityDir = Path.Join(agentDir, "Dialogflow", $"{agent.Name}{Path.DirectorySeparatorChar}entities"); if (!Directory.Exists(entityDir)) return; Directory.EnumerateFiles(entityDir) @@ -91,7 +91,7 @@ public void LoadCustomEntities(Agent agent, string agentDir) public void LoadIntents(Agent agent, string agentDir) { agent.Intents = new List(); - string intentDir = $"{agentDir}{Path.DirectorySeparatorChar}Dialogflow{Path.DirectorySeparatorChar}{agent.Name}{Path.DirectorySeparatorChar}intents"; + string intentDir = Path.Join(agentDir, "Dialogflow", $"{agent.Name}{Path.DirectorySeparatorChar}intents"); if (!Directory.Exists(intentDir)) return; Directory.EnumerateFiles(intentDir) diff --git a/BotSharp.Core/Engines/Rasa/RasaAi.cs b/BotSharp.Core/Engines/Rasa/RasaAi.cs index 0106b03f0..fceac1af4 100644 --- a/BotSharp.Core/Engines/Rasa/RasaAi.cs +++ b/BotSharp.Core/Engines/Rasa/RasaAi.cs @@ -83,7 +83,8 @@ public AIResponse TextRequest(AIRequest request) private IRestResponse CallRasa(string projectId, string text, string model) { - var client = new RestClient($"{Database.Configuration.GetSection("Rasa:Nlu").Value}"); + var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); + var client = new RestClient($"{config.GetSection("Rasa:Nlu").Value}"); var rest = new RestRequest("parse", Method.POST); string json = JsonConvert.SerializeObject(new { Project = projectId, Q = text, Model = model }, @@ -105,7 +106,8 @@ public void Train() }; var corpus = GetIntentExpressions(); - var client = new RestClient($"{Database.Configuration.GetSection("Rasa:Nlu").Value}"); + var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); + var client = new RestClient($"{config.GetSection("Rasa:Nlu").Value}"); var contextHashs = corpus.UserSays .Select(x => x.ContextHash) @@ -195,7 +197,8 @@ public void Train() rest.AddQueryParameter("project", agent.Id); rest.AddQueryParameter("model", ctx); string trainingConfig = agent.Language == "zh" ? "config_jieba_mitie_sklearn.yml" : "config_mitie_sklearn.yml"; - string body = File.ReadAllText($"{Database.ContentRootPath}{Path.DirectorySeparatorChar}Settings{Path.DirectorySeparatorChar}{trainingConfig}"); + var contentRootPatch = AppDomain.CurrentDomain.GetData("ContentRootPath").ToString(); + string body = File.ReadAllText(Path.Join(contentRootPatch, "Settings", trainingConfig)); body = $"{body}\r\ndata: {json}"; rest.AddParameter("application/x-yml", body, ParameterType.RequestBody); diff --git a/BotSharp.Core/Engines/Sebis/AgentImporterInSebis.cs b/BotSharp.Core/Engines/Sebis/AgentImporterInSebis.cs new file mode 100644 index 000000000..2d59476bc --- /dev/null +++ b/BotSharp.Core/Engines/Sebis/AgentImporterInSebis.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using BotSharp.Core.Adapters.Dialogflow; +using BotSharp.Core.Adapters.Sebis; +using BotSharp.Core.Agents; +using BotSharp.Core.Entities; +using BotSharp.Core.Intents; +using BotSharp.Core.Models; +using DotNetToolkit; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace BotSharp.Core.Engines +{ + /// + /// Import agent from Dialogflow + /// + public class AgentImporterInSebis : IAgentImporter + { + /// + /// Load agent meta + /// + /// + /// + /// + public Agent LoadAgent(AgentImportHeader agentHeader, string agentDir) + { + // load agent profile + string data = File.ReadAllText(Path.Join(agentDir, "Sebis", $"{agentHeader.Name}{Path.DirectorySeparatorChar}agent.json")); + var agent = JsonConvert.DeserializeObject(data); + agent.Name = agentHeader.Name; + agent.Id = agentHeader.Id; + + var result = agent.ToObject(); + result.ClientAccessToken = agentHeader.ClientAccessToken; + result.DeveloperAccessToken = agentHeader.DeveloperAccessToken; + if(agentHeader.UserId != null) + { + result.UserId = agentHeader.UserId; + } + + return result; + } + + public void LoadCustomEntities(Agent agent, string agentDir) + { + agent.Entities = new List(); + } + + public void LoadIntents(Agent agent, string agentDir) + { + string data = File.ReadAllText(Path.Join(agentDir, "Sebis", $"{agent.Name}{Path.DirectorySeparatorChar}corpus.json")); + var sentences = JsonConvert.DeserializeObject(data).Sentences; + + agent.Intents = sentences.Select(x => x.Name).Distinct().Select(x => new Intent{Name = x}).ToList(); + + agent.Intents.ForEach(intent => { + intent.UserSays = new List(); + + var userSays = sentences.Where(x => x.Name == intent.Name).ToList(); + + userSays.ForEach(say => + { + var expression = new IntentExpression(); + + expression.Data = new List(); + + for(int index = 0; index < say.Entities.Count; index++) + { + + } + + intent.UserSays.Add(expression); + }); + }); + } + + private Intent ImportIntentUserSays(Agent agent, Intent intent, string fileName) + { + // void id confict + intent.Id = Guid.NewGuid().ToString(); + intent.Name = intent.Name.Replace("/", "_"); + // load user expressions + + string expressionFileName = fileName.Replace(intent.Name, $"{intent.Name}_usersays_{agent.Language}"); + if (File.Exists(expressionFileName)) + { + string expressionJson = File.ReadAllText($"{expressionFileName}"); + intent.UserSays = JsonConvert.DeserializeObject>(expressionJson); + } + + return null; + } + + public void LoadBuildinEntities(Agent agent, string agentDir) + { + agent.Intents.ForEach(intent => + { + + if (intent.UserSays != null) + { + intent.UserSays.ForEach(us => + { + us.Data.Where(data => data.Meta != null) + .ToList() + .ForEach(data => + { + LoadBuildinEntityTypePerUserSay(agent, data); + }); + }); + } + + }); + } + + private void LoadBuildinEntityTypePerUserSay(Agent agent, IntentExpressionPart data) + { + var existedEntityType = agent.Entities.FirstOrDefault(x => x.Name == data.Meta); + + if (existedEntityType == null) + { + existedEntityType = new EntityType + { + Name = data.Meta, + Entries = new List(), + IsOverridable = true + }; + + agent.Entities.Add(existedEntityType); + } + + var entries = existedEntityType.Entries.Select(x => x.Value.ToLower()).ToList(); + if (!entries.Contains(data.Text.ToLower())) + { + existedEntityType.Entries.Add(new EntityEntry + { + Value = data.Text, + Synonyms = new List + { + new EntrySynonym + { + Synonym = data.Text + } + } + }); + } + } + } + + public class Sebis + { + public string Name { get; set; } + public string Desc { get; set; } + public string Lang { get; set; } + public List> Sentences { get; set; } + } + + +} diff --git a/BotSharp.Core/Engines/Sebis/SebisAgent.cs b/BotSharp.Core/Engines/Sebis/SebisAgent.cs new file mode 100644 index 000000000..002516c7c --- /dev/null +++ b/BotSharp.Core/Engines/Sebis/SebisAgent.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace BotSharp.Core.Adapters.Sebis +{ + public class SebisAgent + { + public String Id { get; set; } + public String Name { get; set; } + [JsonProperty("desc")] + public String Description { get; set; } + [JsonProperty("lang")] + public String Language { get; set; } + + public List Sentences { get; set; } + } +} diff --git a/BotSharp.Core/Engines/Sebis/SebisIntent.cs b/BotSharp.Core/Engines/Sebis/SebisIntent.cs new file mode 100644 index 000000000..3abb8f0ad --- /dev/null +++ b/BotSharp.Core/Engines/Sebis/SebisIntent.cs @@ -0,0 +1,16 @@ +using BotSharp.Core.Intents; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.Core.Adapters.Sebis +{ + public class SebisIntent + { + public string Text { get; set; } + [JsonProperty("intent")] + public string Name { get; set; } + public List Entities { get; set; } + } +} diff --git a/BotSharp.Core/Engines/Sebis/SebisIntentExpression.cs b/BotSharp.Core/Engines/Sebis/SebisIntentExpression.cs new file mode 100644 index 000000000..c8af71651 --- /dev/null +++ b/BotSharp.Core/Engines/Sebis/SebisIntentExpression.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; +using BotSharp.Core.Engines; + +namespace BotSharp.Core.Adapters.Sebis +{ + public class SebisIntentExpression : TrainingIntentExpression + { + + } +} \ No newline at end of file diff --git a/BotSharp.Core/Engines/Sebis/SebisIntentExpressionPart.cs b/BotSharp.Core/Engines/Sebis/SebisIntentExpressionPart.cs new file mode 100644 index 000000000..85c8dfe59 --- /dev/null +++ b/BotSharp.Core/Engines/Sebis/SebisIntentExpressionPart.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; +using BotSharp.Core.Engines; +using Newtonsoft.Json; + +namespace BotSharp.Core.Adapters.Sebis +{ + public class SebisIntentExpressionPart : TrainingIntentExpressionPart + { + [JsonProperty("stop")] + public new int End { get; set; } + [JsonProperty("text")] + public new String Value { get; set; } + } +} \ No newline at end of file diff --git a/BotSharp.RestApi/AgentController.cs b/BotSharp.RestApi/AgentController.cs index 49bc2de25..8e8fa3237 100644 --- a/BotSharp.RestApi/AgentController.cs +++ b/BotSharp.RestApi/AgentController.cs @@ -1,5 +1,6 @@ using BotSharp.Core.Agents; using BotSharp.Core.Engines; +using BotSharp.Core.Engines.BotSharp; using BotSharp.Core.Models; using EntityFrameworkCore.BootKit; using Microsoft.AspNetCore.Mvc; @@ -26,12 +27,12 @@ public class AgentController : ControllerBase [HttpGet("{agentId}")] public ActionResult Restore([FromRoute] String agentId) { - var botsHeaderFilePath = $"{Database.ContentRootPath}App_Data{Path.DirectorySeparatorChar}DbInitializer{Path.DirectorySeparatorChar}Agents{Path.DirectorySeparatorChar}agents.json"; + var botsHeaderFilePath = Path.Join(AppDomain.CurrentDomain.GetData("DataPath").ToString(), $"DbInitializer{Path.DirectorySeparatorChar}Agents{Path.DirectorySeparatorChar}agents.json"); var agents = JsonConvert.DeserializeObject>(System.IO.File.ReadAllText(botsHeaderFilePath)); - var rasa = new RasaAi(); + var rasa = new BotSharpAi(); var agentHeader = agents.First(x => x.Id == agentId); - rasa.RestoreAgent(agentHeader); + rasa.RestoreAgent(agentHeader); return Ok(); } diff --git a/BotSharp.RestApi/Authentication/AuthenticationController.cs b/BotSharp.RestApi/Authentication/AuthenticationController.cs new file mode 100644 index 000000000..72df1704a --- /dev/null +++ b/BotSharp.RestApi/Authentication/AuthenticationController.cs @@ -0,0 +1,63 @@ +using BotSharp.Core.Accounts; +using DotNetToolkit; +using DotNetToolkit.JwtHelper; +using EntityFrameworkCore.BootKit; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BotSharp.RestApi.Authentication +{ + /// + /// User authentication + /// + public class AuthenticationController : ControllerBase + { + /// + /// Get user token + /// + /// + /// + [AllowAnonymous] + [HttpPost("/token")] + public IActionResult Token([FromBody] VmUserLogin userModel) + { + if (String.IsNullOrEmpty(userModel.UserName) || String.IsNullOrEmpty(userModel.Password)) + { + return new BadRequestObjectResult("Username and password should not be empty."); + } + + var dc = new DefaultDataContextLoader().GetDefaultDc(); + + // validate from local + var user = (from usr in dc.Table() + join auth in dc.Table() on usr.Id equals auth.UserId + where usr.Email == userModel.UserName + select auth).FirstOrDefault(); + + if (user != null) + { + // validate password + string hash = PasswordHelper.Hash(userModel.Password, user.Salt); + if (user.Password == hash) + { + var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); + return Ok(JwtToken.GenerateToken(config, user.UserId)); + } + else + { + return BadRequest("Authorization Failed."); + } + } + else + { + return BadRequest("Account doesn't exist"); + } + } + } + +} diff --git a/BotSharp.RestApi/Authentication/VmUserLogin.cs b/BotSharp.RestApi/Authentication/VmUserLogin.cs new file mode 100644 index 000000000..b49960bba --- /dev/null +++ b/BotSharp.RestApi/Authentication/VmUserLogin.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BotSharp.RestApi.Authentication +{ + /// + /// User login view model + /// + public class VmUserLogin + { + /// + /// User identity, email or phone + /// + public String UserName { get; set; } + + /// + /// User password + /// + public String Password { get; set; } + } +} diff --git a/BotSharp.RestApi/BotSharp.RestApi.csproj b/BotSharp.RestApi/BotSharp.RestApi.csproj index ed3204a09..6c85eac94 100644 --- a/BotSharp.RestApi/BotSharp.RestApi.csproj +++ b/BotSharp.RestApi/BotSharp.RestApi.csproj @@ -2,6 +2,19 @@ netcoreapp2.1 + true + Haiping Chen + Personal + BotSharp + Restful API for BotSharp.Core + https://github.com/Oceania2018/BotSharp + https://github.com/Oceania2018/BotSharp/tree/master/BotSharp.RestApi + MIT + https://raw.githubusercontent.com/Oceania2018/BotSharp/master/BotSharp.WebHost/wwwroot/images/BotSharp.png + Since 2018 Haiping Chen + https://github.com/Oceania2018/BotSharp/blob/master/LICENSE + NLU, Chatbot, Bot, AI Bot + Restful API for BotSharp.Core diff --git a/BotSharp.UI/README.md b/BotSharp.UI/README.md index e707404a6..f6a500bcb 100644 --- a/BotSharp.UI/README.md +++ b/BotSharp.UI/README.md @@ -4,7 +4,7 @@ Voiceweb AI Chatbot Web Console ## How to install #### Download source code ````sh -git clone https://github.com/voicecoin/voiceweb-chatbot-vue +git clone https://github.com/Oceania2018/BotSharp ```` #### Run node.js server ````sh diff --git a/BotSharp.UI/src/config/config.js b/BotSharp.UI/src/config/config.js index dc97e6572..9453ea598 100644 --- a/BotSharp.UI/src/config/config.js +++ b/BotSharp.UI/src/config/config.js @@ -2,8 +2,7 @@ import Env from './env'; let config = { env: Env, - authURL: 'http://0.0.0.0:3112', - baseURL: (Env == 'development' ? `http://0.0.0.0:3112` : `http://0.0.0.0:3112`), - testAccount: {username: `botsharp@gmail.com`, password: (Env == 'development' ? `botsharp` : `botsharp`)} + baseURL: (Env == 'development' ? `http://localhost:3112` : `http://localhost:3112`), + testAccount: {username: `support@botsharp.io`, password: (Env == 'development' ? `botsharp` : ``)} }; export default config; \ No newline at end of file diff --git a/BotSharp.UI/src/main.js b/BotSharp.UI/src/main.js index 7e6ed28fe..41e08fef2 100644 --- a/BotSharp.UI/src/main.js +++ b/BotSharp.UI/src/main.js @@ -88,7 +88,7 @@ const store = new Vuex.Store({ authenticated(state, token) { localStorage.setItem('token', token); router.push('/agent/agents'); - HTTP.get('/account', { baseURL: config.authURL }) + HTTP.get('/account', { baseURL: config.baseURL }) .then(response => { state.user = response.data; localStorage.setItem('user', JSON.stringify(response.data)); diff --git a/BotSharp.UI/src/views/account/login.vue b/BotSharp.UI/src/views/account/login.vue index 0256103ae..00181b64f 100644 --- a/BotSharp.UI/src/views/account/login.vue +++ b/BotSharp.UI/src/views/account/login.vue @@ -56,7 +56,7 @@ }) }, getToken() { - this.$ajax.post(`/token`, this.formInline, { baseURL: this.$config.authURL }) + this.$ajax.post(`/token`, this.formInline, { baseURL: this.$config.baseURL }) .then(response => { this.$store.commit('authenticated', response.data) }); diff --git a/BotSharp.UI/src/views/account/settings.vue b/BotSharp.UI/src/views/account/settings.vue index 5af7d924d..3cc737ef0 100644 --- a/BotSharp.UI/src/views/account/settings.vue +++ b/BotSharp.UI/src/views/account/settings.vue @@ -52,7 +52,7 @@ }, created() { let agentId = this.$route.query.agentId; - this.$ajax.get(`/Account`, { baseURL: this.$config.authURL }) + this.$ajax.get(`/Account`, { baseURL: this.$config.baseURL }) .then(response => { this.user = response.data; }); @@ -61,7 +61,7 @@ updateAgent(agentId){ this.$ajax.put('/v1/Agents/' + agentId, this.agent) .then(response => { - this.$Message.info("保存成功"); + this.$Message.info("Saved"); }); } } diff --git a/BotSharp.UnitTest/AgentTest.cs b/BotSharp.UnitTest/AgentTest.cs index 9b5c2499b..1c043195a 100644 --- a/BotSharp.UnitTest/AgentTest.cs +++ b/BotSharp.UnitTest/AgentTest.cs @@ -45,7 +45,8 @@ public void UpdateAgentTest() [TestMethod] public void RestoreAgentFromDialogflowToRasaTest() { - var botsHeaderFilePath = $"{Database.ContentRootPath}App_Data{Path.DirectorySeparatorChar}DbInitializer{Path.DirectorySeparatorChar}Agents{Path.DirectorySeparatorChar}agents.json"; + string dataPath = AppDomain.CurrentDomain.GetData("DataPath").ToString(); + var botsHeaderFilePath = Path.Join(dataPath, "DbInitializer", $"Agents{Path.DirectorySeparatorChar}agents.json"); var agents = JsonConvert.DeserializeObject>(File.ReadAllText(botsHeaderFilePath)); agents.ForEach(agentHeader => { diff --git a/BotSharp.UnitTest/TestEssential.cs b/BotSharp.UnitTest/TestEssential.cs index d4180f6c6..6be81cfc3 100644 --- a/BotSharp.UnitTest/TestEssential.cs +++ b/BotSharp.UnitTest/TestEssential.cs @@ -25,10 +25,11 @@ public TestEssential() { configurationBuilder.AddJsonFile(setting, optional: false, reloadOnChange: true); }); - Database.Configuration = configurationBuilder.Build(); - Database.Assemblies = new String[] { "BotSharp.Core" }; - Database.ContentRootPath = contentRoot; + AppDomain.CurrentDomain.SetData("DataPath", Path.Join(contentRoot, "App_Data")); + AppDomain.CurrentDomain.SetData("Configuration", configurationBuilder.Build()); + AppDomain.CurrentDomain.SetData("ContentRootPath", contentRoot); + AppDomain.CurrentDomain.SetData("Assemblies", new String[] { "BotSharp.Core" }); dc = new DefaultDataContextLoader().GetDefaultDc(); } diff --git a/BotSharp.WebHost/App_Data/DbInitializer/Accounts/users.json b/BotSharp.WebHost/App_Data/DbInitializer/Accounts/users.json new file mode 100644 index 000000000..d723a7002 --- /dev/null +++ b/BotSharp.WebHost/App_Data/DbInitializer/Accounts/users.json @@ -0,0 +1,12 @@ +[ + { + "userName": "support@botsharp.io", + "email": "support@botsharp.io", + "firstName": "Support", + "lastName": "Botsharp", + "description": "demo account", + "authenticaiton": { + "password": "botsharp" + } + } +] diff --git a/BotSharp.WebHost/App_Data/DbInitializer/Agents/Sebis/Airport/agent.json b/BotSharp.WebHost/App_Data/DbInitializer/Agents/Sebis/Airport/agent.json new file mode 100644 index 000000000..622c13d39 --- /dev/null +++ b/BotSharp.WebHost/App_Data/DbInitializer/Agents/Sebis/Airport/agent.json @@ -0,0 +1,4 @@ +{ + "description": "NLU Evaluation Corpora", + "language": "en" + } \ No newline at end of file diff --git a/BotSharp.WebHost/App_Data/DbInitializer/Agents/Sebis/Airport/corpus.json b/BotSharp.WebHost/App_Data/DbInitializer/Agents/Sebis/Airport/corpus.json new file mode 100644 index 000000000..f9617fbb1 --- /dev/null +++ b/BotSharp.WebHost/App_Data/DbInitializer/Agents/Sebis/Airport/corpus.json @@ -0,0 +1,4243 @@ +{ + "name": "ChatbotCorpus", + "desc": "Visit https://github.com/sebischair/NLU-Evaluation-Corpora for more information", + "lang": "en", + "sentences": [ + { + "text": "i want to go marienplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationDest", + "start": 4, + "stop": 4, + "text": "marienplatz" + } + ] + }, + { + "text": "when is the next train in muncher freiheit?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "muncher freiheit" + } + ] + }, + { + "text": "when does the next u-bahn leaves from garching forschungszentrum?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 6, + "text": "u-bahn" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 9, + "stop": 10, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "from olympia einkaufszentrum to hauptbahnhof", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 2, + "text": "olympia einkaufszentrum" + }, + { + "entity": "StationDest", + "start": 4, + "stop": 4, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "when is the next train from winterstraße 12 to kieferngarten", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "winterstraße 12" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "kieferngarten" + } + ] + }, + { + "text": "when is the next rocket from winterstraße 12 to kieferngarte", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "rocket" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "winterstraße 12" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "kieferngarte" + } + ] + }, + { + "text": "can you find a connection from garching to hauptbahnhof?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "how to get from untere strassäcker 21 to fröttmaning", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 6, + "text": "untere strassäcker 21" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "fröttmaning" + } + ] + }, + { + "text": "how i can get from marienplatz to garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "marienplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "connection from boltzmannstraße to kieferngarten", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 2, + "stop": 2, + "text": "boltzmannstraße" + }, + { + "entity": "StationDest", + "start": 4, + "stop": 4, + "text": "kieferngarten" + } + ] + }, + { + "text": "how to get from bonner platz to freimann?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 5, + "text": "bonner platz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "freimann" + } + ] + }, + { + "text": "when is the next s-bahn leaving at garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 6, + "text": "s-bahn" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 9, + "stop": 9, + "text": "garching" + } + ] + }, + { + "text": "how do i get from oez to hbf?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "oez" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "hbf" + } + ] + }, + { + "text": "how to get from winterstrasse 12 to fröttmaning", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 5, + "text": "winterstrasse 12" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "fröttmaning" + } + ] + }, + { + "text": "how do i get from garching forschungszentrum to pasing", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "pasing" + } + ] + }, + { + "text": "theresienstraße to assling", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 0, + "stop": 0, + "text": "theresienstraße" + }, + { + "entity": "StationDest", + "start": 2, + "stop": 2, + "text": "assling" + } + ] + }, + { + "text": "how can i get from theresienstraße to munich east?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "theresienstraße" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 8, + "text": "munich east" + } + ] + }, + { + "text": "when does the next bus starts from garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "from quiddestraße to garching?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "garching" + } + ] + }, + { + "text": "can you find a connection from kurt-eisner-straße to garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 6, + "stop": 10, + "text": "kurt-eisner-straße" + }, + { + "entity": "StationDest", + "start": 12, + "stop": 13, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "can you find a connection from quiddestraße to garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 9, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "when does the next train leaves at garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "from hauptbahnhof to garching?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "hauptbahnhof" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "garching" + } + ] + }, + { + "text": "how can i get to glockenbachviertel from garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "glockenbachviertel" + } + ] + }, + { + "text": "how i can get from garching to nordfriedhof", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "nordfriedhof" + } + ] + }, + { + "text": "how can i get to glockenbachviertel from garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "glockenbachviertel" + } + ] + }, + { + "text": "when is the next train leaving in garching forschungszentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "how can i get from moosach to quiddestraße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "moosach" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "quiddestraße" + } + ] + }, + { + "text": "how can i get from moosach to poccistraße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "moosach" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "poccistraße" + } + ] + }, + { + "text": "how can i get from kurt-eisner-straße to garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 9, + "text": "kurt-eisner-straße" + }, + { + "entity": "StationDest", + "start": 11, + "stop": 12, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "how can i get from moosach to quiddestraße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "moosach" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "quiddestraße" + } + ] + }, + { + "text": "how can i get from moosach to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "moosach" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "odeonsplatz" + } + ] + }, + { + "text": "when does the next bus starts at garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "what's the shortest way from quiddestraße to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 4, + "stop": 4, + "text": "shortest" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "odeonsplatz" + } + ] + }, + { + "text": "when is the next bus from ostbahnhof", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "ostbahnhof" + } + ] + }, + { + "text": "how i can get from garching to neuperlach sued", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 8, + "text": "neuperlach sued" + } + ] + }, + { + "text": "when is the next train in munchner freiheit?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "munchner freiheit" + } + ] + }, + { + "text": "how i can get from marienplatz to garching?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "marienplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "how do i get from poccistraße to laim", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "poccistraße" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "laim" + } + ] + }, + { + "text": "i want to go garching from marienplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "marienplatz" + }, + { + "entity": "StationDest", + "start": 4, + "stop": 4, + "text": "garching" + } + ] + }, + { + "text": "how i can get from marienplatz to garching?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "marienplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "how can i get from hauptbahnhof to odeonsplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "hauptbahnhof" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "odeonsplatz" + } + ] + }, + { + "text": "prinzregentenplatz to rotkreuzplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 0, + "stop": 0, + "text": "prinzregentenplatz" + }, + { + "entity": "StationDest", + "start": 2, + "stop": 2, + "text": "rotkreuzplatz" + } + ] + }, + { + "text": "i want to go to garching from marienplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "marienplatz" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "garching" + } + ] + }, + { + "text": "next train from garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "train" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "garching" + } + ] + }, + { + "text": "from prinzregentenplatz to rotkreuzplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "prinzregentenplatz" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "rotkreuzplatz" + } + ] + }, + { + "text": "when is the next subway from garching forschungszentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "subway" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "from garching to klinikum", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "klinikum" + } + ] + }, + { + "text": "from garching foschungszentrum to odeonsplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 2, + "text": "garching foschungszentrum" + }, + { + "entity": "StationDest", + "start": 4, + "stop": 4, + "text": "odeonsplatz" + } + ] + }, + { + "text": "next bus in garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "garching" + } + ] + }, + { + "text": "when does the train leaving in garching forschungszentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "train" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "next subway from garching forschungszentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "subway" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 4, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "tell me the next bus from garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "next bus from garching, please.", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "garching" + } + ] + }, + { + "text": "next bus from garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "garching" + } + ] + }, + { + "text": "next bus from central station", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 4, + "text": "central station" + } + ] + }, + { + "text": "from garching to marienplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "marienplatz" + } + ] + }, + { + "text": "next bus from garching.", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "garching" + } + ] + }, + { + "text": "connection from garching to hauptbahnhof?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 2, + "stop": 2, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 4, + "stop": 4, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "when does the next bus departs from garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "find connection from hauptbahnhof to odeonsplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "hauptbahnhof" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "odeonsplatz" + } + ] + }, + { + "text": "when does the next u-bahn departs at garching forschungszentrum?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 6, + "text": "u-bahn" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 9, + "stop": 10, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "when does the next u-bahn departs at garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 6, + "text": "u-bahn" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 9, + "stop": 9, + "text": "garching" + } + ] + }, + { + "text": "when does the next subway departs at garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "subway" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "when is the next train in garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "how to get from münchner freiheit to garching ?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 5, + "text": "münchner freiheit" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "implerstraße to ostbahnhof", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 0, + "stop": 0, + "text": "implerstraße" + }, + { + "entity": "StationDest", + "start": 2, + "stop": 2, + "text": "ostbahnhof" + } + ] + }, + { + "text": "how can i get from hauptbahnhof to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "hauptbahnhof" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "odeonsplatz" + } + ] + }, + { + "text": "how can i go from garching forschungszentrum to prinzregentenplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "prinzregentenplatz" + } + ] + }, + { + "text": "how can i get from mangfallplatz to garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "mangfallplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "how can i get to hohenlindenerstraße", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "hohenlindenerstraße" + } + ] + }, + { + "text": "harthaus to hackerbrücke", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 0, + "stop": 0, + "text": "harthaus" + }, + { + "entity": "StationDest", + "start": 2, + "stop": 2, + "text": "hackerbrücke" + } + ] + }, + { + "text": "how can i get from feldmoching to garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "feldmoching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "from marienplatz to petershausen", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "marienplatz" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "petershausen" + } + ] + }, + { + "text": "when is the train from garching to marienplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "train" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "marienplatz" + } + ] + }, + { + "text": "neufahrn to garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 0, + "stop": 0, + "text": "neufahrn" + }, + { + "entity": "StationDest", + "start": 2, + "stop": 2, + "text": "garching" + } + ] + }, + { + "text": "how can i get from mangfallplatz to garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "mangfallplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "how can i get to hohenlindenerstr", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "hohenlindenerstr" + } + ] + }, + { + "text": "when is the next bus from garching forschungzentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "garching forschungzentrum" + } + ] + }, + { + "text": "how do i get from spitzingplatz to poccistraße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "spitzingplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "poccistraße" + } + ] + }, + { + "text": "how can i get from garching forschungszentrum to marienplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "marienplatz" + } + ] + }, + { + "text": "how can i get from klinkum to marienplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "klinkum" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "marienplatz" + } + ] + }, + { + "text": "how to get from alte heide to marienplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 5, + "text": "alte heide" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "marienplatz" + } + ] + }, + { + "text": "next train from muenchen freicheit", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "train" + }, + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 4, + "text": "muenchen freicheit" + } + ] + }, + { + "text": "depart in garching, i assume", + "intent": "DepartureTime", + "entities": [ + { + "entity": "StationStart", + "start": 2, + "stop": 2, + "text": "garching" + } + ] + }, + { + "text": "when does the next u-bahn depart at garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 6, + "text": "u-bahn" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 9, + "stop": 9, + "text": "garching" + } + ] + }, + { + "text": "the next bus from garching forschungzentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 2, + "stop": 2, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 1, + "stop": 1, + "text": "next" + }, + { + "entity": "StationStart", + "start": 4, + "stop": 5, + "text": "garching forschungzentrum" + } + ] + }, + { + "text": "when is the next train in alte heide?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "alte heide" + } + ] + }, + { + "text": "or depart from garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "garching" + } + ] + }, + { + "text": "hello munich city bot! how do i get from münchner freiheit to scheidplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 10, + "stop": 11, + "text": "münchner freiheit" + }, + { + "entity": "StationDest", + "start": 13, + "stop": 13, + "text": "scheidplatz" + } + ] + }, + { + "text": "how can i get from garching forschungszentrum to prinzregentenplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "prinzregentenplatz" + } + ] + }, + { + "text": "how can i get from neufahrn to garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "neufahrn" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "take me to the airport", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationDest", + "start": 4, + "stop": 4, + "text": "airport" + } + ] + }, + { + "text": "when does the next u6 leave from garching forschungszentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Line", + "start": 4, + "stop": 4, + "text": "u6" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "how i can get from munchner freiheit to nordfriedhof?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "munchner freiheit" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "nordfriedhof" + } + ] + }, + { + "text": "from harthaus to hackerbrücke", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "harthaus" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "hackerbrücke" + } + ] + }, + { + "text": "when is the train from garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "train" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + } + ] + }, + { + "text": "what is the next train from münchner freiheit", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "münchner freiheit" + } + ] + }, + { + "text": "how can i get from theresienstrasse to garching forschungszentrum", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "theresienstrasse" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "how can i get from münchner freiheit to odeonsplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "münchner freiheit" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "odeonsplatz" + } + ] + }, + { + "text": "from garching to hauptbahnhof", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "how can i get from garching to odeonsplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "odeonsplatz" + } + ] + }, + { + "text": "start: neufahrn end:garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 2, + "stop": 2, + "text": "neufahrn" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "garching" + } + ] + }, + { + "text": "how can i get from studentenstadt to garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "studentenstadt" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "when is the next bus from garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "take me from hauptbahnhof to odeonsplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "hauptbahnhof" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "odeonsplatz" + } + ] + }, + { + "text": "what's the shortest connection between quiddestraße and odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 4, + "stop": 4, + "text": "shortest" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "odeonsplatz" + } + ] + }, + { + "text": "what is the cheapest connection between quiddestraße and hauptbahnhof?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "cheapest" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "what's the shortest way between hauptbahnhof and odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 4, + "stop": 4, + "text": "shortest" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "hauptbahnhof" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "odeonsplatz" + } + ] + }, + { + "text": "how can i get from garching to münchner freiheit as fast as possible?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 10, + "stop": 10, + "text": "fast" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 8, + "text": "münchner freiheit" + } + ] + }, + { + "text": "what's the cheapest way from neuperlach süd to lehel?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 4, + "stop": 4, + "text": "cheapest" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "neuperlach süd" + }, + { + "entity": "StationDest", + "start": 10, + "stop": 10, + "text": "lehel" + } + ] + }, + { + "text": "how can i get from neuperlach zentrum to karlsplatz as fast as possible?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 10, + "stop": 10, + "text": "fast" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "neuperlach zentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "karlsplatz" + } + ] + }, + { + "text": "could you give me the fastest connection between brudermühlstraße and alte heide?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 5, + "stop": 5, + "text": "fastest" + }, + { + "entity": "StationStart", + "start": 8, + "stop": 8, + "text": "brudermühlstraße" + }, + { + "entity": "StationDest", + "start": 10, + "stop": 11, + "text": "alte heide" + } + ] + }, + { + "text": "is there a train from neuperlach zentrum to garching at 3 pm?", + "intent": "FindConnection", + "entities": [ + { + "entity": "TimeStartTime", + "start": 10, + "stop": 11, + "text": "3 pm" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "neuperlach zentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "garching" + } + ] + }, + { + "text": "can you find a connection from olympiazentrum to lehel at 2 pm?", + "intent": "FindConnection", + "entities": [ + { + "entity": "TimeStartTime", + "start": 10, + "stop": 11, + "text": "2 pm" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "olympiazentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "lehel" + } + ] + }, + { + "text": "i need a connection from harras to karl-preis-platz at 8 am.", + "intent": "FindConnection", + "entities": [ + { + "entity": "TimeStartTime", + "start": 13, + "stop": 14, + "text": "8 am" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "harras" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 11, + "text": "karl-preis-platz" + } + ] + }, + { + "text": "in need to be at hauptbahnhof at 1 pm, can you search a connection from garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "TimeEndTime", + "start": 7, + "stop": 8, + "text": "1 pm" + }, + { + "entity": "StationStart", + "start": 16, + "stop": 17, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "i need to be in garching at 9", + "intent": "FindConnection", + "entities": [ + { + "entity": "TimeEndTime", + "start": 7, + "stop": 7, + "text": "9" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "garching" + } + ] + }, + { + "text": "can i take a bus from quiddestraße to hauptbahnhof?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "can you find the shortest way from moosfeld to milbertshofen?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 4, + "stop": 4, + "text": "shortest" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "moosfeld" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "milbertshofen" + } + ] + }, + { + "text": "how can i get to neuperlach süd from garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 8, + "stop": 9, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 6, + "text": "neuperlach süd" + } + ] + }, + { + "text": "can you find a bus from quiddestraße to lehel?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "lehel" + } + ] + }, + { + "text": "is there a tram from karlsplatz to lehel?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "tram" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "karlsplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "lehel" + } + ] + }, + { + "text": "is there a bus from garching to moosach at around 5?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "bus" + }, + { + "entity": "TimeStartTime", + "start": 10, + "stop": 10, + "text": "5" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "moosach" + } + ] + }, + { + "text": "is there a bus from odeonsplatz to hauptbahnhof at 3 pm?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "bus" + }, + { + "entity": "TimeStartTime", + "start": 9, + "stop": 10, + "text": "3 pm" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "odeonsplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "can you tell me the cheapest way from garching forschungszentrum to quiddestraße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 5, + "stop": 5, + "text": "cheapest" + }, + { + "entity": "StationStart", + "start": 8, + "stop": 9, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 11, + "stop": 11, + "text": "quiddestraße" + } + ] + }, + { + "text": "how can i get to quiddestraße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "quiddestraße" + } + ] + }, + { + "text": "when does the next bus leaves from hauptbahnhof?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "how can i get from garching to hauptbahnhof?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "how can i get from kurt-eisner-straße to garching?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 9, + "text": "kurt-eisner-straße" + }, + { + "entity": "StationDest", + "start": 11, + "stop": 11, + "text": "garching" + } + ] + }, + { + "text": "when the next train in garching,forschungszentrum is leaving?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "train" + }, + { + "entity": "Criterion", + "start": 2, + "stop": 2, + "text": "next" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 7, + "text": "garching,forschungszentrum" + } + ] + }, + { + "text": "what is the next connection from garching forschungszentrum to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "odeonsplatz" + } + ] + }, + { + "text": "how can i get from mossach to garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "mossach" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "how can i get from garching forschungszentrum to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "odeonsplatz" + } + ] + }, + { + "text": "how can i get from garching, forschungszentrum to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 7, + "text": "garching, forschungszentrum" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "odeonsplatz" + } + ] + }, + { + "text": "how can i get from garching forschungszentrum to kurt-eisner-straße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "garching forschungszentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 12, + "text": "kurt-eisner-straße" + } + ] + }, + { + "text": "how can i get to boltzmannstraße from quiddestraße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "boltzmannstraße" + } + ] + }, + { + "text": "when does the next train departs from quiddestraße?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "quiddestraße" + } + ] + }, + { + "text": "when the next train in garching forschungszentrum is leaving?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "train" + }, + { + "entity": "Criterion", + "start": 2, + "stop": 2, + "text": "next" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "when is the next u6 leaving from garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Line", + "start": 4, + "stop": 4, + "text": "u6" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "when does the next train leave from garching forschungszentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "when is the next u6?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Line", + "start": 4, + "stop": 4, + "text": "u6" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + } + ] + }, + { + "text": "when is the next subway leaving from garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "subway" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "when the next train in garching is leaving?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "train" + }, + { + "entity": "Criterion", + "start": 2, + "stop": 2, + "text": "next" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + } + ] + }, + { + "text": "when is the next train leaving in garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "when does the next train leaves from odeonsplatz?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "odeonsplatz" + } + ] + }, + { + "text": "when does the next train leaves from quiddestraße?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "quiddestraße" + } + ] + }, + { + "text": "when is the next train", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + } + ] + }, + { + "text": "when does the next bus leaves at garching forschungszentrum?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "when does the next train leaves?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + } + ] + }, + { + "text": "when does the next bus leave in garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "when does the next s-bahn leaves from hauptbahnhof?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 6, + "text": "s-bahn" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 9, + "stop": 9, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "when does the next subway departes from odeonsplatz?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "subway" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "odeonsplatz" + } + ] + }, + { + "text": "show me the next bus from garching!", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "when does the next tram starts from hauptbahnhof?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "tram" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "when will the next u-bahn depart from garching forschungszentrum?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 6, + "text": "u-bahn" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 9, + "stop": 10, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "show me the next bus from michaelibad.", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "michaelibad" + } + ] + }, + { + "text": "when does the next train starts at sendlinger tor?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "sendlinger tor" + } + ] + }, + { + "text": "hey bot, when does the next bus starts at garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 7, + "stop": 7, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 6, + "stop": 6, + "text": "next" + }, + { + "entity": "StationStart", + "start": 10, + "stop": 10, + "text": "garching" + } + ] + }, + { + "text": "when does the next bus leaves at garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "when is the bus from quiddestraße?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "bus" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "quiddestraße" + } + ] + }, + { + "text": "when can i get a bus at mariahilfplatz?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 5, + "stop": 5, + "text": "bus" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "mariahilfplatz" + } + ] + }, + { + "text": "when does the next bus leaves at romanplatz?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "romanplatz" + } + ] + }, + { + "text": "when does the bus to röblingweg starts?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "bus" + }, + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "röblingweg" + } + ] + }, + { + "text": "next bus from quiddestraße?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 1, + "stop": 1, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 0, + "stop": 0, + "text": "next" + }, + { + "entity": "StationStart", + "start": 3, + "stop": 3, + "text": "quiddestraße" + } + ] + }, + { + "text": "when is the next bus leaving from garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "when is the train leaving in garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "train" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "when is the train leaving in garching?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 3, + "stop": 3, + "text": "train" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "how can i get from garching to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "odeonsplatz" + } + ] + }, + { + "text": "when is adrians next subway leaving at garching forschungszentrum?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "subway" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "how can i get from olympiazentrum to hauptbahnhof?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "olympiazentrum" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "how can i get from quiddestraße to boltzmannstraße?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "quiddestraße" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "boltzmannstraße" + } + ] + }, + { + "text": "how can i get from moosach to garching forschungszentrum?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "moosach" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "can you give me a connection from garching to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 9, + "stop": 9, + "text": "odeonsplatz" + } + ] + }, + { + "text": "when is the next train from garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "when comes the next train", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + } + ] + }, + { + "text": "when is the next train in nordfriedhof", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "nordfriedhof" + } + ] + }, + { + "text": "when does the next train come at garching forschungszentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "when is the next train from nordfriedhof to garching forschungszentrum", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "nordfriedhof" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 9, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "i want to travel from garching to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "odeonsplatz" + } + ] + }, + { + "text": "how can i get to sendlinger tor?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationDest", + "start": 5, + "stop": 6, + "text": "sendlinger tor" + } + ] + }, + { + "text": "how do i get to untere straussäcker?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationDest", + "start": 5, + "stop": 6, + "text": "untere straussäcker" + } + ] + }, + { + "text": "how can i get from garching to garching?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "how can i get from garching to sendlinger tor?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 8, + "text": "sendlinger tor" + } + ] + }, + { + "text": "how can i get from garchingto garching?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garchingto" + }, + { + "entity": "StationDest", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "when is the next train from garching", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "how do i get from marienplatz zu garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "marienplatz" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "garching" + } + ] + }, + { + "text": "how can i get to milbertshofen from garching?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 7, + "stop": 7, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 5, + "stop": 5, + "text": "milbertshofen" + } + ] + }, + { + "text": "when is the next train to garching", + "intent": "FindConnection", + "entities": [ + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "StationDest", + "start": 6, + "stop": 6, + "text": "garching" + } + ] + }, + { + "text": "how can i get from garching to milbertshofen?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "milbertshofen" + } + ] + }, + { + "text": "when does the next rocket leaves from garching forschungszentrum?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "rocket" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 8, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "connection from untere straßäcker 21 to kieferngarten", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 2, + "stop": 4, + "text": "untere straßäcker 21" + }, + { + "entity": "StationDest", + "start": 6, + "stop": 6, + "text": "kieferngarten" + } + ] + }, + { + "text": "how to get from untere strassäcker 21 to frötmaning", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 6, + "text": "untere strassäcker 21" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "frötmaning" + } + ] + }, + { + "text": "how to get from untere strassaecker 21 to frötmaning", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 6, + "text": "untere strassaecker 21" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "frötmaning" + } + ] + }, + { + "text": "when is the next train from untere straßaecker 21 to kieferngarten", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 8, + "text": "untere straßaecker 21" + }, + { + "entity": "StationDest", + "start": 10, + "stop": 10, + "text": "kieferngarten" + } + ] + }, + { + "text": "when is the next train from untere straßaecker 21, garching to kieferngarten", + "intent": "FindConnection", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 7, + "stop": 10, + "text": "straßaecker 21, garching" + }, + { + "entity": "StationDest", + "start": 12, + "stop": 12, + "text": "kieferngarten" + } + ] + }, + { + "text": "from garching to perlach", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "perlach" + } + ] + }, + { + "text": "how to get from garching to perlach?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 4, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 6, + "stop": 6, + "text": "perlach" + } + ] + }, + { + "text": "how to get from bonnerplatz to freimann", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 4, + "stop": 4, + "text": "bonnerplatz" + }, + { + "entity": "StationDest", + "start": 6, + "stop": 6, + "text": "freimann" + } + ] + }, + { + "text": "when is the next train in nordfriedhof?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 6, + "text": "nordfriedhof" + } + ] + }, + { + "text": "when is the next train in münchner freiheit?", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "train" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "münchner freiheit" + } + ] + }, + { + "text": "connection from hauptbahnhof to odeonsplatz?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 2, + "stop": 2, + "text": "hauptbahnhof" + }, + { + "entity": "StationDest", + "start": 4, + "stop": 4, + "text": "odeonsplatz" + } + ] + }, + { + "text": "how do i get from olympia einkaufszentrum to hauptbahnhof?", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 6, + "text": "olympia einkaufszentrum" + }, + { + "entity": "StationDest", + "start": 8, + "stop": 8, + "text": "hauptbahnhof" + } + ] + }, + { + "text": "when is the next bus in garching forschungszentrum", + "intent": "DepartureTime", + "entities": [ + { + "entity": "Vehicle", + "start": 4, + "stop": 4, + "text": "bus" + }, + { + "entity": "Criterion", + "start": 3, + "stop": 3, + "text": "next" + }, + { + "entity": "StationStart", + "start": 6, + "stop": 7, + "text": "garching forschungszentrum" + } + ] + }, + { + "text": "how can i get from garching to marienplatz", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 5, + "stop": 5, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 7, + "stop": 7, + "text": "marienplatz" + } + ] + }, + { + "text": "from garching to studentenstadt", + "intent": "FindConnection", + "entities": [ + { + "entity": "StationStart", + "start": 1, + "stop": 1, + "text": "garching" + }, + { + "entity": "StationDest", + "start": 3, + "stop": 3, + "text": "studentenstadt" + } + ] + } + ] +} diff --git a/BotSharp.WebHost/App_Data/DbInitializer/Agents/agents.json b/BotSharp.WebHost/App_Data/DbInitializer/Agents/agents.json index 2f4556652..34f854ad7 100644 --- a/BotSharp.WebHost/App_Data/DbInitializer/Agents/agents.json +++ b/BotSharp.WebHost/App_Data/DbInitializer/Agents/agents.json @@ -13,5 +13,13 @@ "AccessToken": "EAAJym8gGQFMBAPnsxTw6rZBE2WVfYtCJeGkCQ2NZC3VbQd45SyUlXjjgUf1gAkCOWq7v0blxTb1xLZAeMAXYhQj3btcMlMO9YbG7StMyx8ussz5TnD1tjjIZCye5u66PZAuFxSyIPXtTCin8GPiJ19cYB8ZCyH3rr5sro7OxUSyAZDZD" } ] + }, + { + "Id": "bff7605c-3db5-44dc-9ba7-1c9be2832318", + "Name": "Airport", + "UserId": "8da9e1e0-42dc-420a-8016-79b04c1297d0", + "ClientAccessToken": "6ba8a06865944f14981ce18d229283f5", + "DeveloperAccessToken": "f12fbdb0da5a4616b18fa7582d32f6e3", + "Integrations": [] } ] \ No newline at end of file diff --git a/BotSharp.WebHost/InitializationLoader.cs b/BotSharp.WebHost/InitializationLoader.cs new file mode 100644 index 000000000..f6e475d19 --- /dev/null +++ b/BotSharp.WebHost/InitializationLoader.cs @@ -0,0 +1,26 @@ +using BotSharp.Core.Abstractions; +using DotNetToolkit; +using EntityFrameworkCore.BootKit; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace BotSharp.WebHost +{ + public class InitializationLoader + { + public IHostingEnvironment Env { get; set; } + public IConfiguration Config { get; set; } + public void Load() + { + var assemblies = (string[])AppDomain.CurrentDomain.GetData("Assemblies"); + var appsLoaders1 = TypeHelper.GetInstanceWithInterface(assemblies); + appsLoaders1.ForEach(loader => { + loader.Initialize(Config, Env); + }); + } + } +} diff --git a/BotSharp.WebHost/Settings/auth.json b/BotSharp.WebHost/Settings/auth.json new file mode 100644 index 000000000..a73f7f4a7 --- /dev/null +++ b/BotSharp.WebHost/Settings/auth.json @@ -0,0 +1,9 @@ +{ + "TokenAuthentication": { + "SecretKey": "lfo54FYneUCJNL2EjP9ZxQ==", + "Issuer": "BotSharp", + "Audience": "BotSharp", + "CookieName": "token", + "Subject": "BotSharp" + } +} diff --git a/BotSharp.WebHost/Startup.cs b/BotSharp.WebHost/Startup.cs index 7bc3c5c6d..214c9f9e1 100644 --- a/BotSharp.WebHost/Startup.cs +++ b/BotSharp.WebHost/Startup.cs @@ -14,6 +14,8 @@ using Newtonsoft.Json.Serialization; using Swashbuckle.AspNetCore.Swagger; using BotSharp.Core.Engines.BotSharp; +using System.Collections.Generic; +using Newtonsoft.Json; namespace BotSharp.WebHost { @@ -51,8 +53,10 @@ public void ConfigureServices(IServiceCollection services) // register platform dependency services.AddTransient((provider) => { - var implements = TypeHelper.GetClassesWithInterface(Database.Assemblies); - string platform = Database.Configuration.GetValue("BotPlatform"); + var assemblies = (String[])AppDomain.CurrentDomain.GetData("Assemblies"); + var config = (IConfiguration)AppDomain.CurrentDomain.GetData("Configuration"); + var implements = TypeHelper.GetClassesWithInterface(assemblies); + string platform = config.GetValue("BotPlatform"); var implement = implements.FirstOrDefault(x => x.Name.Split('.').Last() == platform); var instance = (IBotPlatform)Activator.CreateInstance(implement); @@ -101,15 +105,20 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) app.UseMvc(); - Database.Configuration = Configuration; - Database.ContentRootPath = env.ContentRootPath; - Database.Assemblies = Configuration.GetValue("Assemblies").Split(','); - - Runcmd(); - + AppDomain.CurrentDomain.SetData("DataPath", Path.Join(env.ContentRootPath, "App_Data")); + AppDomain.CurrentDomain.SetData("Configuration", Configuration); + AppDomain.CurrentDomain.SetData("ContentRootPath", env.ContentRootPath); + AppDomain.CurrentDomain.SetData("Assemblies", Configuration.GetValue("Assemblies").Split(',')); + + InitializationLoader loader = new InitializationLoader(); + loader.Env = env; + loader.Config = Configuration; + loader.Load(); + + /*Runcmd(); var ai = new BotSharpAi(); ai.LoadAgent("6a9fd374-c43d-447a-97f2-f37540d0c725"); - ai.Train(); + ai.Train();*/ } public void Runcmd () @@ -152,4 +161,4 @@ public void Runcmd () Console.WriteLine(output); } } -} +} \ No newline at end of file diff --git a/BotSharp.sln b/BotSharp.sln index c4a7b6649..c3bb81a6a 100644 --- a/BotSharp.sln +++ b/BotSharp.sln @@ -11,7 +11,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.RestApi", "BotShar EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.WebHost", "BotSharp.WebHost\BotSharp.WebHost.csproj", "{03DCA427-327A-4FC9-9A2F-57D17F16708C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.MachineLearning", "BotSharp.MachineLearning\BotSharp.MachineLearning.csproj", "{E664115A-AE86-49E9-8AE4-D4589A568CD7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSharp.MachineLearning", "BotSharp.MachineLearning\BotSharp.MachineLearning.csproj", "{E664115A-AE86-49E9-8AE4-D4589A568CD7}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution