通过导入json来更新现有luis应用程序,而不会丢失经过训练的数据或现有数据 [英] Provision to update a existing luis application by importing json with out loosing the trained or existing data

查看:86
本文介绍了通过导入json来更新现有luis应用程序,而不会丢失经过训练的数据或现有数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在寻求通过导入json而不用在luis应用程序中丢失经过训练的数据来更新luis的方法,因为我们是直接从我们的项目需求模板中创建一个luis json文件,如果我们的脚本会生成项目需求模板中的任何更改 一个新的json文件,而不是从luis中删除该应用程序并导入新的json文件,我们正在寻找替代方案.

we are looking for updating the luis by importing json with out loosing trained data in luis application, as we are directly creating a luis json file from our project requirement template, if any changes in project requirement template our script will generate a new json file , instead of deleting the app from luis and importing the new json file we are looking for alternative.

感谢您的帮助.

谢谢

ajay

推荐答案

嗨Ajay,

无法在luis门户中导入与先前应用程序同名的应用程序.

It is not possible to import the application with the same name in the luis portal as the previous application.

您可以尝试关注.

1)从门户中的设置刀片导出应用程序的当前版本.请参考下面的示例.

1) Export the current version of the application from the setting blade in the portal. Refer a sample below.

执行此操作后,您将拥有json格式的所有先前数据.请参阅下面的示例

Once you do this, you will have all the previous data in the json format. Refer sample below

{
  "luis_schema_version": "3.0.0",
  "versionId": "0.2",
  "name": "GitLuisBot-8619",
  "desc": "Default Intents for Azure Bot Service V2",
  "culture": "en-us",
  "intents": [
    {
      "name": "Cancel"
    },
    {
      "name": "Greeting"
    },
    {
      "name": "Help"
    },
    {
      "name": "None"
    }
  ],
  "entities": [],
  "composites": [],
  "closedLists": [],
  "patternAnyEntities": [],
  "regex_entities": [],
  "prebuiltEntities": [],
  "model_features": [],
  "regex_features": [],
  "patterns": [],
  "utterances": [
    {
      "text": "abort",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "cancel",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "disregard",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "do not do it",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "do not do that",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "don't",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "don't do it",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "don't do that",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "good afternoon",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "good evening",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "good morning",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "good night",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "hello",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "hello bot",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "help",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "help me",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "help me please",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "help please",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "hi",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "hi bot",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "hiya",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "how are you",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "how are you doing today?",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "how are you doing?",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "how are you today?",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "i am stuck",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "i would like to cancel",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "i'm stuck",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "my water bottle is green.",
      "intent": "None",
      "entities": []
    },
    {
      "text": "never mind",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "please cancel",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "please disregard",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "please help me",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "please stop",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "stop",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "there is a large deep dish pizza in your future.",
      "intent": "None",
      "entities": []
    },
    {
      "text": "what can i say",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "what can you do",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "what can you help me with",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "what do i do now?",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "what do i do?",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "why doesn't this work ?",
      "intent": "Help",
      "entities": []
    }
  ]
}

2)将新的Intent添加到此应用定义中.请参阅以下应用程序定义,其中我已添加带有样本话语的样本意图"

2) Add the new Intents to this app definition. See following app def where I have added Sample Intent with a sample utterence

{
  "luis_schema_version": "3.0.0",
  "versionId": "0.2",
  "name": "GitLuisBot-8619",
  "desc": "Default Intents for Azure Bot Service V2",
  "culture": "en-us",
  "intents": [
    {
      "name": "Cancel"
    },
    {
      "name": "Greeting"
    },
    {
      "name": "Help"
    },
	{
		"name": "SampleIntent"
	},
    {
      "name": "None"
    }
  ],
  "entities": [],
  "composites": [],
  "closedLists": [],
  "patternAnyEntities": [],
  "regex_entities": [],
  "prebuiltEntities": [],
  "model_features": [],
  "regex_features": [],
  "patterns": [],
  "utterances": [
    {
      "text": "abort",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "cancel",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "disregard",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "do not do it",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "do not do that",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "don't",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "don't do it",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "don't do that",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "good afternoon",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "good evening",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "good morning",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "good night",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "hello",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "hello bot",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "help",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "help me",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "help me please",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "help please",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "hi",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "hi bot",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "hiya",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "how are you",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "how are you doing today?",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "how are you doing?",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "how are you today?",
      "intent": "Greeting",
      "entities": []
    },
    {
      "text": "i am stuck",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "i would like to cancel",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "i'm stuck",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "my water bottle is green.",
      "intent": "None",
      "entities": []
    },
    {
      "text": "never mind",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "please cancel",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "please disregard",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "please help me",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "please stop",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "stop",
      "intent": "Cancel",
      "entities": []
    },
    {
      "text": "there is a large deep dish pizza in your future.",
      "intent": "None",
      "entities": []
    },
    {
      "text": "what can i say",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "what can you do",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "what can you help me with",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "what do i do now?",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "what do i do?",
      "intent": "Help",
      "entities": []
    },
    {
      "text": "why doesn't this work ?",
      "intent": "Help",
      "entities": []
    },
	{
		"text": "This is a sample Intent?",
		"intent": "SampleIntent",
		"entities": []
	
	}
  ]
}

3)现在将文件上传到您的APP,并使用新版本,例如v0.2.请参见下面的示例.

3) Now upload the file to your APP with a new version say v0.2 Refer sample below.

现在训练并发布该应用.

Now train and publish the app.

执行此操作后,您将能够将版本0.2设置为主版本.这样,您将能够拥有所有以前的数据,并可以添加任何想要的新意图和话语.

Once you do that, You will be able to set the version 0.2 as the primary version. In this way you will be able to have all the previous data that you have and you can add any new intents and utterances that you want.

希望这会有所帮助


这篇关于通过导入json来更新现有luis应用程序,而不会丢失经过训练的数据或现有数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆