text_extraction.proto 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. syntax = "proto3";
  15. package google.cloud.automl.v1;
  16. import "google/cloud/automl/v1/text_segment.proto";
  17. option csharp_namespace = "Google.Cloud.AutoML.V1";
  18. option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
  19. option java_multiple_files = true;
  20. option java_package = "com.google.cloud.automl.v1";
  21. option php_namespace = "Google\\Cloud\\AutoMl\\V1";
  22. option ruby_package = "Google::Cloud::AutoML::V1";
  23. // Annotation for identifying spans of text.
  24. message TextExtractionAnnotation {
  25. // Required. Text extraction annotations can either be a text segment or a
  26. // text relation.
  27. oneof annotation {
  28. // An entity annotation will set this, which is the part of the original
  29. // text to which the annotation pertains.
  30. TextSegment text_segment = 3;
  31. }
  32. // Output only. A confidence estimate between 0.0 and 1.0. A higher value
  33. // means greater confidence in correctness of the annotation.
  34. float score = 1;
  35. }
  36. // Model evaluation metrics for text extraction problems.
  37. message TextExtractionEvaluationMetrics {
  38. // Metrics for a single confidence threshold.
  39. message ConfidenceMetricsEntry {
  40. // Output only. The confidence threshold value used to compute the metrics.
  41. // Only annotations with score of at least this threshold are considered to
  42. // be ones the model would return.
  43. float confidence_threshold = 1;
  44. // Output only. Recall under the given confidence threshold.
  45. float recall = 3;
  46. // Output only. Precision under the given confidence threshold.
  47. float precision = 4;
  48. // Output only. The harmonic mean of recall and precision.
  49. float f1_score = 5;
  50. }
  51. // Output only. The Area under precision recall curve metric.
  52. float au_prc = 1;
  53. // Output only. Metrics that have confidence thresholds.
  54. // Precision-recall curve can be derived from it.
  55. repeated ConfidenceMetricsEntry confidence_metrics_entries = 2;
  56. }