1// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.automl.v1beta1;
18
19import "google/api/resource.proto";
20import "google/cloud/automl/v1beta1/classification.proto";
21import "google/cloud/automl/v1beta1/detection.proto";
22import "google/cloud/automl/v1beta1/regression.proto";
23import "google/cloud/automl/v1beta1/tables.proto";
24import "google/cloud/automl/v1beta1/text_extraction.proto";
25import "google/cloud/automl/v1beta1/text_sentiment.proto";
26import "google/cloud/automl/v1beta1/translation.proto";
27import "google/protobuf/timestamp.proto";
28
29option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb";
30option java_multiple_files = true;
31option java_package = "com.google.cloud.automl.v1beta1";
32option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1";
33option ruby_package = "Google::Cloud::AutoML::V1beta1";
34
35// Evaluation results of a model.
36message ModelEvaluation {
37  option (google.api.resource) = {
38    type: "automl.googleapis.com/ModelEvaluation"
39    pattern: "projects/{project}/locations/{location}/models/{model}/modelEvaluations/{model_evaluation}"
40  };
41
42  // Output only. Problem type specific evaluation metrics.
43  oneof metrics {
44    // Model evaluation metrics for image, text, video and tables
45    // classification.
46    // Tables problem is considered a classification when the target column
47    // is CATEGORY DataType.
48    ClassificationEvaluationMetrics classification_evaluation_metrics = 8;
49
50    // Model evaluation metrics for Tables regression.
51    // Tables problem is considered a regression when the target column
52    // has FLOAT64 DataType.
53    RegressionEvaluationMetrics regression_evaluation_metrics = 24;
54
55    // Model evaluation metrics for translation.
56    TranslationEvaluationMetrics translation_evaluation_metrics = 9;
57
58    // Model evaluation metrics for image object detection.
59    ImageObjectDetectionEvaluationMetrics image_object_detection_evaluation_metrics = 12;
60
61    // Model evaluation metrics for video object tracking.
62    VideoObjectTrackingEvaluationMetrics video_object_tracking_evaluation_metrics = 14;
63
64    // Evaluation metrics for text sentiment models.
65    TextSentimentEvaluationMetrics text_sentiment_evaluation_metrics = 11;
66
67    // Evaluation metrics for text extraction models.
68    TextExtractionEvaluationMetrics text_extraction_evaluation_metrics = 13;
69  }
70
71  // Output only. Resource name of the model evaluation.
72  // Format:
73  //
74  // `projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}`
75  string name = 1;
76
77  // Output only. The ID of the annotation spec that the model evaluation applies to. The
78  // The ID is empty for the overall model evaluation.
79  // For Tables annotation specs in the dataset do not exist and this ID is
80  // always not set, but for CLASSIFICATION
81  //
82  // [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]
83  // the
84  // [display_name][google.cloud.automl.v1beta1.ModelEvaluation.display_name]
85  // field is used.
86  string annotation_spec_id = 2;
87
88  // Output only. The value of
89  // [display_name][google.cloud.automl.v1beta1.AnnotationSpec.display_name] at
90  // the moment when the model was trained. Because this field returns a value
91  // at model training time, for different models trained from the same dataset,
92  // the values may differ, since display names could had been changed between
93  // the two model's trainings.
94  // For Tables CLASSIFICATION
95  //
96  // [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type]
97  // distinct values of the target column at the moment of the model evaluation
98  // are populated here.
99  // The display_name is empty for the overall model evaluation.
100  string display_name = 15;
101
102  // Output only. Timestamp when this model evaluation was created.
103  google.protobuf.Timestamp create_time = 5;
104
105  // Output only. The number of examples used for model evaluation, i.e. for
106  // which ground truth from time of model creation is compared against the
107  // predicted annotations created by the model.
108  // For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is
109  // the total number of all examples used for evaluation.
110  // Otherwise, this is the count of examples that according to the ground
111  // truth were annotated by the
112  //
113  // [annotation_spec_id][google.cloud.automl.v1beta1.ModelEvaluation.annotation_spec_id].
114  int32 evaluated_example_count = 6;
115}
116