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