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/cloud/automl/v1beta1/classification.proto";
20
21option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb";
22option java_outer_classname = "TextSentimentProto";
23option java_package = "com.google.cloud.automl.v1beta1";
24option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1";
25option ruby_package = "Google::Cloud::AutoML::V1beta1";
26
27// Contains annotation details specific to text sentiment.
28message TextSentimentAnnotation {
29  // Output only. The sentiment with the semantic, as given to the
30  // [AutoMl.ImportData][google.cloud.automl.v1beta1.AutoMl.ImportData] when populating the dataset from which the model used
31  // for the prediction had been trained.
32  // The sentiment values are between 0 and
33  // Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
34  // with higher value meaning more positive sentiment. They are completely
35  // relative, i.e. 0 means least positive sentiment and sentiment_max means
36  // the most positive from the sentiments present in the train data. Therefore
37  //  e.g. if train data had only negative sentiment, then sentiment_max, would
38  // be still negative (although least negative).
39  // The sentiment shouldn't be confused with "score" or "magnitude"
40  // from the previous Natural Language Sentiment Analysis API.
41  int32 sentiment = 1;
42}
43
44// Model evaluation metrics for text sentiment problems.
45message TextSentimentEvaluationMetrics {
46  // Output only. Precision.
47  float precision = 1;
48
49  // Output only. Recall.
50  float recall = 2;
51
52  // Output only. The harmonic mean of recall and precision.
53  float f1_score = 3;
54
55  // Output only. Mean absolute error. Only set for the overall model
56  // evaluation, not for evaluation of a single annotation spec.
57  float mean_absolute_error = 4;
58
59  // Output only. Mean squared error. Only set for the overall model
60  // evaluation, not for evaluation of a single annotation spec.
61  float mean_squared_error = 5;
62
63  // Output only. Linear weighted kappa. Only set for the overall model
64  // evaluation, not for evaluation of a single annotation spec.
65  float linear_kappa = 6;
66
67  // Output only. Quadratic weighted kappa. Only set for the overall model
68  // evaluation, not for evaluation of a single annotation spec.
69  float quadratic_kappa = 7;
70
71  // Output only. Confusion matrix of the evaluation.
72  // Only set for the overall model evaluation, not for evaluation of a single
73  // annotation spec.
74  ClassificationEvaluationMetrics.ConfusionMatrix confusion_matrix = 8;
75
76  // Output only. The annotation spec ids used for this evaluation.
77  // Deprecated .
78  repeated string annotation_spec_id = 9 [deprecated = true];
79}
80