共用方式為


Document Classifiers - Build Classifier

建置自定義檔分類器。

POST {endpoint}/documentintelligence/documentClassifiers:build?api-version=2024-02-29-preview

URI 參數

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

string

Document Intelligence 服務端點。

api-version
query True

string

用於此作業的 API 版本。

要求本文

名稱 必要 類型 Description
classifierId True

string

唯一的檔分類器名稱。

docTypes True

<string,  ClassifierDocumentTypeDetails>

要分類的檔案類型清單。

baseClassifierId

string

要定型分類器之頂端的基底分類器Id。

description

string

檔分類器描述。

回應

名稱 類型 Description
202 Accepted

已接受要求進行處理,但尚未完成處理。

Headers

  • Operation-Location: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

非預期的錯誤回應。

安全性

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

OAuth2Auth

Type: oauth2
Flow: accessCode
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize
Token URL: https://login.microsoftonline.com/common/oauth2/token

Scopes

名稱 Description
https://cognitiveservices.azure.com/.default

範例

Build Document Classifier

Sample Request

POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers:build?api-version=2024-02-29-preview

{
  "classifierId": "myClassifier",
  "description": "Classifier description",
  "docTypes": {
    "formA": {
      "azureBlobSource": {
        "containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
        "prefix": "formADocs/"
      }
    },
    "formB": {
      "azureBlobFileListSource": {
        "containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
        "fileList": "formB.jsonl"
      }
    }
  }
}

Sample Response

Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2024-02-29-preview

定義

名稱 Description
AzureBlobContentSource

Azure Blob 儲存體 內容。

AzureBlobFileListContentSource

Azure Blob 儲存體 中的檔案清單。

BuildDocumentClassifierRequest

要求本文以建置新的自定義檔分類器。

ClassifierDocumentTypeDetails

分類器檔類型資訊。

ContentSourceKind

內容類型。

Error

error 物件。

ErrorResponse

錯誤回應物件。

InnerError

物件,包含錯誤的詳細資訊。

AzureBlobContentSource

Azure Blob 儲存體 內容。

名稱 類型 Description
containerUrl

string

Azure Blob 儲存體 容器 URL。

prefix

string

Blob 名稱前置詞。

AzureBlobFileListContentSource

Azure Blob 儲存體 中的檔案清單。

名稱 類型 Description
containerUrl

string

Azure Blob 儲存體 容器 URL。

fileList

string

指定文件子集之容器內的 JSONL 檔案路徑。

BuildDocumentClassifierRequest

要求本文以建置新的自定義檔分類器。

名稱 類型 Description
baseClassifierId

string

要定型分類器之頂端的基底分類器Id。

classifierId

string

唯一的檔分類器名稱。

description

string

檔分類器描述。

docTypes

<string,  ClassifierDocumentTypeDetails>

要分類的檔案類型清單。

ClassifierDocumentTypeDetails

分類器檔類型資訊。

名稱 類型 Description
azureBlobFileListSource

AzureBlobFileListContentSource

Azure Blob 儲存體 檔案清單,指定分類器檔類型的定型數據。 必須指定 azureBlobSource 或 azureBlobFileListSource。

azureBlobSource

AzureBlobContentSource

Azure Blob 儲存體 位置,其中包含分類器檔類型的定型數據。 必須指定 azureBlobSource 或 azureBlobFileListSource。

sourceKind

ContentSourceKind

定型數據源的類型。

ContentSourceKind

內容類型。

名稱 類型 Description
azureBlob

string

Azure Blob 儲存體 容器內路徑中的檔案。

azureBlobFileList

string

指定 Azure Blob 儲存體 容器中個別檔案的檔案清單。

base64

string

透過Base64編碼表示的內容。

url

string

特定 URL 的內容。

Error

error 物件。

名稱 類型 Description
code

string

其中一組伺服器定義的錯誤碼。

details

Error[]

導致此錯誤之特定錯誤的詳細數據陣列。

innererror

InnerError

物件,包含比目前對象有關錯誤更具體的資訊。

message

string

人類可讀取的錯誤表示法。

target

string

錯誤的目標。

ErrorResponse

錯誤回應物件。

名稱 類型 Description
error

Error

錯誤資訊。

InnerError

物件,包含錯誤的詳細資訊。

名稱 類型 Description
code

string

其中一組伺服器定義的錯誤碼。

innererror

InnerError

內部錯誤。

message

string

人類可讀取的錯誤表示法。