human_annotation_config.proto 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. // Copyright 2019 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. //
  15. syntax = "proto3";
  16. package google.cloud.datalabeling.v1beta1;
  17. import "google/api/field_behavior.proto";
  18. import "google/protobuf/duration.proto";
  19. option csharp_namespace = "Google.Cloud.DataLabeling.V1Beta1";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/datalabeling/v1beta1;datalabeling";
  21. option java_multiple_files = true;
  22. option java_package = "com.google.cloud.datalabeling.v1beta1";
  23. option php_namespace = "Google\\Cloud\\DataLabeling\\V1beta1";
  24. option ruby_package = "Google::Cloud::DataLabeling::V1beta1";
  25. enum StringAggregationType {
  26. STRING_AGGREGATION_TYPE_UNSPECIFIED = 0;
  27. // Majority vote to aggregate answers.
  28. MAJORITY_VOTE = 1;
  29. // Unanimous answers will be adopted.
  30. UNANIMOUS_VOTE = 2;
  31. // Preserve all answers by crowd compute.
  32. NO_AGGREGATION = 3;
  33. }
  34. // Configuration for how human labeling task should be done.
  35. message HumanAnnotationConfig {
  36. // Required. Instruction resource name.
  37. string instruction = 1 [(google.api.field_behavior) = REQUIRED];
  38. // Required. A human-readable name for AnnotatedDataset defined by
  39. // users. Maximum of 64 characters
  40. // .
  41. string annotated_dataset_display_name = 2 [(google.api.field_behavior) = REQUIRED];
  42. // Optional. A human-readable description for AnnotatedDataset.
  43. // The description can be up to 10000 characters long.
  44. string annotated_dataset_description = 3 [(google.api.field_behavior) = OPTIONAL];
  45. // Optional. A human-readable label used to logically group labeling tasks.
  46. // This string must match the regular expression `[a-zA-Z\\d_-]{0,128}`.
  47. string label_group = 4 [(google.api.field_behavior) = OPTIONAL];
  48. // Optional. The Language of this question, as a
  49. // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  50. // Default value is en-US.
  51. // Only need to set this when task is language related. For example, French
  52. // text classification.
  53. string language_code = 5 [(google.api.field_behavior) = OPTIONAL];
  54. // Optional. Replication of questions. Each question will be sent to up to
  55. // this number of contributors to label. Aggregated answers will be returned.
  56. // Default is set to 1.
  57. // For image related labeling, valid values are 1, 3, 5.
  58. int32 replica_count = 6 [(google.api.field_behavior) = OPTIONAL];
  59. // Optional. Maximum duration for contributors to answer a question. Maximum
  60. // is 3600 seconds. Default is 3600 seconds.
  61. google.protobuf.Duration question_duration = 7 [(google.api.field_behavior) = OPTIONAL];
  62. // Optional. If you want your own labeling contributors to manage and work on
  63. // this labeling request, you can set these contributors here. We will give
  64. // them access to the question types in crowdcompute. Note that these
  65. // emails must be registered in crowdcompute worker UI:
  66. // https://crowd-compute.appspot.com/
  67. repeated string contributor_emails = 9 [(google.api.field_behavior) = OPTIONAL];
  68. // Email of the user who started the labeling task and should be notified by
  69. // email. If empty no notification will be sent.
  70. string user_email_address = 10;
  71. }
  72. // Config for image classification human labeling task.
  73. message ImageClassificationConfig {
  74. // Required. Annotation spec set resource name.
  75. string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED];
  76. // Optional. If allow_multi_label is true, contributors are able to choose
  77. // multiple labels for one image.
  78. bool allow_multi_label = 2 [(google.api.field_behavior) = OPTIONAL];
  79. // Optional. The type of how to aggregate answers.
  80. StringAggregationType answer_aggregation_type = 3 [(google.api.field_behavior) = OPTIONAL];
  81. }
  82. // Config for image bounding poly (and bounding box) human labeling task.
  83. message BoundingPolyConfig {
  84. // Required. Annotation spec set resource name.
  85. string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED];
  86. // Optional. Instruction message showed on contributors UI.
  87. string instruction_message = 2 [(google.api.field_behavior) = OPTIONAL];
  88. }
  89. // Config for image polyline human labeling task.
  90. message PolylineConfig {
  91. // Required. Annotation spec set resource name.
  92. string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED];
  93. // Optional. Instruction message showed on contributors UI.
  94. string instruction_message = 2 [(google.api.field_behavior) = OPTIONAL];
  95. }
  96. // Config for image segmentation
  97. message SegmentationConfig {
  98. // Required. Annotation spec set resource name. format:
  99. // projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}
  100. string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED];
  101. // Instruction message showed on labelers UI.
  102. string instruction_message = 2;
  103. }
  104. // Config for video classification human labeling task.
  105. // Currently two types of video classification are supported:
  106. // 1. Assign labels on the entire video.
  107. // 2. Split the video into multiple video clips based on camera shot, and
  108. // assign labels on each video clip.
  109. message VideoClassificationConfig {
  110. // Annotation spec set with the setting of allowing multi labels or not.
  111. message AnnotationSpecSetConfig {
  112. // Required. Annotation spec set resource name.
  113. string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED];
  114. // Optional. If allow_multi_label is true, contributors are able to
  115. // choose multiple labels from one annotation spec set.
  116. bool allow_multi_label = 2 [(google.api.field_behavior) = OPTIONAL];
  117. }
  118. // Required. The list of annotation spec set configs.
  119. // Since watching a video clip takes much longer time than an image, we
  120. // support label with multiple AnnotationSpecSet at the same time. Labels
  121. // in each AnnotationSpecSet will be shown in a group to contributors.
  122. // Contributors can select one or more (depending on whether to allow multi
  123. // label) from each group.
  124. repeated AnnotationSpecSetConfig annotation_spec_set_configs = 1 [(google.api.field_behavior) = REQUIRED];
  125. // Optional. Option to apply shot detection on the video.
  126. bool apply_shot_detection = 2 [(google.api.field_behavior) = OPTIONAL];
  127. }
  128. // Config for video object detection human labeling task.
  129. // Object detection will be conducted on the images extracted from the video,
  130. // and those objects will be labeled with bounding boxes.
  131. // User need to specify the number of images to be extracted per second as the
  132. // extraction frame rate.
  133. message ObjectDetectionConfig {
  134. // Required. Annotation spec set resource name.
  135. string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED];
  136. // Required. Number of frames per second to be extracted from the video.
  137. double extraction_frame_rate = 3 [(google.api.field_behavior) = REQUIRED];
  138. }
  139. // Config for video object tracking human labeling task.
  140. message ObjectTrackingConfig {
  141. // Required. Annotation spec set resource name.
  142. string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED];
  143. }
  144. // Config for video event human labeling task.
  145. message EventConfig {
  146. // Required. The list of annotation spec set resource name. Similar to video
  147. // classification, we support selecting event from multiple AnnotationSpecSet
  148. // at the same time.
  149. repeated string annotation_spec_sets = 1 [(google.api.field_behavior) = REQUIRED];
  150. }
  151. // Config for text classification human labeling task.
  152. message TextClassificationConfig {
  153. // Optional. If allow_multi_label is true, contributors are able to choose
  154. // multiple labels for one text segment.
  155. bool allow_multi_label = 1 [(google.api.field_behavior) = OPTIONAL];
  156. // Required. Annotation spec set resource name.
  157. string annotation_spec_set = 2 [(google.api.field_behavior) = REQUIRED];
  158. // Optional. Configs for sentiment selection.
  159. SentimentConfig sentiment_config = 3 [(google.api.field_behavior) = OPTIONAL];
  160. }
  161. // Config for setting up sentiments.
  162. message SentimentConfig {
  163. // If set to true, contributors will have the option to select sentiment of
  164. // the label they selected, to mark it as negative or positive label. Default
  165. // is false.
  166. bool enable_label_sentiment_selection = 1;
  167. }
  168. // Config for text entity extraction human labeling task.
  169. message TextEntityExtractionConfig {
  170. // Required. Annotation spec set resource name.
  171. string annotation_spec_set = 1 [(google.api.field_behavior) = REQUIRED];
  172. }