Versions - Import
将新版本导入 LUIS 应用程序。
POST {Endpoint}/luis/api/v2.0/apps/{appId}/versions/import
POST {Endpoint}/luis/api/v2.0/apps/{appId}/versions/import?versionId={versionId}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
app
|
path | True |
string (uuid) |
应用程序 ID。 |
|
Endpoint
|
path | True |
string |
支持的认知服务终结点(协议和主机名,例如:https://westus.api.cognitive.microsoft.com)。 |
|
version
|
query |
string |
要导入的新 versionId。 如果未指定,则从导入的对象读取 versionId。 |
请求头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| Ocp-Apim-Subscription-Key | True |
string |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| closedLists |
列表实体的列表。 |
|
| composites |
复合实体的列表。 |
|
| culture |
string |
应用程序的区域性。 例如:en-us。 |
| desc |
string |
应用程序的说明。 |
| entities |
实体列表。 |
|
| intents |
意向列表。 |
|
| model_features |
模型功能列表。 |
|
| name |
string |
应用程序的名称。 |
| patternAnyEntities |
Pattern.Any 实体的列表。 |
|
| patterns |
模式列表。 |
|
| prebuiltEntities |
预生成实体的列表。 |
|
| regex_entities |
正则表达式实体的列表。 |
|
| regex_features |
模式功能列表。 |
|
| utterances |
示例话语列表。 |
|
| versionId |
string |
导出的应用程序的版本 ID。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 201 Created |
string |
创建的应用程序版本。 |
| Other Status Codes |
错误响应。 |
安全性
Ocp-Apim-Subscription-Key
类型:
apiKey
在:
header
示例
Successful Import Application
示例请求
POST {Endpoint}/luis/api/v2.0/apps/bd72e8d7-62b8-48f5-9dcb-e3b0588b803a/versions/import?versionId=0.2
{
"luis_schema_version": "3.0.0",
"versionId": "0.1",
"name": "LuisBot",
"desc": "",
"culture": "en-us",
"intents": [
{
"name": "HomeAutomation.TurnOff",
"inherits": {
"domain_name": "HomeAutomation",
"model_name": "TurnOff"
}
},
{
"name": "dateintent"
},
{
"name": "Help"
},
{
"name": "None"
},
{
"name": "SearchHotels"
},
{
"name": "ShowHotelsReviews"
}
],
"entities": [
{
"name": "AirportCode",
"roles": [
"destination"
]
},
{
"name": "Hotel",
"roles": []
}
],
"composites": [],
"closedLists": [],
"patternAnyEntities": [
{
"name": "patternAny1",
"explicitList": [],
"roles": [
"role1",
"role2"
]
}
],
"regex_entities": [
{
"name": "regex1",
"regexPattern": "[^a]+",
"roles": [
"regex role"
]
}
],
"prebuiltEntities": [
{
"name": "datetimeV2",
"roles": [
"datetime role"
]
}
],
"model_features": [
{
"name": "Near",
"mode": true,
"words": "near,around,close,nearby",
"activated": true
},
{
"name": "Show",
"mode": true,
"words": "show,find,look,search",
"activated": true
}
],
"regex_features": [
{
"name": "AirportCodeRegex",
"pattern": "[a-z]{3}",
"activated": true
}
],
"patterns": [
{
"pattern": "this is [a test] {patternAny1:role1}",
"intent": "Help"
}
],
"utterances": [
{
"text": "i need help",
"intent": "Help",
"entities": []
},
{
"text": "help me",
"intent": "Help",
"entities": []
},
{
"text": "tomorrow",
"intent": "dateintent",
"entities": []
},
{
"text": "search for hotels in seattle",
"intent": "SearchHotels",
"entities": []
},
{
"text": "what can i do?",
"intent": "Help",
"entities": []
},
{
"text": "next monday",
"intent": "dateintent",
"entities": []
},
{
"text": "next year",
"intent": "dateintent",
"entities": []
},
{
"text": "look for hotels in miami",
"intent": "SearchHotels",
"entities": []
},
{
"text": "show me hotels in california",
"intent": "SearchHotels",
"entities": []
},
{
"text": "show me the reviews of the amazing bot resort",
"intent": "ShowHotelsReviews",
"entities": [
{
"entity": "Hotel",
"startPos": 23,
"endPos": 44
}
]
},
{
"text": "can i see the reviews of extended bot hotel?",
"intent": "ShowHotelsReviews",
"entities": [
{
"entity": "Hotel",
"startPos": 25,
"endPos": 42
}
]
},
{
"text": "find reviews of hotelxya",
"intent": "ShowHotelsReviews",
"entities": [
{
"entity": "Hotel",
"startPos": 16,
"endPos": 23
}
]
},
{
"text": "show me reviews of the amazing hotel",
"intent": "ShowHotelsReviews",
"entities": [
{
"entity": "Hotel",
"startPos": 19,
"endPos": 35
}
]
},
{
"text": "what are the available options?",
"intent": "Help",
"entities": []
},
{
"text": "best hotels in seattle",
"intent": "SearchHotels",
"entities": []
},
{
"text": "hotels in los angeles",
"intent": "SearchHotels",
"entities": []
},
{
"text": "can you show me hotels from los angeles?",
"intent": "SearchHotels",
"entities": []
},
{
"text": "can you show me the reviews of the amazing resort & hotel",
"intent": "ShowHotelsReviews",
"entities": [
{
"entity": "Hotel",
"startPos": 31,
"endPos": 56
}
]
},
{
"text": "what are the reviews of the hotel bot framework?",
"intent": "ShowHotelsReviews",
"entities": [
{
"entity": "Hotel",
"startPos": 24,
"endPos": 46
}
]
},
{
"text": "find hotels near eze",
"intent": "SearchHotels",
"entities": [
{
"entity": "AirportCode",
"startPos": 17,
"endPos": 19
}
]
},
{
"text": "where can i stay near nnn?",
"intent": "SearchHotels",
"entities": [
{
"entity": "AirportCode",
"startPos": 22,
"endPos": 24
}
]
},
{
"text": "show hotels near att airport",
"intent": "SearchHotels",
"entities": [
{
"entity": "AirportCode",
"startPos": 17,
"endPos": 19
}
]
},
{
"text": "find hotels near agl",
"intent": "SearchHotels",
"entities": [
{
"entity": "AirportCode",
"startPos": 17,
"endPos": 19
}
]
},
{
"text": "find hotels around eze airport",
"intent": "SearchHotels",
"entities": [
{
"entity": "AirportCode",
"startPos": 19,
"endPos": 21
}
]
},
{
"text": "01/7",
"intent": "dateintent",
"entities": []
}
]
}
示例响应
Location: https://westus.api.cognitive.microsoft.com/luis/api/v2.0/bd72e8d7-62b8-48f5-9dcb-e3b0588b803a/versions/0.2
"0.2"
定义
| 名称 | 说明 |
|---|---|
|
Closed |
导出的模型 - 列表实体。 |
|
Error |
调用 API 上的作时出现错误响应。 |
|
Hierarchical |
|
| JSONEntity |
导出的模型 - 从话语中提取的实体。 |
|
JSONModel |
导出的模型 - 短语列表模型功能。 |
|
JSONRegex |
导出的模型 - 模式功能。 |
| JSONUtterance |
导出的模型 - 用于训练模型的言语。 |
|
Luis |
导出的模型 - 导出的 LUIS 应用程序。 |
|
Pattern |
Pattern.Any 实体提取程序。 |
|
Pattern |
模式 |
|
Prebuilt |
|
|
Prebuilt |
预生成的实体提取器。 |
|
Regex |
正则表达式实体提取器。 |
|
Sub |
列表实体的项的子列表。 |
ClosedList
导出的模型 - 列表实体。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
列表实体的名称。 |
| roles |
string[] |
|
| subLists |
列表实体的子列表。 |
ErrorResponse
调用 API 上的作时出现错误响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| errorType |
string |
HierarchicalModel
| 名称 | 类型 | 说明 |
|---|---|---|
| children |
string[] |
|
| inherits | ||
| name |
string |
|
| roles |
string[] |
JSONEntity
导出的模型 - 从话语中提取的实体。
| 名称 | 类型 | 说明 |
|---|---|---|
| endPos |
integer |
提取的实体结束的话语中的索引。 |
| entity |
string |
实体名称。 |
| role |
string |
陈述中实体的角色。 |
| startPos |
integer |
提取的实体启动的话语中的索引。 |
JSONModelFeature
导出的模型 - 短语列表模型功能。
| 名称 | 类型 | 说明 |
|---|---|---|
| activated |
boolean |
指示是否启用该功能。 |
| mode |
boolean |
可互换短语列表功能用作训练的同义词列表。 不可交换的短语列表用作训练的单独功能。 因此,如果不可互换的短语列表包含 5 个短语,它们将映射到 5 个单独的功能。 可以将不可互换的短语列表视为添加到 LUIS 现有词汇功能的附加字词包。 它用作词法查找功能,如果词典包含给定单词,则其值为 1;如果没有,则将其用作 0。 默认值为 true。 |
| name |
string |
短语列表名称。 |
| words |
string |
表示短语列表的逗号分隔短语列表。 |
JSONRegexFeature
导出的模型 - 模式功能。
| 名称 | 类型 | 说明 |
|---|---|---|
| activated |
boolean |
指示是否启用了模式功能。 |
| name |
string |
功能的名称。 |
| pattern |
string |
要匹配的正则表达式。 |
JSONUtterance
导出的模型 - 用于训练模型的言语。
| 名称 | 类型 | 说明 |
|---|---|---|
| entities |
匹配的实体。 |
|
| intent |
string |
匹配的意向。 |
| text |
string |
陈述。 |
LuisApp
导出的模型 - 导出的 LUIS 应用程序。
| 名称 | 类型 | 说明 |
|---|---|---|
| closedLists |
列表实体的列表。 |
|
| composites |
复合实体的列表。 |
|
| culture |
string |
应用程序的区域性。 例如:en-us。 |
| desc |
string |
应用程序的说明。 |
| entities |
实体列表。 |
|
| intents |
意向列表。 |
|
| model_features |
模型功能列表。 |
|
| name |
string |
应用程序的名称。 |
| patternAnyEntities |
Pattern.Any 实体的列表。 |
|
| patterns |
模式列表。 |
|
| prebuiltEntities |
预生成实体的列表。 |
|
| regex_entities |
正则表达式实体的列表。 |
|
| regex_features |
模式功能列表。 |
|
| utterances |
示例话语列表。 |
|
| versionId |
string |
导出的应用程序的版本 ID。 |
PatternAny
Pattern.Any 实体提取程序。
| 名称 | 类型 | 说明 |
|---|---|---|
| explicitList |
string[] |
|
| name |
string |
|
| roles |
string[] |
PatternRule
模式
| 名称 | 类型 | 说明 |
|---|---|---|
| intent |
string |
模式所属的意向名称。 |
| pattern |
string |
模式文本。 |
PrebuiltDomainObject
| 名称 | 类型 | 说明 |
|---|---|---|
| domain_name |
string |
|
| model_name |
string |
PrebuiltEntity
预生成的实体提取器。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
|
| roles |
string[] |
RegexEntity
正则表达式实体提取器。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
|
| regexPattern |
string |
|
| roles |
string[] |
SubClosedList
列表实体的项的子列表。
| 名称 | 类型 | 说明 |
|---|---|---|
| canonicalForm |
string |
列表表示的标准窗体。 |
| list |
string[] |
同义词列表。 |