Share via


Custom Models - Get

Get detailed information about a custom model.

GET {endpoint}/formrecognizer/v2.1/custom/models/{modelId}
GET {endpoint}/formrecognizer/v2.1/custom/models/{modelId}?includeKeys={includeKeys}

URI Parameters

Name In Required Type Description
endpoint
path True

string

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

modelId
path True

string (uuid)

Model identifier.

includeKeys
query

boolean

Include list of extracted keys in model information.

Request Header

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

string

Responses

Name Type Description
200 OK

Model

Success

Other Status Codes

ErrorResponse

Response entity accompanying non-successful responses containing additional details about the error.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

Examples

Get custom model

Sample request

GET {endpoint}/formrecognizer/v2.1/custom/models/f973e3c1-1148-43bb-bea8-49d0603ab3a8

Sample response

{
  "modelInfo": {
    "modelId": "f973e3c1-1148-43bb-bea8-49d0603ab3a8",
    "modelName": "my composed model",
    "status": "ready",
    "createdDateTime": "2019-05-01T10:53:21Z",
    "lastUpdatedDateTime": "2019-05-01T10:53:23Z",
    "attributes": {
      "isComposed": true
    }
  },
  "keys": {
    "clusters": {
      "0": [
        "Invoice",
        "123112313"
      ],
      "1": [
        "Please remit payment to:",
        "Microsoft"
      ]
    }
  },
  "trainResult": {
    "trainingDocuments": [],
    "fields": [],
    "averageModelAccuracy": 0,
    "errors": []
  },
  "composedTrainResults": [
    {
      "modelId": "4afb20d6-3ed0-4cde-ba40-dbd6207268dd",
      "trainingDocuments": [],
      "fields": [],
      "averageModelAccuracy": 0,
      "errors": []
    },
    {
      "modelId": "6f841356-aa32-42c9-a739-2182c47b79c9",
      "trainingDocuments": [],
      "fields": [],
      "averageModelAccuracy": 0,
      "errors": []
    }
  ]
}

Definitions

Name Description
Attributes

Optional model attributes.

ErrorInformation
ErrorResponse
FormFieldsReport

Report for a custom model training field.

KeysResult

Keys extracted by the custom model.

Model

Response to the get custom model operation.

ModelInfo

Basic custom model information.

ModelStatus

Status of the model.

TrainingDocumentInfo

Report for a custom model training document.

TrainResult

Custom model training result.

TrainStatus

Status of the training operation.

Attributes

Optional model attributes.

Name Type Default value Description
isComposed

boolean

False

Is this model composed? (default: false).

ErrorInformation

Name Type Description
code

string

message

string

ErrorResponse

Name Type Description
error

ErrorInformation

FormFieldsReport

Report for a custom model training field.

Name Type Description
accuracy

number

Estimated extraction accuracy for this field.

fieldName

string

Training field name.

KeysResult

Keys extracted by the custom model.

Name Type Description
clusters

object

Object mapping clusterIds to a list of keys.

Model

Response to the get custom model operation.

Name Type Description
composedTrainResults

TrainResult[]

Training result for composed model.

keys

KeysResult

Keys extracted by the custom model.

modelInfo

ModelInfo

Basic custom model information.

trainResult

TrainResult

Training result for custom model.

ModelInfo

Basic custom model information.

Name Type Description
attributes

Attributes

Optional model attributes.

createdDateTime

string (date-time)

Date and time (UTC) when the model was created.

lastUpdatedDateTime

string (date-time)

Date and time (UTC) when the status was last updated.

modelId

string (uuid)

Model identifier.

modelName

string

Optional user defined model name (max length: 1024).

status

ModelStatus

Status of the model.

ModelStatus

Status of the model.

Value Description
creating
ready
invalid

TrainingDocumentInfo

Report for a custom model training document.

Name Type Description
documentName

string

Training document name.

errors

ErrorInformation[]

List of errors.

pages

integer (int32)

Total number of pages trained.

status

TrainStatus

Status of the training operation.

TrainResult

Custom model training result.

Name Type Description
averageModelAccuracy

number

Average accuracy.

errors

ErrorInformation[]

Errors returned during the training operation.

fields

FormFieldsReport[]

List of fields used to train the model and the train operation error reported by each.

modelId

string (uuid)

Model identifier.

trainingDocuments

TrainingDocumentInfo[]

List of the documents used to train the model and any errors reported in each document.

TrainStatus

Status of the training operation.

Value Description
succeeded
partiallySucceeded
failed