data_labeling_job.proto 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. // Copyright 2022 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.aiplatform.v1beta1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/aiplatform/v1beta1/encryption_spec.proto";
  19. import "google/cloud/aiplatform/v1beta1/job_state.proto";
  20. import "google/protobuf/struct.proto";
  21. import "google/protobuf/timestamp.proto";
  22. import "google/rpc/status.proto";
  23. import "google/type/money.proto";
  24. option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "DataLabelingJobProto";
  28. option java_package = "com.google.cloud.aiplatform.v1beta1";
  29. option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
  30. option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
  31. // DataLabelingJob is used to trigger a human labeling job on unlabeled data
  32. // from the following Dataset:
  33. message DataLabelingJob {
  34. option (google.api.resource) = {
  35. type: "aiplatform.googleapis.com/DataLabelingJob"
  36. pattern: "projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}"
  37. };
  38. // Output only. Resource name of the DataLabelingJob.
  39. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  40. // Required. The user-defined name of the DataLabelingJob.
  41. // The name can be up to 128 characters long and can be consist of any UTF-8
  42. // characters.
  43. // Display name of a DataLabelingJob.
  44. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  45. // Required. Dataset resource names. Right now we only support labeling from a single
  46. // Dataset.
  47. // Format:
  48. // `projects/{project}/locations/{location}/datasets/{dataset}`
  49. repeated string datasets = 3 [
  50. (google.api.field_behavior) = REQUIRED,
  51. (google.api.resource_reference) = {
  52. type: "aiplatform.googleapis.com/Dataset"
  53. }
  54. ];
  55. // Labels to assign to annotations generated by this DataLabelingJob.
  56. //
  57. // Label keys and values can be no longer than 64 characters
  58. // (Unicode codepoints), can only contain lowercase letters, numeric
  59. // characters, underscores and dashes. International characters are allowed.
  60. // See https://goo.gl/xmQnxf for more information and examples of labels.
  61. // System reserved label keys are prefixed with "aiplatform.googleapis.com/"
  62. // and are immutable.
  63. map<string, string> annotation_labels = 12;
  64. // Required. Number of labelers to work on each DataItem.
  65. int32 labeler_count = 4 [(google.api.field_behavior) = REQUIRED];
  66. // Required. The Google Cloud Storage location of the instruction pdf. This pdf is
  67. // shared with labelers, and provides detailed description on how to label
  68. // DataItems in Datasets.
  69. string instruction_uri = 5 [(google.api.field_behavior) = REQUIRED];
  70. // Required. Points to a YAML file stored on Google Cloud Storage describing the
  71. // config for a specific type of DataLabelingJob.
  72. // The schema files that can be used here are found in the
  73. // https://storage.googleapis.com/google-cloud-aiplatform bucket in the
  74. // /schema/datalabelingjob/inputs/ folder.
  75. string inputs_schema_uri = 6 [(google.api.field_behavior) = REQUIRED];
  76. // Required. Input config parameters for the DataLabelingJob.
  77. google.protobuf.Value inputs = 7 [(google.api.field_behavior) = REQUIRED];
  78. // Output only. The detailed state of the job.
  79. JobState state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  80. // Output only. Current labeling job progress percentage scaled in interval [0, 100],
  81. // indicating the percentage of DataItems that has been finished.
  82. int32 labeling_progress = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  83. // Output only. Estimated cost(in US dollars) that the DataLabelingJob has incurred to
  84. // date.
  85. google.type.Money current_spend = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  86. // Output only. Timestamp when this DataLabelingJob was created.
  87. google.protobuf.Timestamp create_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  88. // Output only. Timestamp when this DataLabelingJob was updated most recently.
  89. google.protobuf.Timestamp update_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  90. // Output only. DataLabelingJob errors. It is only populated when job's state is
  91. // `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
  92. google.rpc.Status error = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  93. // The labels with user-defined metadata to organize your DataLabelingJobs.
  94. //
  95. // Label keys and values can be no longer than 64 characters
  96. // (Unicode codepoints), can only contain lowercase letters, numeric
  97. // characters, underscores and dashes. International characters are allowed.
  98. //
  99. // See https://goo.gl/xmQnxf for more information and examples of labels.
  100. // System reserved label keys are prefixed with "aiplatform.googleapis.com/"
  101. // and are immutable. Following system labels exist for each DataLabelingJob:
  102. //
  103. // * "aiplatform.googleapis.com/schema": output only, its value is the
  104. // [inputs_schema][google.cloud.aiplatform.v1beta1.DataLabelingJob.inputs_schema_uri]'s title.
  105. map<string, string> labels = 11;
  106. // The SpecialistPools' resource names associated with this job.
  107. repeated string specialist_pools = 16;
  108. // Customer-managed encryption key spec for a DataLabelingJob. If set, this
  109. // DataLabelingJob will be secured by this key.
  110. //
  111. // Note: Annotations created in the DataLabelingJob are associated with
  112. // the EncryptionSpec of the Dataset they are exported to.
  113. EncryptionSpec encryption_spec = 20;
  114. // Parameters that configure the active learning pipeline. Active learning
  115. // will label the data incrementally via several iterations. For every
  116. // iteration, it will select a batch of data based on the sampling strategy.
  117. ActiveLearningConfig active_learning_config = 21;
  118. }
  119. // Parameters that configure the active learning pipeline. Active learning will
  120. // label the data incrementally by several iterations. For every iteration, it
  121. // will select a batch of data based on the sampling strategy.
  122. message ActiveLearningConfig {
  123. // Required. Max human labeling DataItems. The rest part will be labeled by
  124. // machine.
  125. oneof human_labeling_budget {
  126. // Max number of human labeled DataItems.
  127. int64 max_data_item_count = 1;
  128. // Max percent of total DataItems for human labeling.
  129. int32 max_data_item_percentage = 2;
  130. }
  131. // Active learning data sampling config. For every active learning labeling
  132. // iteration, it will select a batch of data based on the sampling strategy.
  133. SampleConfig sample_config = 3;
  134. // CMLE training config. For every active learning labeling iteration, system
  135. // will train a machine learning model on CMLE. The trained model will be used
  136. // by data sampling algorithm to select DataItems.
  137. TrainingConfig training_config = 4;
  138. }
  139. // Active learning data sampling config. For every active learning labeling
  140. // iteration, it will select a batch of data based on the sampling strategy.
  141. message SampleConfig {
  142. // Sample strategy decides which subset of DataItems should be selected for
  143. // human labeling in every batch.
  144. enum SampleStrategy {
  145. // Default will be treated as UNCERTAINTY.
  146. SAMPLE_STRATEGY_UNSPECIFIED = 0;
  147. // Sample the most uncertain data to label.
  148. UNCERTAINTY = 1;
  149. }
  150. // Decides sample size for the initial batch. initial_batch_sample_percentage
  151. // is used by default.
  152. oneof initial_batch_sample_size {
  153. // The percentage of data needed to be labeled in the first batch.
  154. int32 initial_batch_sample_percentage = 1;
  155. }
  156. // Decides sample size for the following batches.
  157. // following_batch_sample_percentage is used by default.
  158. oneof following_batch_sample_size {
  159. // The percentage of data needed to be labeled in each following batch
  160. // (except the first batch).
  161. int32 following_batch_sample_percentage = 3;
  162. }
  163. // Field to choose sampling strategy. Sampling strategy will decide which data
  164. // should be selected for human labeling in every batch.
  165. SampleStrategy sample_strategy = 5;
  166. }
  167. // CMLE training config. For every active learning labeling iteration, system
  168. // will train a machine learning model on CMLE. The trained model will be used
  169. // by data sampling algorithm to select DataItems.
  170. message TrainingConfig {
  171. // The timeout hours for the CMLE training job, expressed in milli hours
  172. // i.e. 1,000 value in this field means 1 hour.
  173. int64 timeout_training_milli_hours = 1;
  174. }