共用方式為


Examples - Batch

將標示的範例語句批次新增至應用程式的版本。

POST {Endpoint}/luis/api/v2.0/apps/{appId}/versions/{versionId}/examples

URI 參數

名稱 位於 必要 類型 Description
appId
path True

string (uuid)

應用程式識別碼。

Endpoint
path True

string

支援的認知服務端點(通訊協定和主機名,例如:https://westus.api.cognitive.microsoft.com)。

versionId
path True

string

版本標識碼。

要求標頭

名稱 必要 類型 Description
Ocp-Apim-Subscription-Key True

string

要求本文

名稱 類型 Description
exampleLabelObjectArray

ExampleLabelObject[]

範例語句的陣列。

回應

名稱 類型 Description
201 Created

BatchLabelExample[]

字串數位,判斷已成功新增已加上標籤的範例語句。

Other Status Codes

BatchLabelExample[]

表示要求部分成功。 回應包含字串數位,指出每個已新增標籤範例語句的狀態。

Other Status Codes

ErrorResponse

錯誤回應。

安全性

Ocp-Apim-Subscription-Key

類型: apiKey
位於: header

範例

Successful Batch Add Labels request

範例要求

POST {Endpoint}/luis/api/v2.0/apps/2370fb9d-7dbc-4898-a361-a742cf290766/versions/0.1/examples


[
  {
    "text": "whats the weather in seattle?",
    "entityLabels": [
      {
        "entityName": "Place",
        "startCharIndex": 21,
        "endCharIndex": 29
      }
    ],
    "intentName": "WeatherInPlace"
  },
  {
    "text": "whats the weather in buenos aires?",
    "entityLabels": [
      {
        "entityName": "Place",
        "startCharIndex": 21,
        "endCharIndex": 34
      }
    ],
    "intentName": "WeatherInPlace"
  }
]

範例回覆

[
  {
    "value": {
      "UtteranceText": "whats the weather in seattle?",
      "ExampleId": -728104
    },
    "hasError": false
  },
  {
    "value": {
      "UtteranceText": "whats the weather in buenos aires?",
      "ExampleId": -5313943
    },
    "hasError": false
  }
]
[
  {
    "hasError": true,
    "error": {
      "code": "FAILED",
      "message": "whats the weather in seattle?. Error: The intent classifier InvalidIntent does not exist in the selected application"
    }
  },
  {
    "value": {
      "UtteranceText": "whats the weather in buenos aires?",
      "ExampleId": -5313943
    },
    "hasError": false
  }
]

定義

名稱 Description
BatchLabelExample

新增標籤範例語句批次時的回應。

EntityLabelObject

定義範例中擷取實體的實體類型和位置。

ErrorResponse

叫用 API 上的作業時發生錯誤回應。

ExampleLabelObject

加上標籤的範例語句。

LabelExampleResponse

新增加上標籤的範例語句時回應。

OperationStatus

作業狀態的回應。

OperationStatusType

狀態代碼。

BatchLabelExample

新增標籤範例語句批次時的回應。

名稱 類型 Description
error

OperationStatus

作業狀態的回應。

hasError

boolean

value

LabelExampleResponse

新增加上標籤的範例語句時回應。

EntityLabelObject

定義範例中擷取實體的實體類型和位置。

名稱 類型 Description
endCharIndex

integer

擷取實體結束之語句內的索引。

entityName

string

實體類型。

role

string

語句中實體的角色。

startCharIndex

integer

擷取實體啟動之語句內的索引。

ErrorResponse

叫用 API 上的作業時發生錯誤回應。

名稱 類型 Description
errorType

string

ExampleLabelObject

加上標籤的範例語句。

名稱 類型 Description
entityLabels

EntityLabelObject[]

範例語句內的已識別實體。

intentName

string

表示範例語句的已識別意圖。

text

string

範例語句。

LabelExampleResponse

新增加上標籤的範例語句時回應。

名稱 類型 Description
ExampleId

integer (int64)

新建立的範例標識碼。

UtteranceText

string

範例語句。

OperationStatus

作業狀態的回應。

名稱 類型 Description
code

OperationStatusType

狀態代碼。

message

string

狀態詳細數據。

OperationStatusType

狀態代碼。

Description
FAILED
Failed
Success