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

Apps - Import

Imports an application to LUIS, the application's structure is included in the request body.

POST {Endpoint}/luis/authoring/v3.0-preview/apps/import
POST {Endpoint}/luis/authoring/v3.0-preview/apps/import?appName={appName}

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).

appName
query

string

The application name to create. If not specified, the application name will be read from the imported object. If the application name already exists, an error is returned.

Request Header

Name Required Type Description
Ocp-Apim-Subscription-Key True

string

Request Body

Name Type Description
closedLists

ClosedList[]

List of list entities.

composites

HierarchicalModel[]

List of composite entities.

culture

string

The culture of the application. E.g.: en-us.

desc

string

The description of the application.

entities

HierarchicalModel[]

List of entities.

hierarchicals

HierarchicalModel[]

List of hierarchical entities.

intents

HierarchicalModel[]

List of intents.

name

string

The name of the application.

patternAnyEntities

PatternAny[]

List of Pattern.Any entities.

patterns

PatternRule[]

List of patterns.

phraselists

JSONModelFeature[]

List of model features.

prebuiltEntities

PrebuiltEntity[]

List of prebuilt entities.

regex_entities

RegexEntity[]

List of regular expression entities.

regex_features

JSONRegexFeature[]

List of pattern features.

utterances

JSONUtterance[]

List of example utterances.

versionId

string

The version ID of the application that was exported.

Responses

Name Type Description
201 Created

string

The ID of the imported application.

Other Status Codes

ErrorResponse

Error Response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Successful Import Application

Sample request

POST {Endpoint}/luis/authoring/v3.0-preview/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"

Definitions

Name Description
ClosedList

Exported Model - A list entity.

ErrorResponse

Error response when invoking an operation on the API.

HierarchicalModel
JsonChild
JSONEntity

Exported Model - Extracted Entity from utterance.

JSONModelFeature

Exported Model - Phraselist Model Feature.

JsonModelFeatureInformation

An object containing the model feature information either the model name or feature name.

JSONRegexFeature

Exported Model - A Pattern feature.

JSONUtterance

Exported Model - Utterance that was used to train the model.

LuisApp

Exported Model - An exported LUIS Application.

PatternAny

Pattern.Any Entity Extractor.

PatternRule

Pattern

PrebuiltDomainObject
PrebuiltEntity

Prebuilt Entity Extractor.

RegexEntity

Regular Expression Entity Extractor.

SubClosedList

Sublist of items for a list entity.

ClosedList

Exported Model - A list entity.

Name Type Description
name

string

Name of the list entity.

roles

string[]

subLists

SubClosedList[]

Sublists for the list entity.

ErrorResponse

Error response when invoking an operation on the API.

Name Type Description
errorType

string

HierarchicalModel

Name Type Description
children

JsonChild[]

features

JsonModelFeatureInformation[]

An object containing the model feature information either the model name or feature name.

inherits

PrebuiltDomainObject

name

string

roles

string[]

JsonChild

Name Type Description
children

JsonChild[]

features

JsonModelFeatureInformation[]

An object containing the model feature information either the model name or feature name.

instanceOf

string

name

string

JSONEntity

Exported Model - Extracted Entity from utterance.

Name Type Description
children

JSONEntity[]

Exported Model - Extracted Entity from utterance.

endPos

integer

The index within the utterance where the extracted entity ends.

entity

string

The entity name.

role

string

The role the entity plays in the utterance.

startPos

integer

The index within the utterance where the extracted entity starts.

JSONModelFeature

Exported Model - Phraselist Model Feature.

Name Type Default value Description
activated

boolean

Indicates if the feature is enabled.

enabledForAllModels

boolean

True

Indicates if the Phraselist is enabled for all models in the application.

mode

boolean

An interchangeable phrase list feature serves as a list of synonyms for training. A non-exchangeable phrase list serves as separate features for training. So, if your non-interchangeable phrase list contains 5 phrases, they will be mapped to 5 separate features. You can think of the non-interchangeable phrase list as an additional bag of words to add to LUIS existing vocabulary features. It is used as a lexicon lookup feature where its value is 1 if the lexicon contains a given word or 0 if it doesn’t. Default value is true.

name

string

The Phraselist name.

words

string

List of comma-separated phrases that represent the Phraselist.

JsonModelFeatureInformation

An object containing the model feature information either the model name or feature name.

Name Type Description
featureName

string

The name of the feature used.

modelName

string

The name of the model used.

JSONRegexFeature

Exported Model - A Pattern feature.

Name Type Description
activated

boolean

Indicates if the Pattern feature is enabled.

name

string

Name of the feature.

pattern

string

The Regular Expression to match.

JSONUtterance

Exported Model - Utterance that was used to train the model.

Name Type Description
entities

JSONEntity[]

The matched entities.

intent

string

The matched intent.

text

string

The utterance.

LuisApp

Exported Model - An exported LUIS Application.

Name Type Description
closedLists

ClosedList[]

List of list entities.

composites

HierarchicalModel[]

List of composite entities.

culture

string

The culture of the application. E.g.: en-us.

desc

string

The description of the application.

entities

HierarchicalModel[]

List of entities.

hierarchicals

HierarchicalModel[]

List of hierarchical entities.

intents

HierarchicalModel[]

List of intents.

name

string

The name of the application.

patternAnyEntities

PatternAny[]

List of Pattern.Any entities.

patterns

PatternRule[]

List of patterns.

phraselists

JSONModelFeature[]

List of model features.

prebuiltEntities

PrebuiltEntity[]

List of prebuilt entities.

regex_entities

RegexEntity[]

List of regular expression entities.

regex_features

JSONRegexFeature[]

List of pattern features.

utterances

JSONUtterance[]

List of example utterances.

versionId

string

The version ID of the application that was exported.

PatternAny

Pattern.Any Entity Extractor.

Name Type Description
explicitList

string[]

name

string

roles

string[]

PatternRule

Pattern

Name Type Description
intent

string

The intent's name where the pattern belongs to.

pattern

string

The pattern text.

PrebuiltDomainObject

Name Type Description
domain_name

string

model_name

string

PrebuiltEntity

Prebuilt Entity Extractor.

Name Type Description
name

string

roles

string[]

RegexEntity

Regular Expression Entity Extractor.

Name Type Description
name

string

regexPattern

string

roles

string[]

SubClosedList

Sublist of items for a list entity.

Name Type Description
canonicalForm

string

The standard form that the list represents.

list

string[]

List of synonym words.