Share via


Text Analysis Authoring - Train

Triggers a training job for a project.

POST {Endpoint}/language/authoring/analyze-text/projects/{projectName}/:train?api-version=2022-05-01

URI Parameters

Name In Required Type Description
Endpoint
path True

string

Supported Cognitive Services endpoint (e.g., https://.api.cognitiveservices.azure.com).

projectName
path True

string

maxLength: 100

The name of the project to use.

api-version
query True

string

Client API version.

Request Header

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

string

A subscription key for a Language service resource.

Request Body

Name Required Type Description
modelLabel True

string

Represents the output model label.

trainingConfigVersion True

string

Represents training config version.

evaluationOptions

TextAnalysisAuthoringEvaluationOptions

Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20.

Responses

Name Type Description
202 Accepted

A successful call results with an Operation-Location header used to check the status of the job.

Headers

operation-location: string

Other Status Codes

ErrorResponse

Error response.

Security

Ocp-Apim-Subscription-Key

A subscription key for a Language service resource.

Type: apiKey
In: header

Examples

Successful Train Project

Sample request

POST {Endpoint}/language/authoring/analyze-text/projects/LoanAgreements/:train?api-version=2022-05-01


{
  "modelLabel": "model1",
  "trainingConfigVersion": "latest",
  "evaluationOptions": {
    "kind": "percentage",
    "testingSplitPercentage": 20,
    "trainingSplitPercentage": 80
  }
}

Sample response

operation-location: {Endpoint}/language/authoring/analyze-text/projects/LoanAgreements/train/jobs/4d37982f-fded-4c2c-afe3-15953b5919b6_637858368000000000?api-version=2022-05-01

Definitions

Name Description
Error

The error object.

ErrorCode

Human-readable error code.

ErrorResponse

Error response.

EvaluationKind

Represents the evaluation kind. By default, the evaluation kind is set to percentage.

InnerErrorCode

Human-readable error code.

InnerErrorModel

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

TextAnalysisAuthoringEvaluationOptions

Represents the options used running the evaluation.

TextAnalysisAuthoringTrainingJobOptions

Represents the options for starting a new training job.

Error

The error object.

Name Type Description
code

ErrorCode

One of a server-defined set of error codes.

details

Error[]

An array of details about specific errors that led to this reported error.

innererror

InnerErrorModel

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

ErrorCode

Human-readable error code.

Value Description
AzureCognitiveSearchIndexLimitReached
AzureCognitiveSearchIndexNotFound
AzureCognitiveSearchNotFound
AzureCognitiveSearchThrottling
Conflict
Forbidden
InternalServerError
InvalidArgument
InvalidRequest
NotFound
OperationNotFound
ProjectNotFound
QuotaExceeded
ServiceUnavailable
Timeout
TooManyRequests
Unauthorized
Warning

ErrorResponse

Error response.

Name Type Description
error

Error

The error object.

EvaluationKind

Represents the evaluation kind. By default, the evaluation kind is set to percentage.

Value Description
manual

Split the data according to the chosen dataset for every example in the data.

percentage

Split the data into training and test sets according to user-defined percentages.

InnerErrorCode

Human-readable error code.

Value Description
AzureCognitiveSearchNotFound
AzureCognitiveSearchThrottling
EmptyRequest
ExtractionFailure
InvalidCountryHint
InvalidDocument
InvalidDocumentBatch
InvalidParameterValue
InvalidRequest
InvalidRequestBodyFormat
KnowledgeBaseNotFound
MissingInputDocuments
ModelVersionIncorrect
UnsupportedLanguageCode

InnerErrorModel

An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.

Name Type Description
code

InnerErrorCode

One of a server-defined set of error codes.

details

object

Error details.

innererror

InnerErrorModel

An object containing more specific information than the current object about the error.

message

string

Error message.

target

string

Error target.

TextAnalysisAuthoringEvaluationOptions

Represents the options used running the evaluation.

Name Type Description
kind

EvaluationKind

Represents the evaluation kind. By default, the evaluation kind is set to percentage.

testingSplitPercentage

integer (int32)

Represents the testing dataset split percentage. Only needed in case the evaluation kind is percentage.

trainingSplitPercentage

integer (int32)

Represents the training dataset split percentage. Only needed in case the evaluation kind is percentage.

TextAnalysisAuthoringTrainingJobOptions

Represents the options for starting a new training job.

Name Type Description
evaluationOptions

TextAnalysisAuthoringEvaluationOptions

Represents the evaluation options. By default, the evaluation kind is percentage, with training split percentage as 80, and testing split percentage as 20.

modelLabel

string

Represents the output model label.

trainingConfigVersion

string

Represents training config version.