Package google.cloud.automl.v1beta1

Index

AutoMl

AutoML Server API.

The resource names are assigned by the server. The server never reuses names that it has created after the resources with those names are deleted.

An ID of a resource is the last element of the item's resource name. For projects/{project_id}/locations/{location_id}/datasets/{dataset_id}, then the id for the item is {dataset_id}.

CreateDataset

rpc CreateDataset(CreateDatasetRequest) returns (Dataset)

Creates a dataset.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

CreateModel

rpc CreateModel(CreateModelRequest) returns (Operation)

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

DeleteDataset

rpc DeleteDataset(DeleteDatasetRequest) returns (Operation)

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

DeleteModel

rpc DeleteModel(DeleteModelRequest) returns (Operation)

Deletes a model. If a model is already deployed, this only deletes the model in AutoML BE, and does not change the status of the deployed model in the production environment. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

DeployModel

rpc DeployModel(DeployModelRequest) returns (Operation)

Deploys model. Returns a [DeployModelResponse][] in the response field when it completes.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

GetDataset

rpc GetDataset(GetDatasetRequest) returns (Dataset)

Gets a dataset.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

GetModel

rpc GetModel(GetModelRequest) returns (Model)

Gets a model.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

GetModelEvaluation

rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation)

Gets a model evaluation.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

ImportData

rpc ImportData(ImportDataRequest) returns (Operation)

Imports data into a dataset. Returns an empty response in the response field when it completes.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

ListDatasets

rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse)

Lists datasets in a project.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

ListModelEvaluations

rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse)

Lists model evaluations.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

ListModels

rpc ListModels(ListModelsRequest) returns (ListModelsResponse)

Lists models.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

UndeployModel

rpc UndeployModel(UndeployModelRequest) returns (Operation)

Undeploys model. Returns an UndeployModelResponse in the response field when it completes.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

PredictionService

AutoML Prediction API.

Predict

rpc Predict(PredictRequest) returns (PredictResponse)

Perform a prediction.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

AnnotationPayload

Contains annotation information that is relevant to AutoML.

Fields
annotation_spec_id

string

Output only . The resource ID of the annotation spec that this annotation pertains to. The annotation spec comes from either an ancestor dataset, or the dataset that was used to train the model in use.

display_name

string

Output only. The value of AnnotationSpec.display_name when the model was trained. Because this field returns a value at model training time, for different models trained using the same dataset, the returned value could be different as model owner could update the display_name between any two model training.

Union field detail. Output only . Additional information about the annotation specific to the AutoML solution. detail can be only one of the following:
translation

TranslationAnnotation

Annotation details for translation.

classification

ClassificationAnnotation

Annotation details for content or image classification.

ClassificationAnnotation

Contains annotation details specific to classification.

Fields
score

float

Output only. A confidence estimate between 0.0 and 1.0. A higher value means greater confidence that the annotation is positive. If a user approves an annotation as negative or positive, the score value remains unchanged. If a user creates an annotation, the score is 0 for negative or 1 for positive.

ClassificationEvaluationMetrics

Model evaluation metrics for classification problems. Visible only to v1beta1

Fields
au_prc

float

Output only. The Area under precision recall curve metric.

base_au_prc

float

Output only. The Area under precision recall curve metric based on priors.

confidence_metrics_entry[]

ConfidenceMetricsEntry

Output only. Metrics that have confidence thresholds. Precision-recall curve can be derived from it.

confusion_matrix

ConfusionMatrix

Output only. Confusion matrix of the evaluation. Only set for MULTICLASS classification problems where number of labels is no more than 10. Only set for model level evaluation, not for evaluation per label.

annotation_spec_id[]

string

Output only. The annotation spec ids used for this evaluation.

ConfidenceMetricsEntry

Metrics for a single confidence threshold.

Fields
confidence_threshold

float

Output only. The confidence threshold value used to compute the metrics.

recall

float

Output only. Recall under the given confidence threshold.

precision

float

Output only. Precision under the given confidence threshold.

f1_score

float

Output only. The harmonic mean of recall and precision.

recall_at1

float

Output only. The recall when only considering the label that has the highest prediction score and not below the confidence threshold for each example.

precision_at1

float

Output only. The precision when only considering the label that has the highest predictionscore and not below the confidence threshold for each example.

f1_score_at1

float

Output only. The harmonic mean of recall_at1 and precision_at1.

ConfusionMatrix

Confusion matrix of the model running the classification.

Fields
annotation_spec_id[]

string

Output only. IDs of the annotation specs used in the confusion matrix.

row[]

Row

Output only. Rows in the confusion matrix. The number of rows is equal to the size of annotation_spec_id. row[i].value[j] is the number of examples that have ground truth of the annotation_spec_id[i] and are predicted as annotation_spec_id[j] by the model being evaluated.

Row

Output only. A row in the confusion matrix.

Fields
example_count[]

int32

Output only. Value of the specific cell in the confusion matrix. The number of values each row is equal to the size of annotatin_spec_id.

ClassificationType

Type of the classification problem.

Enums
CLASSIFICATION_TYPE_UNSPECIFIED Should not be used, an un-set enum has this value by default.
MULTICLASS At most one label is allowed per example.
MULTILABEL Multiple labels are allowed for one example.

CreateDatasetRequest

Request message for AutoMl.CreateDataset.

Fields
parent

string

The resource name of the project to create the dataset for.

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

  • automl.datasets.create

dataset

Dataset

The dataset to create.

CreateModelOperationMetadata

Details of CreateModel operation.

CreateModelRequest

Request message for AutoMl.CreateModel.

Fields
parent

string

Resource name of the parent project where the model is being created.

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

  • automl.models.create

model

Model

The model to create.

Dataset

A workspace for solving a single, particular machine learning (ML) problem. A workspace contains examples that may be annotated.

Fields
name

string

Output only. The resource name of the dataset. Form: projects/{project_id}/locations/{location_id}/datasets/{dataset_id}

display_name

string

Required. The name of the dataset to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.

example_count

int32

Output only. The number of examples in the dataset.

create_time

Timestamp

Output only. Timestamp when this dataset was created.

Union field dataset_metadata. Required. The dataset metadata that is specific to the problem type. dataset_metadata can be only one of the following:
translation_dataset_metadata

TranslationDatasetMetadata

Metadata for a dataset used for translation.

image_classification_dataset_metadata

ImageClassificationDatasetMetadata

Metadata for a dataset used for image classification.

text_classification_dataset_metadata

TextClassificationDatasetMetadata

Metadata for a dataset used for text classification.

DeleteDatasetRequest

Request message for AutoMl.DeleteDataset.

Fields
name

string

The resource name of the dataset to delete.

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

  • automl.datasets.delete

DeleteModelRequest

Request message for AutoMl.DeleteModel.

Fields
name

string

Resource name of the model being deleted.

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

  • automl.models.delete

DeployModelRequest

Request message for AutoMl.DeployModel.

Fields
name

string

Resource name of the model to deploy.

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

  • automl.models.deploy

ExamplePayload

Example data used for training or prediction.

Fields
Union field payload. Required. Input only. The example data. payload can be only one of the following:
image

Image

An example image.

text_snippet

TextSnippet

Example text.

GcsDestination

The Google Cloud Storage location where the output must be written to

Fields
output_uri_prefix

string

Required. Google Cloud Storage URI to output directory, up to 2000 characters long. Accepted forms: * Prefix path: gs://bucket/directory The requesting user must have write permission to the bucket. The directory is created if it doesn't exist.

GcsSource

The Google Cloud Storage location for the input content.

Fields
input_uris[]

string

Required. Google Cloud Storage URIs to input files, up to 2000 characters long. Accepted forms: * Full object path: gs://bucket/directory/object.csv

GetDatasetRequest

Request message for AutoMl.GetDataset.

Fields
name

string

The resource name of the dataset to retrieve.

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

  • automl.datasets.get

GetModelEvaluationRequest

Request message for AutoMl.GetModelEvaluation.

Fields
name

string

Resource name for the model evaluation.

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

  • automl.modelEvaluations.get

GetModelRequest

Request message for AutoMl.GetModel.

Fields
name

string

Resource name of the model.

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

  • automl.models.get

Image

A representation of an image.

Fields
thumbnail_uri

string

Output only. HTTP URI to the thumbnail image.

Union field data. Input only. The data representing the image. For Predict calls [image_bytes][] must be set, as other options are not currently supported by prediction API. You can read the contents of an uploaded image by using the [content_uri][] field. data can be only one of the following:
image_bytes

bytes

Image content represented as a stream of bytes. Note: As with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.

input_config

InputConfig

An input config specifying the content of the image.

ImageClassificationDatasetMetadata

Dataset metadata that is specific to image classification.

Fields
classification_type

ClassificationType

Required. Type of the classification problem.

ImageClassificationModelMetadata

Model metadata for image classification.

Fields
base_model_id

string

Optional. The ID of the base model. If it is specified, the new model will be created based on the base model. Otherwise, the new model will be created from scratch. The base model is expected to be in the same project and location as the new model to create.

train_budget

int64

Required. The train budget of creating this model. The actual train_cost will be equal or less than this value.

train_cost

int64

Output only. The actual train cost of creating this model. If this model is created from a base model, the train cost used to create the base model are not included.

stop_reason

string

Output only. The reason that this create model operation stopped, e.g. BUDGET_REACHED, MODEL_CONVERGED.

ImportDataRequest

Request message for AutoMl.ImportData.

Fields
name

string

Required. Dataset name. Dataset must already exist. All imported annotations and examples will be added.

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

  • automl.datasets.import

input_config

InputConfig

Required. The desired input location.

InputConfig

Input configuration.

Fields
gcs_source

GcsSource

The Google Cloud Storage location for the input content.

ListDatasetsRequest

Request message for AutoMl.ListDatasets.

Fields
parent

string

The resource name of the project from which to list datasets.

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

  • automl.datasets.list

filter

string

An expression for filtering the results of the request.

  • dataset_metadata - for existence of the case.

An example of using the filter is:

  • translation_dataset_metadata:* --> The dataset has translation_dataset_metadata.

page_size

int32

Requested page size. Server may return fewer results than requested. If unspecified, server will pick a default size.

page_token

string

A token identifying a page of results for the server to return Typically obtained via ListDatasetsResponse.next_page_token of the previous AutoMl.ListDatasets call.

ListDatasetsResponse

Response message for AutoMl.ListDatasets.

Fields
datasets[]

Dataset

The datasets read.

next_page_token

string

A token to retrieve next page of results. Pass to ListDatasetsRequest.page_token to obtain that page.

ListModelEvaluationsRequest

Request message for AutoMl.ListModelEvaluations.

Fields
parent

string

Resource name of the model to list the model evaluations for. If modelId is set as "-", this will list model evaluations from across all models of the parent location.

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

  • automl.modelEvaluations.list

filter

string

An expression for filtering the results of the request.

  • annotation_spec_id - for =, != or existence. See example below for the last.

Some examples of using the filter are:

  • annotation_spec_id!=4 --> The model evaluation was done for annotation spec with ID different than 4.
  • NOT annotation_spec_id:* --> The model evaluation was done for aggregate of all annotation specs.

page_size

int32

Requested page size.

page_token

string

A token identifying a page of results for the server to return. Typically obtained via ListModelEvaluationsResponse.next_page_token of the previous AutoMl.ListModelEvaluations call.

ListModelEvaluationsResponse

Response message for AutoMl.ListModelEvaluations.

Fields
model_evaluation[]

ModelEvaluation

List of model evaluations in the requested page.

next_page_token

string

A token to retrieve next page of results. Pass to [ListModelEvaluations.page_token][] to obtain that page.

ListModelsRequest

Request message for AutoMl.ListModels.

Fields
parent

string

Resource name of the project, from which to list the models.

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

  • automl.models.list

filter

string

An expression for filtering the results of the request.

  • model_metadata - for existence of the case.
  • dataset_id - for = or !=.

Some examples of using the filter are:

  • image_classification_model_metadata:* --> The model has image_classification_model_metadata.
  • dataset_id=5 --> The model was created from a sibling dataset with ID 5.

page_size

int32

Requested page size.

page_token

string

A token identifying a page of results for the server to return Typically obtained via ListModelsResponse.next_page_token of the previous AutoMl.ListModels call.

ListModelsResponse

Response message for AutoMl.ListModels.

Fields
model[]

Model

List of models in the requested page.

next_page_token

string

A token to retrieve next page of results. Pass to [ListModels.page_token][] to obtain that page.

Model

API proto representing a trained machine learning model.

Fields
name

string

Output only. Resource name of the model. Format: projects/{project_id}/locations/{location_id}/models/{model_id}

display_name

string

Required. The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.

dataset_id

string

Required. The resource ID of the dataset used to create the model. The dataset must come from the same ancestor project and location.

create_time

Timestamp

Output only. Timestamp when this model was created.

update_time

Timestamp

Output only. Timestamp when this model was last updated.

deployment_state

DeploymentState

Output only. Deployment state of the model. A model can only serve prediction requests after it gets deployed.

Union field model_metadata. Required. The model metadata that is specific to the problem type. Must match the metadata type of the dataset used to train the model. model_metadata can be only one of the following:
image_classification_model_metadata

ImageClassificationModelMetadata

Metadata for image classification models.

text_classification_model_metadata

TextClassificationModelMetadata

Metadata for text classification models.

translation_model_metadata

TranslationModelMetadata

Metadata for translation models.

DeploymentState

Deployment state of the model.

Enums
DEPLOYMENT_STATE_UNSPECIFIED Should not be used, an un-set enum has this value by default.
DEPLOYED Model is deployed.
UNDEPLOYED Model is not deployed.

ModelEvaluation

Evaluation results of a model.

Fields
name

string

Output only. Resource name of the model evaluation. Format:

projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}

annotation_spec_id

string

Output only. The ID of the annotation spec that the model evaluation applies to. The ID is empty for overall model evaluation. NOTE: Currently there is no way to obtain the display_name of the annotation spec from its ID. To see the display_names, review the model evaluations in the UI.

create_time

Timestamp

Output only. Timestamp when this model evaluation was created.

evaluated_example_count

int32

Output only. The number of examples used for model evaluation.

Union field metrics. Output only. Problem type specific evaluation metrics. metrics can be only one of the following:
classification_evaluation_metrics

ClassificationEvaluationMetrics

Evaluation metrics for models on classification problems models.

translation_evaluation_metrics

TranslationEvaluationMetrics

Evaluation metrics for models on translation models.

OperationMetadata

Metadata used across all long running operations returned by AutoML API.

Fields
progress_percent

int32

Output only. Progress of operation. Range: [0, 100].

partial_failures[]

Status

Output only. Partial failures encountered. E.g. single files that couldn't be read. This field should never exceed 20 entries. Status details field will contain standard GCP error details.

create_time

Timestamp

Output only. Time when the operation was created.

update_time

Timestamp

Output only. Time when the operation was updated for the last time.

create_model_details

CreateModelOperationMetadata

Details of CreateModel operation.

OutputConfig

Output configuration.

Fields
gcs_destination

GcsDestination

The Google Cloud Storage location where the output must be written to.

PredictRequest

Request message for PredictionService.Predict.

Fields
name

string

Name of the model requested to serve the prediction.

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

  • automl.models.predict

payload

ExamplePayload

Required. Payload to perform a prediction on. The payload must match the problem type that the model was trained to solve.

params

map<string, string>

Additional domain-specific parameters, any string must be up to 25000 characters long.

  • For Image Classification:

score_threshold - (float) A value from 0.0 to 1.0. When the model makes predictions for an image, it will only produce results that have at least this confidence score threshold. The default is 0.5.

PredictResponse

Response message for PredictionService.Predict.

Currently, this is only used to return an image recognition prediction result. More prediction output metadata might be introduced in the future.

Fields
payload[]

AnnotationPayload

Prediction result.

metadata

map<string, string>

Additional domain-specific prediction response metadata.

TextClassificationDatasetMetadata

Dataset metadata for classification.

Fields
classification_type

ClassificationType

Required. Type of the classification problem.

TextClassificationModelMetadata

Model metadata that is specific to text classification.

TextSnippet

A representation of a text snippet.

Fields
content

string

Required. The content of the text snippet as a string. Up to 250000 characters long.

mime_type

string

The format of the source text. For example, "text/html" or "text/plain". If left blank the format is automatically determined from the type of the uploaded content. The default is "text/html". Up to 25000 characters long.

content_uri

string

Output only. HTTP URI where you can download the content.

TranslationAnnotation

Annotation details specific to translation.

Fields
translated_content

TextSnippet

Output only . The translated content.

TranslationDatasetMetadata

Dataset metadata that is specific to translation.

Fields
source_language_code

string

Required. The BCP-47 language code of the source language.

target_language_code

string

Required. The BCP-47 language code of the target language.

TranslationEvaluationMetrics

Evaluation metrics for the dataset.

Fields
bleu_score

double

Output only. BLEU score.

base_bleu_score

double

Output only. BLEU score for base model.

TranslationModelMetadata

Model metadata that is specific to translation.

Fields
base_model

string

The resource name of the model to use as a baseline to train the custom model. If unset, we use the default base model provided by Google Translate. Format: projects/{project_id}/locations/{location_id}/models/{model_id}

source_language_code

string

Output only. Inferred from the dataset. The source language (The BCP-47 language code) that is used for training.

target_language_code

string

Output only. The target language (The BCP-47 language code) that is used for training.

UndeployModelRequest

Request message for AutoMl.UndeployModel.

Fields
name

string

Resource name of the model to undeploy.

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

  • automl.models.undeploy