你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Apps - Import

将应用程序导入 LUIS,应用程序的结构包含在请求正文中。

POST {Endpoint}/luis/api/v2.0/apps/import
POST {Endpoint}/luis/api/v2.0/apps/import?appName={appName}

URI 参数

名称 必需 类型 说明
Endpoint
path True

string

支持的认知服务终结点 (协议和主机名,例如: https://westus.api.cognitive.microsoft.com) 。

appName
query

string

要创建的应用程序名称。 如果未指定,将从导入的对象读取应用程序名称。 如果应用程序名称已存在,则返回错误。

请求头

名称 必需 类型 说明
Ocp-Apim-Subscription-Key True

string

请求正文

名称 类型 说明
closedLists

ClosedList[]

列表实体的列表。

composites

HierarchicalModel[]

复合实体的列表。

culture

string

应用程序的区域性。 例如:en-us。

desc

string

应用程序的说明。

entities

HierarchicalModel[]

实体列表。

intents

HierarchicalModel[]

意向列表。

model_features

JSONModelFeature[]

模型特征列表。

name

string

应用程序的名称。

patternAnyEntities

PatternAny[]

Pattern.Any 实体的列表。

patterns

PatternRule[]

模式列表。

prebuiltEntities

PrebuiltEntity[]

预生成实体的列表。

regex_entities

RegexEntity[]

正则表达式实体的列表。

regex_features

JSONRegexFeature[]

模式特征列表。

utterances

JSONUtterance[]

示例话语列表。

versionId

string

导出的应用程序的版本 ID。

响应

名称 类型 说明
201 Created

string

导入的应用程序的 ID。

Other Status Codes

ErrorResponse

错误响应。

安全性

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

示例

Successful Import Application

Sample Request

POST {Endpoint}/luis/api/v2.0/apps/import?appName=Test LUIS App


{
  "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": []
    }
  ]
}

Sample Response

Location: https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/374fac89-ae12-4afd-8c21-8a6424ce1c1f
"374fac89-ae12-4afd-8c21-8a6424ce1c1f"

定义

名称 说明
ClosedList

导出的模型 - 列表实体。

ErrorResponse

对 API 调用操作时出现错误响应。

HierarchicalModel
JSONEntity

导出的模型 - 从话语中提取的实体。

JSONModelFeature

导出的模型 - 短语列表模型功能。

JSONRegexFeature

导出的模型 - 模式功能。

JSONUtterance

导出的模型 - 用于训练模型的话语。

LuisApp

导出的模型 - 导出的 LUIS 应用程序。

PatternAny

Pattern.Any 实体提取程序。

PatternRule

模式

PrebuiltDomainObject
PrebuiltEntity

预生成的实体提取程序。

RegexEntity

正则表达式实体提取程序。

SubClosedList

列表实体的项的子列表。

ClosedList

导出的模型 - 列表实体。

名称 类型 说明
name

string

列表实体的名称。

roles

string[]

subLists

SubClosedList[]

列表实体的子列表。

ErrorResponse

对 API 调用操作时出现错误响应。

名称 类型 说明
errorType

string

HierarchicalModel

名称 类型 说明
children

string[]

inherits

PrebuiltDomainObject

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

表示 Phraselist 的逗号分隔短语的列表。

JSONRegexFeature

导出的模型 - 模式功能。

名称 类型 说明
activated

boolean

指示是否启用了模式功能。

name

string

功能的名称。

pattern

string

要匹配的正则表达式。

JSONUtterance

导出的模型 - 用于训练模型的话语。

名称 类型 说明
entities

JSONEntity[]

匹配的实体。

intent

string

匹配的意向。

text

string

话语。

LuisApp

导出的模型 - 导出的 LUIS 应用程序。

名称 类型 说明
closedLists

ClosedList[]

列表实体的列表。

composites

HierarchicalModel[]

复合实体的列表。

culture

string

应用程序的区域性。 例如:en-us。

desc

string

应用程序的说明。

entities

HierarchicalModel[]

实体列表。

intents

HierarchicalModel[]

意向列表。

model_features

JSONModelFeature[]

模型特征列表。

name

string

应用程序的名称。

patternAnyEntities

PatternAny[]

Pattern.Any 实体的列表。

patterns

PatternRule[]

模式列表。

prebuiltEntities

PrebuiltEntity[]

预生成实体的列表。

regex_entities

RegexEntity[]

正则表达式实体的列表。

regex_features

JSONRegexFeature[]

模式特征列表。

utterances

JSONUtterance[]

示例话语列表。

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[]

同义词列表。