model.proto 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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/api/resource.proto";
  17. import "google/cloud/automl/v1/image.proto";
  18. import "google/cloud/automl/v1/text.proto";
  19. import "google/cloud/automl/v1/translation.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option csharp_namespace = "Google.Cloud.AutoML.V1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
  23. option java_multiple_files = true;
  24. option java_package = "com.google.cloud.automl.v1";
  25. option php_namespace = "Google\\Cloud\\AutoMl\\V1";
  26. option ruby_package = "Google::Cloud::AutoML::V1";
  27. // API proto representing a trained machine learning model.
  28. message Model {
  29. option (google.api.resource) = {
  30. type: "automl.googleapis.com/Model"
  31. pattern: "projects/{project}/locations/{location}/models/{model}"
  32. };
  33. // Deployment state of the model.
  34. enum DeploymentState {
  35. // Should not be used, an un-set enum has this value by default.
  36. DEPLOYMENT_STATE_UNSPECIFIED = 0;
  37. // Model is deployed.
  38. DEPLOYED = 1;
  39. // Model is not deployed.
  40. UNDEPLOYED = 2;
  41. }
  42. // Required.
  43. // The model metadata that is specific to the problem type.
  44. // Must match the metadata type of the dataset used to train the model.
  45. oneof model_metadata {
  46. // Metadata for translation models.
  47. TranslationModelMetadata translation_model_metadata = 15;
  48. // Metadata for image classification models.
  49. ImageClassificationModelMetadata image_classification_model_metadata = 13;
  50. // Metadata for text classification models.
  51. TextClassificationModelMetadata text_classification_model_metadata = 14;
  52. // Metadata for image object detection models.
  53. ImageObjectDetectionModelMetadata image_object_detection_model_metadata = 20;
  54. // Metadata for text extraction models.
  55. TextExtractionModelMetadata text_extraction_model_metadata = 19;
  56. // Metadata for text sentiment models.
  57. TextSentimentModelMetadata text_sentiment_model_metadata = 22;
  58. }
  59. // Output only. Resource name of the model.
  60. // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}`
  61. string name = 1;
  62. // Required. The name of the model to show in the interface. The name can be
  63. // up to 32 characters long and can consist only of ASCII Latin letters A-Z
  64. // and a-z, underscores
  65. // (_), and ASCII digits 0-9. It must start with a letter.
  66. string display_name = 2;
  67. // Required. The resource ID of the dataset used to create the model. The dataset must
  68. // come from the same ancestor project and location.
  69. string dataset_id = 3;
  70. // Output only. Timestamp when the model training finished and can be used for prediction.
  71. google.protobuf.Timestamp create_time = 7;
  72. // Output only. Timestamp when this model was last updated.
  73. google.protobuf.Timestamp update_time = 11;
  74. // Output only. Deployment state of the model. A model can only serve
  75. // prediction requests after it gets deployed.
  76. DeploymentState deployment_state = 8;
  77. // Used to perform a consistent read-modify-write updates. If not set, a blind
  78. // "overwrite" update happens.
  79. string etag = 10;
  80. // Optional. The labels with user-defined metadata to organize your model.
  81. //
  82. // Label keys and values can be no longer than 64 characters
  83. // (Unicode codepoints), can only contain lowercase letters, numeric
  84. // characters, underscores and dashes. International characters are allowed.
  85. // Label values are optional. Label keys must start with a letter.
  86. //
  87. // See https://goo.gl/xmQnxf for more information on and examples of labels.
  88. map<string, string> labels = 34;
  89. }