Dela via


Document Models - Build Model

Skapar en anpassad dokumentanalysmodell.

POST {endpoint}/documentintelligence/documentModels:build?api-version=2024-11-30

URI-parametrar

Name I Obligatorisk Typ Description
endpoint
path True

string (uri)

Slutpunkten för document intelligence-tjänsten.

api-version
query True

string

minLength: 1

DEN API-version som ska användas för den här åtgärden.

Begärandetext

Name Obligatorisk Typ Description
buildMode True

DocumentBuildMode

Genereringsläge för anpassad dokumentmodell.

modelId True

string

pattern: ^[a-zA-Z0-9][a-zA-Z0-9._~-]{1,63}$

Unikt dokumentmodellnamn.

allowOverwrite

boolean

Tillåt överskrivning av en befintlig modell med samma namn.

azureBlobFileListSource

AzureBlobFileListContentSource

Azure Blob Storage-fillista som anger träningsdata. Antingen azureBlobSource eller azureBlobFileListSource måste anges.

azureBlobSource

AzureBlobContentSource

Azure Blob Storage-plats som innehåller träningsdata. Antingen azureBlobSource eller azureBlobFileListSource måste anges.

description

string

maxLength: 4096

Beskrivning av dokumentmodell.

maxTrainingHours

number (float)

Maximalt antal V100-motsvarande GPU-timmar som ska användas för modellträning. Default=0.5.

tags

object

Lista över taggattribut för nyckel/värde som är associerade med dokumentmodellen.

Svar

Name Typ Description
202 Accepted

Begäran har godkänts för bearbetning, men bearbetningen har ännu inte slutförts.

Sidhuvuden

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

DocumentIntelligenceErrorResponse

Ett oväntat felsvar.

Säkerhet

Ocp-Apim-Subscription-Key

Typ: apiKey
I: header

OAuth2Auth

Typ: oauth2
Flow: accessCode
Auktoriseringswebbadress: https://login.microsoftonline.com/common/oauth2/authorize
Token-webbadress: https://login.microsoftonline.com/common/oauth2/token

Omfattningar

Name Description
https://cognitiveservices.azure.com/.default

Exempel

Build Document Model

Exempelbegäran

POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels:build?api-version=2024-11-30

{
  "modelId": "myCustomModel",
  "description": "Custom model description",
  "buildMode": "template",
  "azureBlobSource": {
    "containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
    "prefix": "trainingDocs/"
  },
  "tags": {
    "createdBy": "myUserId"
  }
}

Exempelsvar

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

Definitioner

Name Description
AzureBlobContentSource

Azure Blob Storage-innehåll.

AzureBlobFileListContentSource

Fillista i Azure Blob Storage.

BuildDocumentModelRequest

Begär brödtext för att skapa en ny anpassad dokumentmodell.

DocumentBuildMode

Genereringsläge för anpassad dokumentmodell.

DocumentIntelligenceError

Felobjektet.

DocumentIntelligenceErrorResponse

Felsvarsobjekt.

DocumentIntelligenceInnerError

Ett objekt som innehåller mer specifik information om felet.

AzureBlobContentSource

Azure Blob Storage-innehåll.

Name Typ Description
containerUrl

string (uri)

Url för Azure Blob Storage-container.

prefix

string

Prefix för blobnamn.

AzureBlobFileListContentSource

Fillista i Azure Blob Storage.

Name Typ Description
containerUrl

string (uri)

Url för Azure Blob Storage-container.

fileList

string

Sökväg till en JSONL-fil i containern som anger en delmängd av dokument.

BuildDocumentModelRequest

Begär brödtext för att skapa en ny anpassad dokumentmodell.

Name Typ Standardvärde Description
allowOverwrite

boolean

False

Tillåt överskrivning av en befintlig modell med samma namn.

azureBlobFileListSource

AzureBlobFileListContentSource

Azure Blob Storage-fillista som anger träningsdata. Antingen azureBlobSource eller azureBlobFileListSource måste anges.

azureBlobSource

AzureBlobContentSource

Azure Blob Storage-plats som innehåller träningsdata. Antingen azureBlobSource eller azureBlobFileListSource måste anges.

buildMode

DocumentBuildMode

Genereringsläge för anpassad dokumentmodell.

description

string

maxLength: 4096

Beskrivning av dokumentmodell.

maxTrainingHours

number (float)

0.5

Maximalt antal V100-motsvarande GPU-timmar som ska användas för modellträning. Default=0.5.

modelId

string

pattern: ^[a-zA-Z0-9][a-zA-Z0-9._~-]{1,63}$

Unikt dokumentmodellnamn.

tags

object

Lista över taggattribut för nyckel/värde som är associerade med dokumentmodellen.

DocumentBuildMode

Genereringsläge för anpassad dokumentmodell.

Värde Description
neural

Stöd för dokument med olika visuella mallar.

template

Måldokument med liknande visuella mallar.

DocumentIntelligenceError

Felobjektet.

Name Typ Description
code

string

En av en serverdefinierad uppsättning felkoder.

details

DocumentIntelligenceError[]

En matris med information om specifika fel som ledde till det rapporterade felet.

innererror

DocumentIntelligenceInnerError

Ett objekt som innehåller mer specifik information än det aktuella objektet om felet.

message

string

En mänsklig läsbar representation av felet.

target

string

Målet för felet.

DocumentIntelligenceErrorResponse

Felsvarsobjekt.

Name Typ Description
error

DocumentIntelligenceError

Felinformation.

DocumentIntelligenceInnerError

Ett objekt som innehåller mer specifik information om felet.

Name Typ Description
code

string

En av en serverdefinierad uppsättning felkoder.

innererror

DocumentIntelligenceInnerError

Inre fel.

message

string

En mänsklig läsbar representation av felet.