Method: projects.datasets.text.label

Starts a labeling task for text. The type of text labeling task is configured by feature in the request.

HTTP request

POST https://datalabeling.googleapis.com/v1beta1/{parent=projects/*/datasets/*}/text:label

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. Name of the data set to request labeling task, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.annotateddatasets.label

Request body

The request body contains data with the following structure:

JSON representation
{
  "basicConfig": {
    object (HumanAnnotationConfig)
  },
  "feature": enum (Feature),

  // Union field request_config can be only one of the following:
  "textClassificationConfig": {
    object (TextClassificationConfig)
  },
  "textEntityExtractionConfig": {
    object (TextEntityExtractionConfig)
  }
  // End of list of possible types for union field request_config.
}
Fields
basicConfig

object (HumanAnnotationConfig)

Required. Basic human annotation config.

feature

enum (Feature)

Required. The type of text labeling task.

Union field request_config. Required. Config for labeling tasks. The type of request config must match the selected feature. request_config can be only one of the following:
textClassificationConfig

object (TextClassificationConfig)

Configuration for text classification task. One of textClassificationConfig and textEntityExtractionConfig is required.

textEntityExtractionConfig

object (TextEntityExtractionConfig)

Configuration for entity extraction task. One of textClassificationConfig and textEntityExtractionConfig is required.

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.

Feature

Text labeling task feature.

Enums
FEATURE_UNSPECIFIED
TEXT_CLASSIFICATION Label text content to one of more labels.
TEXT_ENTITY_EXTRACTION Label entities and their span in text.