Document Classifiers - Build Classifier
Builds a custom document classifier.
POST {endpoint}/formrecognizer/documentClassifiers:build?api-version=2023-07-31
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
endpoint
|
path | True |
string url |
Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). |
api-version
|
query | True |
string |
Requested API version. |
Request Header
Name | Required | Type | Description |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
The secret key for your Azure Cognitive Services subscription. |
Request Body
Name | Required | Type | Description |
---|---|---|---|
classifierId | True |
string |
Unique document classifier name. |
docTypes | True |
<string,
Classifier |
List of document types to classify against. |
description |
string |
Document classifier description. |
Responses
Name | Type | Description |
---|---|---|
202 Accepted |
Request is queued successfully. Headers Operation-Location: string |
|
Other Status Codes |
Error encountered. |
Security
Ocp-Apim-Subscription-Key
The secret key for your Azure Cognitive Services subscription.
Type:
apiKey
In:
header
Examples
Build Document Classifier
Sample Request
POST https://myendpoint.cognitiveservices.azure.com/formrecognizer/documentClassifiers:build?api-version=2023-07-31
{
"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/formrecognizer/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2023-07-31
Definitions
Name | Description |
---|---|
Azure |
Azure Blob Storage content. |
Azure |
File list in Azure Blob Storage. |
Build |
Request body to build a new custom document classifier. |
Classifier |
Classifier document type info. |
Error |
Error info. |
Error |
Error response object. |
Inner |
Detailed error. |
AzureBlobContentSource
Azure Blob Storage content.
Name | Type | Description |
---|---|---|
containerUrl |
string |
Azure Blob Storage container URL. |
prefix |
string |
Blob name prefix. |
AzureBlobFileListContentSource
File list in Azure Blob Storage.
Name | Type | Description |
---|---|---|
containerUrl |
string |
Azure Blob Storage container URL. |
fileList |
string |
Path to a JSONL file within the container specifying a subset of documents for training. |
BuildDocumentClassifierRequest
Request body to build a new custom document classifier.
Name | Type | Description |
---|---|---|
classifierId |
string |
Unique document classifier name. |
description |
string |
Document classifier description. |
docTypes |
<string,
Classifier |
List of document types to classify against. |
ClassifierDocumentTypeDetails
Classifier document type info.
Name | Type | Description |
---|---|---|
azureBlobFileListSource |
Azure Blob Storage file list specifying the training data for a classifier document type. Either azureBlobSource or azureBlobFileListSource must be specified. |
|
azureBlobSource |
Azure Blob Storage location containing the training data for a classifier document type. Either azureBlobSource or azureBlobFileListSource must be specified. |
Error
Error info.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
details |
Error[] |
List of detailed errors. |
innererror |
Detailed error. |
|
message |
string |
Error message. |
target |
string |
Target of the error. |
ErrorResponse
Error response object.
Name | Type | Description |
---|---|---|
error |
Error info. |
InnerError
Detailed error.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
innererror |
Detailed error. |
|
message |
string |
Error message. |