Method: processorVersions.train

Full name: projects.locations.processors.processorVersions.train

Trains a new processor version. Operation metadata is returned as TrainProcessorVersionMetadata.

HTTP request

POST https://{endpoint}/v1beta3/{parent}/processorVersions:train

Where {endpoint} is one of the supported service endpoints.

Path parameters

Parameters
parent

string

Required. The parent (project, location and processor) to create the new version for. Format: projects/{project}/locations/{location}/processors/{processor}. It takes the form projects/{project}/locations/{location}/processors/{processor}.

Request body

The request body contains data with the following structure:

JSON representation
{
  "processorVersion": {
    object (ProcessorVersion)
  },
  "documentSchema": {
    object (DocumentSchema)
  },
  "inputData": {
    object (InputData)
  },
  "baseProcessorVersion": string,

  // Union field processor_flags can be only one of the following:
  "customDocumentExtractionOptions": {
    object (CustomDocumentExtractionOptions)
  }
  // End of list of possible types for union field processor_flags.
}
Fields
processorVersion

object (ProcessorVersion)

Required. The processor version to be created.

Authorization requires the following IAM permission on the specified resource processorVersion:

  • documentai.processorVersions.create
documentSchema

object (DocumentSchema)

Optional. The schema the processor version will be trained with.

inputData

object (InputData)

Optional. The input data used to train the ProcessorVersion.

baseProcessorVersion

string

Optional. The processor version to use as a base for training. This processor version must be a child of parent. Format: projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}.

Union field processor_flags.

processor_flags can be only one of the following:

customDocumentExtractionOptions

object (CustomDocumentExtractionOptions)

Options to control Custom Document Extraction (CDE) Processor.

Response body

If successful, the response body contains an instance of Operation.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the parent resource:

  • documentai.processorVersions.create

For more information, see the IAM documentation.

CustomDocumentExtractionOptions

Options to control the training of the Custom Document Extraction (CDE) Processor.

JSON representation
{
  "trainingMethod": enum (TrainingMethod)
}
Fields
trainingMethod

enum (TrainingMethod)

Training method to use for CDE training.

TrainingMethod

Training Method for CDE. TRAINING_METHOD_UNSPECIFIED will fall back to MODEL_BASED.

Enums
TRAINING_METHOD_UNSPECIFIED
MODEL_BASED
TEMPLATE_BASED

InputData

The input data used to train a new ProcessorVersion.

JSON representation
{
  "trainingDocuments": {
    object (BatchDocumentsInputConfig)
  },
  "testDocuments": {
    object (BatchDocumentsInputConfig)
  }
}
Fields
trainingDocuments

object (BatchDocumentsInputConfig)

The documents used for training the new version.

testDocuments

object (BatchDocumentsInputConfig)

The documents used for testing the trained version.