google-cloud-automl 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +11 -0
- data/AUTHENTICATION.md +199 -0
- data/LICENSE +201 -0
- data/README.md +69 -0
- data/lib/google/cloud/automl/v1beta1/annotation_payload_pb.rb +34 -0
- data/lib/google/cloud/automl/v1beta1/annotation_spec_pb.rb +18 -0
- data/lib/google/cloud/automl/v1beta1/automl_client.rb +1914 -0
- data/lib/google/cloud/automl/v1beta1/automl_client_config.json +146 -0
- data/lib/google/cloud/automl/v1beta1/classification_pb.rb +65 -0
- data/lib/google/cloud/automl/v1beta1/column_spec_pb.rb +28 -0
- data/lib/google/cloud/automl/v1beta1/credentials.rb +41 -0
- data/lib/google/cloud/automl/v1beta1/data_items_pb.rb +48 -0
- data/lib/google/cloud/automl/v1beta1/data_stats_pb.rb +77 -0
- data/lib/google/cloud/automl/v1beta1/data_types_pb.rb +36 -0
- data/lib/google/cloud/automl/v1beta1/dataset_pb.rb +38 -0
- data/lib/google/cloud/automl/v1beta1/detection_pb.rb +52 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/annotation_payload.rb +63 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/annotation_spec.rb +41 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/classification.rb +203 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/column_spec.rb +72 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_items.rb +94 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_stats.rb +160 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_types.rb +107 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/dataset.rb +77 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/detection.rb +134 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/geometry.rb +43 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/image.rb +141 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/io.rb +975 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/model.rb +92 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/model_evaluation.rb +100 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/prediction_service.rb +136 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/ranges.rb +31 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/regression.rb +41 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/service.rb +368 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/table_spec.rb +64 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/tables.rb +261 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/temporal.rb +33 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text.rb +53 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_extraction.rb +60 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_segment.rb +37 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_sentiment.rb +76 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/translation.rb +63 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/video.rb +35 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/longrunning/operations.rb +51 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/any.rb +131 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/duration.rb +91 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/field_mask.rb +222 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/struct.rb +74 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/timestamp.rb +111 -0
- data/lib/google/cloud/automl/v1beta1/doc/google/rpc/status.rb +87 -0
- data/lib/google/cloud/automl/v1beta1/geometry_pb.rb +21 -0
- data/lib/google/cloud/automl/v1beta1/image_pb.rb +43 -0
- data/lib/google/cloud/automl/v1beta1/io_pb.rb +80 -0
- data/lib/google/cloud/automl/v1beta1/model_evaluation_pb.rb +37 -0
- data/lib/google/cloud/automl/v1beta1/model_pb.rb +44 -0
- data/lib/google/cloud/automl/v1beta1/operations_pb.rb +90 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service_client.rb +442 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service_client_config.json +36 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service_pb.rb +39 -0
- data/lib/google/cloud/automl/v1beta1/prediction_service_services_pb.rb +72 -0
- data/lib/google/cloud/automl/v1beta1/ranges_pb.rb +17 -0
- data/lib/google/cloud/automl/v1beta1/regression_pb.rb +20 -0
- data/lib/google/cloud/automl/v1beta1/service_pb.rb +177 -0
- data/lib/google/cloud/automl/v1beta1/service_services_pb.rb +159 -0
- data/lib/google/cloud/automl/v1beta1/table_spec_pb.rb +22 -0
- data/lib/google/cloud/automl/v1beta1/tables_pb.rb +56 -0
- data/lib/google/cloud/automl/v1beta1/temporal_pb.rb +18 -0
- data/lib/google/cloud/automl/v1beta1/text_extraction_pb.rb +32 -0
- data/lib/google/cloud/automl/v1beta1/text_pb.rb +33 -0
- data/lib/google/cloud/automl/v1beta1/text_segment_pb.rb +18 -0
- data/lib/google/cloud/automl/v1beta1/text_sentiment_pb.rb +29 -0
- data/lib/google/cloud/automl/v1beta1/translation_pb.rb +33 -0
- data/lib/google/cloud/automl/v1beta1/video_pb.rb +25 -0
- data/lib/google/cloud/automl/v1beta1.rb +231 -0
- data/lib/google/cloud/automl/version.rb +22 -0
- data/lib/google/cloud/automl.rb +219 -0
- data/lib/google-cloud-automl.rb +15 -0
- metadata +203 -0
@@ -0,0 +1,975 @@
|
|
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
|
+
# https://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
|
+
|
16
|
+
module Google
|
17
|
+
module Cloud
|
18
|
+
module AutoML
|
19
|
+
module V1beta1
|
20
|
+
# Input configuration for ImportData Action.
|
21
|
+
#
|
22
|
+
# The format of input depends on dataset_metadata the Dataset into which
|
23
|
+
# the import is happening has. As input source the
|
24
|
+
# {Google::Cloud::AutoML::V1beta1::InputConfig#gcs_source gcs_source}
|
25
|
+
# is expected, unless specified otherwise. Additionally any input .CSV file
|
26
|
+
# by itself must be 100MB or smaller, unless specified otherwise.
|
27
|
+
# If an "example" file (i.e. image, video etc.) with identical content
|
28
|
+
# (even if it had different GCS_FILE_PATH) is mentioned multiple times, then
|
29
|
+
# its label, bounding boxes etc. are appended. The same file should be always
|
30
|
+
# provided with the same ML_USE and GCS_FILE_PATH, if it is not then
|
31
|
+
# these values are nondeterministically selected from the given ones.
|
32
|
+
#
|
33
|
+
# The formats are represented in EBNF with commas being literal and with
|
34
|
+
# non-terminal symbols defined near the end of this comment. The formats are:
|
35
|
+
#
|
36
|
+
# * For Image Classification:
|
37
|
+
# CSV file(s) with each line in format:
|
38
|
+
# ML_USE,GCS_FILE_PATH,LABEL,LABEL,...
|
39
|
+
# GCS_FILE_PATH leads to image of up to 30MB in size. Supported
|
40
|
+
# extensions: .JPEG, .GIF, .PNG, .WEBP, .BMP, .TIFF, .ICO
|
41
|
+
# For MULTICLASS classification type, at most one LABEL is allowed
|
42
|
+
# per image. If an image has not yet been labeled, then it should be
|
43
|
+
# mentioned just once with no LABEL.
|
44
|
+
# Some sample rows:
|
45
|
+
# TRAIN,gs://folder/image1.jpg,daisy
|
46
|
+
# TEST,gs://folder/image2.jpg,dandelion,tulip,rose
|
47
|
+
# UNASSIGNED,gs://folder/image3.jpg,daisy
|
48
|
+
# UNASSIGNED,gs://folder/image4.jpg
|
49
|
+
#
|
50
|
+
# * For Image Object Detection:
|
51
|
+
# CSV file(s) with each line in format:
|
52
|
+
# ML_USE,GCS_FILE_PATH,(LABEL,BOUNDING_BOX | ,,,,,,,)
|
53
|
+
# GCS_FILE_PATH leads to image of up to 30MB in size. Supported
|
54
|
+
# extensions: .JPEG, .GIF, .PNG.
|
55
|
+
# Each image is assumed to be exhaustively labeled. The minimum
|
56
|
+
# allowed BOUNDING_BOX edge length is 0.01, and no more than 500
|
57
|
+
# BOUNDING_BOX-es per image are allowed (one BOUNDING_BOX is defined
|
58
|
+
# per line). If an image has not yet been labeled, then it should be
|
59
|
+
# mentioned just once with no LABEL and the ",,,,,,," in place of the
|
60
|
+
# BOUNDING_BOX.
|
61
|
+
# Four sample rows:
|
62
|
+
# TRAIN,gs://folder/image1.png,car,0.1,0.1,,,0.3,0.3,,
|
63
|
+
# TRAIN,gs://folder/image1.png,bike,.7,.6,,,.8,.9,,
|
64
|
+
# UNASSIGNED,gs://folder/im2.png,car,0.1,0.1,0.2,0.1,0.2,0.3,0.1,0.3
|
65
|
+
# TEST,gs://folder/im3.png,,,,,,,,,
|
66
|
+
#
|
67
|
+
# * For Video Classification:
|
68
|
+
# CSV file(s) with each line in format:
|
69
|
+
# ML_USE,GCS_FILE_PATH
|
70
|
+
# where ML_USE VALIDATE value should not be used. The GCS_FILE_PATH
|
71
|
+
# should lead to another .csv file which describes examples that have
|
72
|
+
# given ML_USE, using the following row format:
|
73
|
+
# GCS_FILE_PATH,(LABEL,TIME_SEGMENT_START,TIME_SEGMENT_END | ,,)
|
74
|
+
# Here GCS_FILE_PATH leads to a video of up to 50GB in size and up
|
75
|
+
# to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI.
|
76
|
+
# TIME_SEGMENT_START and TIME_SEGMENT_END must be within the
|
77
|
+
# length of the video, and end has to be after the start. Any segment
|
78
|
+
# of a video which has one or more labels on it, is considered a
|
79
|
+
# hard negative for all other labels. Any segment with no labels on
|
80
|
+
# it is considered to be unknown. If a whole video is unknown, then
|
81
|
+
# it shuold be mentioned just once with ",," in place of LABEL,
|
82
|
+
# TIME_SEGMENT_START,TIME_SEGMENT_END.
|
83
|
+
# Sample top level CSV file:
|
84
|
+
# TRAIN,gs://folder/train_videos.csv
|
85
|
+
# TEST,gs://folder/test_videos.csv
|
86
|
+
# UNASSIGNED,gs://folder/other_videos.csv
|
87
|
+
# Sample rows of a CSV file for a particular ML_USE:
|
88
|
+
# gs://folder/video1.avi,car,120,180.000021
|
89
|
+
# gs://folder/video1.avi,bike,150,180.000021
|
90
|
+
# gs://folder/vid2.avi,car,0,60.5
|
91
|
+
# gs://folder/vid3.avi,,,
|
92
|
+
#
|
93
|
+
# * For Video Object Tracking:
|
94
|
+
# CSV file(s) with each line in format:
|
95
|
+
# ML_USE,GCS_FILE_PATH
|
96
|
+
# where ML_USE VALIDATE value should not be used. The GCS_FILE_PATH
|
97
|
+
# should lead to another .csv file which describes examples that have
|
98
|
+
# given ML_USE, using one of the following row format:
|
99
|
+
# GCS_FILE_PATH,LABEL,[INSTANCE_ID],TIMESTAMP,BOUNDING_BOX
|
100
|
+
# or
|
101
|
+
# GCS_FILE_PATH,,,,,,,,,,
|
102
|
+
# Here GCS_FILE_PATH leads to a video of up to 50GB in size and up
|
103
|
+
# to 3h duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI.
|
104
|
+
# Providing INSTANCE_IDs can help to obtain a better model. When
|
105
|
+
# a specific labeled entity leaves the video frame, and shows up
|
106
|
+
# afterwards it is not required, albeit preferable, that the same
|
107
|
+
# INSTANCE_ID is given to it.
|
108
|
+
# TIMESTAMP must be within the length of the video, the
|
109
|
+
# BOUNDING_BOX is assumed to be drawn on the closest video's frame
|
110
|
+
# to the TIMESTAMP. Any mentioned by the TIMESTAMP frame is expected
|
111
|
+
# to be exhaustively labeled and no more than 500 BOUNDING_BOX-es per
|
112
|
+
# frame are allowed. If a whole video is unknown, then it should be
|
113
|
+
# mentioned just once with ",,,,,,,,,," in place of LABEL,
|
114
|
+
# [INSTANCE_ID],TIMESTAMP,BOUNDING_BOX.
|
115
|
+
# Sample top level CSV file:
|
116
|
+
# TRAIN,gs://folder/train_videos.csv
|
117
|
+
# TEST,gs://folder/test_videos.csv
|
118
|
+
# UNASSIGNED,gs://folder/other_videos.csv
|
119
|
+
# Seven sample rows of a CSV file for a particular ML_USE:
|
120
|
+
# gs://folder/video1.avi,car,1,12.10,0.8,0.8,0.9,0.8,0.9,0.9,0.8,0.9
|
121
|
+
# gs://folder/video1.avi,car,1,12.90,0.4,0.8,0.5,0.8,0.5,0.9,0.4,0.9
|
122
|
+
# gs://folder/video1.avi,car,2,12.10,.4,.2,.5,.2,.5,.3,.4,.3
|
123
|
+
# gs://folder/video1.avi,car,2,12.90,.8,.2,,,.9,.3,,
|
124
|
+
# gs://folder/video1.avi,bike,,12.50,.45,.45,,,.55,.55,,
|
125
|
+
# gs://folder/video2.avi,car,1,0,.1,.9,,,.9,.1,,
|
126
|
+
# gs://folder/video2.avi,,,,,,,,,,,
|
127
|
+
# * For Text Extraction:
|
128
|
+
# CSV file(s) with each line in format:
|
129
|
+
# ML_USE,GCS_FILE_PATH
|
130
|
+
# GCS_FILE_PATH leads to a .JSONL (i.e. JSON Lines) file which either
|
131
|
+
# imports text in-line or as documents.
|
132
|
+
# The in-line .JSONL file contains, per line, a proto that wraps a
|
133
|
+
# TextSnippet proto (in json representation) followed by one or
|
134
|
+
# more AnnotationPayload protos (called annotations), which have
|
135
|
+
# display_name and text_extraction detail populated.
|
136
|
+
# The given text is expected to be annotated exhaustively, e.g. if
|
137
|
+
# you look for animals and text contains "dolphin" that is not
|
138
|
+
# labeled, then "dolphin" will be assumed to not be an animal. Any
|
139
|
+
# given text snippet content must have 30,000 characters or less,
|
140
|
+
# and also be UTF-8 NFC encoded (ASCII already is). The document .JSONL file contains, per line, a proto that wraps a
|
141
|
+
# Document proto with input_config set. Only PDF documents are
|
142
|
+
# supported now, and each document may be up to 2MB large.
|
143
|
+
# Currently annotations on documents cannot be specified at import.
|
144
|
+
# Any given .JSONL file must be 100MB or smaller.
|
145
|
+
# Three sample CSV rows:
|
146
|
+
# TRAIN,gs://folder/file1.jsonl
|
147
|
+
# VALIDATE,gs://folder/file2.jsonl
|
148
|
+
# TEST,gs://folder/file3.jsonl
|
149
|
+
# Sample in-line JSON Lines file for entity extraction (presented here
|
150
|
+
# with artificial line breaks, but the only actual line break is
|
151
|
+
# denoted by \n).:
|
152
|
+
# {
|
153
|
+
# "text_snippet": {
|
154
|
+
# "content": "dog car cat"
|
155
|
+
# } "annotations": [
|
156
|
+
# {
|
157
|
+
# "display_name": "animal",
|
158
|
+
# "text_extraction": {
|
159
|
+
# "text_segment": {"start_offset": 0, "end_offset": 3}
|
160
|
+
# }
|
161
|
+
# },
|
162
|
+
# {
|
163
|
+
# "display_name": "vehicle",
|
164
|
+
# "text_extraction": {
|
165
|
+
# "text_segment": {"start_offset": 4, "end_offset": 7}
|
166
|
+
# }
|
167
|
+
# },
|
168
|
+
# {
|
169
|
+
# "display_name": "animal",
|
170
|
+
# "text_extraction": {
|
171
|
+
# "text_segment": {"start_offset": 8, "end_offset": 11}
|
172
|
+
# }
|
173
|
+
# },
|
174
|
+
# ],
|
175
|
+
# }\n
|
176
|
+
# {
|
177
|
+
# "text_snippet": {
|
178
|
+
# "content": "This dog is good."
|
179
|
+
# },
|
180
|
+
# "annotations": [
|
181
|
+
# {
|
182
|
+
# "display_name": "animal",
|
183
|
+
# "text_extraction": {
|
184
|
+
# "text_segment": {"start_offset": 5, "end_offset": 8}
|
185
|
+
# }
|
186
|
+
# }
|
187
|
+
# ]
|
188
|
+
# }
|
189
|
+
# Sample document JSON Lines file (presented here with artificial line
|
190
|
+
# breaks, but the only actual line break is denoted by \n).:
|
191
|
+
# {
|
192
|
+
# "document": {
|
193
|
+
# "input_config": {
|
194
|
+
# "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ]
|
195
|
+
# }
|
196
|
+
# }
|
197
|
+
# }
|
198
|
+
# }\n
|
199
|
+
# {
|
200
|
+
# "document": {
|
201
|
+
# "input_config": {
|
202
|
+
# "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ]
|
203
|
+
# }
|
204
|
+
# }
|
205
|
+
# }
|
206
|
+
# }
|
207
|
+
#
|
208
|
+
# * For Text Classification:
|
209
|
+
# CSV file(s) with each line in format:
|
210
|
+
# ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),LABEL,LABEL,...
|
211
|
+
# TEXT_SNIPPET and GCS_FILE_PATH are distinguished by a pattern. If
|
212
|
+
# the column content is a valid gcs file path, i.e. prefixed by
|
213
|
+
# "gs://", it will be treated as a GCS_FILE_PATH, else if the content
|
214
|
+
# is enclosed within double quotes (""), it will
|
215
|
+
# be treated as a TEXT_SNIPPET. In the GCS_FILE_PATH case, the path
|
216
|
+
# must lead to a .txt file with UTF-8 encoding, e.g.
|
217
|
+
# "gs://folder/content.txt", and the content in it will be extracted
|
218
|
+
# as a text snippet. In TEXT_SNIPPET case, the column content
|
219
|
+
# excluding quotes will be treated as to be imported text snippet. In
|
220
|
+
# both cases, the text snippet/file size must be within 128kB.
|
221
|
+
# Maximum 100 unique labels are allowed per CSV row.
|
222
|
+
# Four sample rows:
|
223
|
+
# TRAIN,"They have bad food and very rude",RudeService,BadFood
|
224
|
+
# TRAIN,gs://folder/content.txt,SlowService
|
225
|
+
# TEST,"Typically always bad service there.",RudeService
|
226
|
+
# VALIDATE,"Stomach ache to go.",BadFood
|
227
|
+
#
|
228
|
+
# * For Text Sentiment:
|
229
|
+
# CSV file(s) with each line in format:
|
230
|
+
# ML_USE,(TEXT_SNIPPET | GCS_FILE_PATH),SENTIMENT
|
231
|
+
# TEXT_SNIPPET and GCS_FILE_PATH are distinguished by a pattern. If
|
232
|
+
# the column content is a valid gcs file path, i.e. prefixed by
|
233
|
+
# "gs://", it will be treated as a GCS_FILE_PATH, otherwise it will
|
234
|
+
# be treated as a TEXT_SNIPPET. In the GCS_FILE_PATH case, the path
|
235
|
+
# must lead to a .txt file with UTF-8 encoding, e.g.
|
236
|
+
# "gs://folder/content.txt", and the content in it will be extracted
|
237
|
+
# as a text snippet. In TEXT_SNIPPET case, the column content itself
|
238
|
+
# will be treated as to be imported text snippet. In both cases, the
|
239
|
+
# text snippet must be up to 500 characters long.
|
240
|
+
# Four sample rows:
|
241
|
+
# TRAIN,"@freewrytin God is way too good for Claritin",2
|
242
|
+
# TRAIN,"I need Claritin so bad",3
|
243
|
+
# TEST,"Thank god for Claritin.",4
|
244
|
+
# VALIDATE,gs://folder/content.txt,2
|
245
|
+
#
|
246
|
+
# * For Tables:
|
247
|
+
# Either
|
248
|
+
# {Google::Cloud::AutoML::V1beta1::InputConfig#gcs_source gcs_source} or
|
249
|
+
#
|
250
|
+
# {Google::Cloud::AutoML::V1beta1::InputConfig#bigquery_source bigquery_source}
|
251
|
+
# can be used. All inputs will be concatenated into a single
|
252
|
+
#
|
253
|
+
# {Google::Cloud::AutoML::V1beta1::TablesDatasetMetadata#primary_table_name primary_table}
|
254
|
+
# For gcs_source:
|
255
|
+
# CSV file(s), where the first row of the first file is the header,
|
256
|
+
# containing unique column names. If the first row of a subsequent
|
257
|
+
# file is the same as the header, then it is also treated as a
|
258
|
+
# header. All other rows contain values for the corresponding
|
259
|
+
# columns.
|
260
|
+
# Each .CSV file by itself must be 10GB or smaller, and their total
|
261
|
+
# size must be 100GB or smaller.
|
262
|
+
# First three sample rows of a CSV file:
|
263
|
+
# "Id","First Name","Last Name","Dob","Addresses"
|
264
|
+
#
|
265
|
+
# "1","John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
|
266
|
+
#
|
267
|
+
# "2","Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
|
268
|
+
# For bigquery_source:
|
269
|
+
# An URI of a BigQuery table. The user data size of the BigQuery
|
270
|
+
# table must be 100GB or smaller.
|
271
|
+
# An imported table must have between 2 and 1,000 columns, inclusive,
|
272
|
+
# and between 1000 and 100,000,000 rows, inclusive. There are at most 5
|
273
|
+
# import data running in parallel.
|
274
|
+
#
|
275
|
+
# Definitions:
|
276
|
+
# ML_USE = "TRAIN" | "VALIDATE" | "TEST" | "UNASSIGNED"
|
277
|
+
# Describes how the given example (file) should be used for model
|
278
|
+
# training. "UNASSIGNED" can be used when user has no preference.
|
279
|
+
# GCS_FILE_PATH = A path to file on GCS, e.g. "gs://folder/image1.png".
|
280
|
+
# LABEL = A display name of an object on an image, video etc., e.g. "dog".
|
281
|
+
# Must be up to 32 characters long and can consist only of ASCII
|
282
|
+
# Latin letters A-Z and a-z, underscores(_), and ASCII digits 0-9.
|
283
|
+
# For each label an AnnotationSpec is created which display_name
|
284
|
+
# becomes the label; AnnotationSpecs are given back in predictions.
|
285
|
+
# INSTANCE_ID = A positive integer that identifies a specific instance of a
|
286
|
+
# labeled entity on an example. Used e.g. to track two cars on
|
287
|
+
# a video while being able to tell apart which one is which.
|
288
|
+
# BOUNDING_BOX = VERTEX,VERTEX,VERTEX,VERTEX | VERTEX,,,VERTEX,,
|
289
|
+
# A rectangle parallel to the frame of the example (image,
|
290
|
+
# video). If 4 vertices are given they are connected by edges
|
291
|
+
# in the order provided, if 2 are given they are recognized
|
292
|
+
# as diagonally opposite vertices of the rectangle.
|
293
|
+
# VERTEX = COORDINATE,COORDINATE
|
294
|
+
# First coordinate is horizontal (x), the second is vertical (y).
|
295
|
+
# COORDINATE = A float in 0 to 1 range, relative to total length of
|
296
|
+
# image or video in given dimension. For fractions the
|
297
|
+
# leading non-decimal 0 can be omitted (i.e. 0.3 = .3).
|
298
|
+
# Point 0,0 is in top left.
|
299
|
+
# TIME_SEGMENT_START = TIME_OFFSET
|
300
|
+
# Expresses a beginning, inclusive, of a time segment
|
301
|
+
# within an example that has a time dimension
|
302
|
+
# (e.g. video).
|
303
|
+
# TIME_SEGMENT_END = TIME_OFFSET
|
304
|
+
# Expresses an end, exclusive, of a time segment within
|
305
|
+
# an example that has a time dimension (e.g. video).
|
306
|
+
# TIME_OFFSET = A number of seconds as measured from the start of an
|
307
|
+
# example (e.g. video). Fractions are allowed, up to a
|
308
|
+
# microsecond precision. "inf" is allowed, and it means the end
|
309
|
+
# of the example.
|
310
|
+
# TEXT_SNIPPET = A content of a text snippet, UTF-8 encoded, enclosed within
|
311
|
+
# double quotes ("").
|
312
|
+
# SENTIMENT = An integer between 0 and
|
313
|
+
# Dataset.text_sentiment_dataset_metadata.sentiment_max
|
314
|
+
# (inclusive). Describes the ordinal of the sentiment - higher
|
315
|
+
# value means a more positive sentiment. All the values are
|
316
|
+
# completely relative, i.e. neither 0 needs to mean a negative or
|
317
|
+
# neutral sentiment nor sentiment_max needs to mean a positive one
|
318
|
+
# * it is just required that 0 is the least positive sentiment
|
319
|
+
# in the data, and sentiment_max is the most positive one.
|
320
|
+
# The SENTIMENT shouldn't be confused with "score" or "magnitude"
|
321
|
+
# from the previous Natural Language Sentiment Analysis API.
|
322
|
+
# All SENTIMENT values between 0 and sentiment_max must be
|
323
|
+
# represented in the imported data. On prediction the same 0 to
|
324
|
+
# sentiment_max range will be used. The difference between
|
325
|
+
# neighboring sentiment values needs not to be uniform, e.g. 1 and
|
326
|
+
# 2 may be similar whereas the difference between 2 and 3 may be
|
327
|
+
# huge.
|
328
|
+
#
|
329
|
+
# Errors:
|
330
|
+
# If any of the provided CSV files can't be parsed or if more than certain
|
331
|
+
# percent of CSV rows cannot be processed then the operation fails and
|
332
|
+
# nothing is imported. Regardless of overall success or failure the per-row
|
333
|
+
# failures, up to a certain count cap, will be listed in
|
334
|
+
# Operation.metadata.partial_failures.
|
335
|
+
# @!attribute [rw] gcs_source
|
336
|
+
# @return [Google::Cloud::AutoML::V1beta1::GcsSource]
|
337
|
+
# The Google Cloud Storage location for the input content.
|
338
|
+
# In ImportData, the gcs_source points to a csv with structure described in
|
339
|
+
# the comment.
|
340
|
+
# @!attribute [rw] bigquery_source
|
341
|
+
# @return [Google::Cloud::AutoML::V1beta1::BigQuerySource]
|
342
|
+
# The BigQuery location for the input content.
|
343
|
+
# @!attribute [rw] params
|
344
|
+
# @return [Hash{String => String}]
|
345
|
+
# Additional domain-specific parameters describing the semantic of the
|
346
|
+
# imported data, any string must be up to 25000
|
347
|
+
# characters long.
|
348
|
+
#
|
349
|
+
# * For Tables:
|
350
|
+
# `schema_inference_version` - (integer) Required. The version of the
|
351
|
+
# algorithm that should be used for the initial inference of the
|
352
|
+
# schema (columns' DataTypes) of the table the data is being imported
|
353
|
+
# into. Allowed values: "1".
|
354
|
+
class InputConfig; end
|
355
|
+
|
356
|
+
# Input configuration for BatchPredict Action.
|
357
|
+
#
|
358
|
+
# The format of input depends on the ML problem of the model used for
|
359
|
+
# prediction. As input source the
|
360
|
+
# {Google::Cloud::AutoML::V1beta1::InputConfig#gcs_source gcs_source}
|
361
|
+
# is expected, unless specified otherwise.
|
362
|
+
#
|
363
|
+
# The formats are represented in EBNF with commas being literal and with
|
364
|
+
# non-terminal symbols defined near the end of this comment. The formats
|
365
|
+
# are:
|
366
|
+
# * For Video Classification:
|
367
|
+
# CSV file(s) with each line in format:
|
368
|
+
# GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END
|
369
|
+
# GCS_FILE_PATH leads to video of up to 50GB in size and up to 3h
|
370
|
+
# duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI.
|
371
|
+
# TIME_SEGMENT_START and TIME_SEGMENT_END must be within the
|
372
|
+
# length of the video, and end has to be after the start.
|
373
|
+
# Three sample rows:
|
374
|
+
# gs://folder/video1.mp4,10,40
|
375
|
+
# gs://folder/video1.mp4,20,60
|
376
|
+
# gs://folder/vid2.mov,0,inf
|
377
|
+
#
|
378
|
+
# * For Video Object Tracking:
|
379
|
+
# CSV file(s) with each line in format:
|
380
|
+
# GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END
|
381
|
+
# GCS_FILE_PATH leads to video of up to 50GB in size and up to 3h
|
382
|
+
# duration. Supported extensions: .MOV, .MPEG4, .MP4, .AVI.
|
383
|
+
# TIME_SEGMENT_START and TIME_SEGMENT_END must be within the
|
384
|
+
# length of the video, and end has to be after the start.
|
385
|
+
# Three sample rows:
|
386
|
+
# gs://folder/video1.mp4,10,240
|
387
|
+
# gs://folder/video1.mp4,300,360
|
388
|
+
# gs://folder/vid2.mov,0,inf
|
389
|
+
# * For Text Extraction
|
390
|
+
# .JSONL (i.e. JSON Lines) file(s) which either provide text in-line or
|
391
|
+
# as documents (for a single BatchPredict call only one of the these
|
392
|
+
# formats may be used).
|
393
|
+
# The in-line .JSONL file(s) contain per line a proto that
|
394
|
+
# wraps a temporary user-assigned TextSnippet ID (string up to 2000
|
395
|
+
# characters long) called "id", a TextSnippet proto (in
|
396
|
+
# json representation) and zero or more TextFeature protos. Any given
|
397
|
+
# text snippet content must have 30,000 characters or less, and also
|
398
|
+
# be UTF-8 NFC encoded (ASCII already is). The IDs provided should be
|
399
|
+
# unique.
|
400
|
+
# The document .JSONL file(s) contain, per line, a proto that wraps a
|
401
|
+
# Document proto with input_config set. Only PDF documents are
|
402
|
+
# supported now, and each document must be up to 2MB large.
|
403
|
+
# Any given .JSONL file must be 100MB or smaller, and no more than 20
|
404
|
+
# files may be given.
|
405
|
+
# Sample in-line JSON Lines file (presented here with artificial line
|
406
|
+
# breaks, but the only actual line break is denoted by \n):
|
407
|
+
# {
|
408
|
+
# "id": "my_first_id",
|
409
|
+
# "text_snippet": { "content": "dog car cat"},
|
410
|
+
# "text_features": [
|
411
|
+
# {
|
412
|
+
# "text_segment": {"start_offset": 4, "end_offset": 6},
|
413
|
+
# "structural_type": PARAGRAPH,
|
414
|
+
# "bounding_poly": {
|
415
|
+
# "normalized_vertices": [
|
416
|
+
# {"x": 0.1, "y": 0.1},
|
417
|
+
# {"x": 0.1, "y": 0.3},
|
418
|
+
# {"x": 0.3, "y": 0.3},
|
419
|
+
# {"x": 0.3, "y": 0.1},
|
420
|
+
# ]
|
421
|
+
# },
|
422
|
+
# }
|
423
|
+
# ],
|
424
|
+
# }\n
|
425
|
+
# {
|
426
|
+
# "id": "2",
|
427
|
+
# "text_snippet": {
|
428
|
+
# "content": "An elaborate content",
|
429
|
+
# "mime_type": "text/plain"
|
430
|
+
# }
|
431
|
+
# }
|
432
|
+
# Sample document JSON Lines file (presented here with artificial line
|
433
|
+
# breaks, but the only actual line break is denoted by \n).:
|
434
|
+
# {
|
435
|
+
# "document": {
|
436
|
+
# "input_config": {
|
437
|
+
# "gcs_source": { "input_uris": [ "gs://folder/document1.pdf" ]
|
438
|
+
# }
|
439
|
+
# }
|
440
|
+
# }
|
441
|
+
# }\n
|
442
|
+
# {
|
443
|
+
# "document": {
|
444
|
+
# "input_config": {
|
445
|
+
# "gcs_source": { "input_uris": [ "gs://folder/document2.pdf" ]
|
446
|
+
# }
|
447
|
+
# }
|
448
|
+
# }
|
449
|
+
# }
|
450
|
+
#
|
451
|
+
# * For Tables:
|
452
|
+
# Either
|
453
|
+
# {Google::Cloud::AutoML::V1beta1::InputConfig#gcs_source gcs_source} or
|
454
|
+
#
|
455
|
+
# {Google::Cloud::AutoML::V1beta1::InputConfig#bigquery_source bigquery_source}.
|
456
|
+
# GCS case:
|
457
|
+
# CSV file(s), each by itself 10GB or smaller and total size must be
|
458
|
+
# 100GB or smaller, where first file must have a header containing
|
459
|
+
# column names. If the first row of a subsequent file is the same as
|
460
|
+
# the header, then it is also treated as a header. All other rows
|
461
|
+
# contain values for the corresponding columns. For all
|
462
|
+
# CLASSIFICATION and REGRESSION
|
463
|
+
#
|
464
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#prediction_type prediction_type-s}:
|
465
|
+
# The column names must contain the model's
|
466
|
+
#
|
467
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#input_feature_column_specs input_feature_column_specs'}
|
468
|
+
#
|
469
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name-s}
|
470
|
+
# (order doesn't matter). The columns corresponding to the model's
|
471
|
+
# input feature column specs must contain values compatible with
|
472
|
+
# the column spec's data types. Prediction on all the rows, i.e.
|
473
|
+
# the CSV lines, will be attempted. First three sample rows of a
|
474
|
+
# CSV file:
|
475
|
+
# "First Name","Last Name","Dob","Addresses"
|
476
|
+
#
|
477
|
+
# "John","Doe","1968-01-22","[{"status":"current","address":"123_First_Avenue","city":"Seattle","state":"WA","zip":"11111","numberOfYears":"1"},{"status":"previous","address":"456_Main_Street","city":"Portland","state":"OR","zip":"22222","numberOfYears":"5"}]"
|
478
|
+
#
|
479
|
+
# "Jane","Doe","1980-10-16","[{"status":"current","address":"789_Any_Avenue","city":"Albany","state":"NY","zip":"33333","numberOfYears":"2"},{"status":"previous","address":"321_Main_Street","city":"Hoboken","state":"NJ","zip":"44444","numberOfYears":"3"}]}
|
480
|
+
# For FORECASTING
|
481
|
+
#
|
482
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#prediction_type prediction_type}:
|
483
|
+
# The column names must contain the union of the model's
|
484
|
+
#
|
485
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#input_feature_column_specs input_feature_column_specs'}
|
486
|
+
#
|
487
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name-s}
|
488
|
+
# and
|
489
|
+
#
|
490
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#target_column_spec target_column_specs'}
|
491
|
+
#
|
492
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name}
|
493
|
+
# (order doesn't matter), with values compatible with these column
|
494
|
+
# specs data types, except as specified below.
|
495
|
+
# The input rows must contain not only the to-be-predicted rows
|
496
|
+
# but also the historical data rows, even if they would be
|
497
|
+
# identical as the ones on which the model has been trained.
|
498
|
+
# The historical rows must have non-NULL target column
|
499
|
+
# values. The to-be-predicted rows must have NULL values in the
|
500
|
+
# target column and all columns having
|
501
|
+
#
|
502
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec::ForecastingMetadata::ColumnType::KEY TIME_SERIES_AVAILABLE_PAST_ONLY}
|
503
|
+
# type, regardless if these columns are
|
504
|
+
# {Google::Cloud::AutoML::V1beta1::DataType#nullable nullable}.
|
505
|
+
# Prediction only on the to-be-predicted rows will be attempted.
|
506
|
+
# First four sample rows of a CSV file:
|
507
|
+
#
|
508
|
+
# "Year","City","OlympicsThatYear","Population","WaterUsedGigaGallons"
|
509
|
+
# "2000","NYC","true","8008278","452.7"
|
510
|
+
# "2001","NYC","false","8024963","432.2"
|
511
|
+
# "2002","NYC","true","",""
|
512
|
+
# BigQuery case:
|
513
|
+
# An URI of a BigQuery table. The user data size of the BigQuery
|
514
|
+
# table must be 100GB or smaller.
|
515
|
+
# For all CLASSIFICATION and REGRESSION
|
516
|
+
#
|
517
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#prediction_type prediction_type-s}:
|
518
|
+
# The column names must contain the model's
|
519
|
+
#
|
520
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#input_feature_column_specs input_feature_column_specs'}
|
521
|
+
#
|
522
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name-s}
|
523
|
+
# (order doesn't matter). The columns corresponding to the model's
|
524
|
+
# input feature column specs must contain values compatible with
|
525
|
+
# the column spec's data types. Prediction on all the rows of the
|
526
|
+
# table will be attempted.
|
527
|
+
# For FORECASTING
|
528
|
+
#
|
529
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#prediction_type prediction_type}:
|
530
|
+
# The column names must contain the union of the model's
|
531
|
+
#
|
532
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#input_feature_column_specs input_feature_column_specs'}
|
533
|
+
#
|
534
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name-s}
|
535
|
+
# and
|
536
|
+
#
|
537
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#target_column_spec target_column_specs'}
|
538
|
+
#
|
539
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name}
|
540
|
+
# (order doesn't matter), with values compatible with these column
|
541
|
+
# specs data types, except as specified below.
|
542
|
+
# The table's rows must contain not only the to-be-predicted rows
|
543
|
+
# but also the historical data rows, even if they would be
|
544
|
+
# identical as the ones on which the model has been trained.
|
545
|
+
# The historical rows must have non-NULL target column values.
|
546
|
+
# The to-be-predicted rows must have NULL values in the
|
547
|
+
# target column and all columns having
|
548
|
+
#
|
549
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec::ForecastingMetadata::ColumnType::KEY TIME_SERIES_AVAILABLE_PAST_ONLY}
|
550
|
+
# type, regardless if these columns are
|
551
|
+
# {Google::Cloud::AutoML::V1beta1::DataType#nullable nullable}.
|
552
|
+
# Prediction only on the to-be-predicted rows will be attempted.
|
553
|
+
#
|
554
|
+
# Definitions:
|
555
|
+
# GCS_FILE_PATH = A path to file on GCS, e.g. "gs://folder/video.avi".
|
556
|
+
# TIME_SEGMENT_START = TIME_OFFSET
|
557
|
+
# Expresses a beginning, inclusive, of a time segment
|
558
|
+
# within an
|
559
|
+
# example that has a time dimension (e.g. video).
|
560
|
+
# TIME_SEGMENT_END = TIME_OFFSET
|
561
|
+
# Expresses an end, exclusive, of a time segment within
|
562
|
+
# an example that has a time dimension (e.g. video).
|
563
|
+
# TIME_OFFSET = A number of seconds as measured from the start of an
|
564
|
+
# example (e.g. video). Fractions are allowed, up to a
|
565
|
+
# microsecond precision. "inf" is allowed and it means the end
|
566
|
+
# of the example.
|
567
|
+
#
|
568
|
+
# Errors:
|
569
|
+
# If any of the provided CSV files can't be parsed or if more than certain
|
570
|
+
# percent of CSV rows cannot be processed then the operation fails and
|
571
|
+
# prediction does not happen. Regardless of overall success or failure the
|
572
|
+
# per-row failures, up to a certain count cap, will be listed in
|
573
|
+
# Operation.metadata.partial_failures.
|
574
|
+
# @!attribute [rw] gcs_source
|
575
|
+
# @return [Google::Cloud::AutoML::V1beta1::GcsSource]
|
576
|
+
# The Google Cloud Storage location for the input content.
|
577
|
+
# @!attribute [rw] bigquery_source
|
578
|
+
# @return [Google::Cloud::AutoML::V1beta1::BigQuerySource]
|
579
|
+
# The BigQuery location for the input content.
|
580
|
+
class BatchPredictInputConfig; end
|
581
|
+
|
582
|
+
# Input configuration of a {Google::Cloud::AutoML::V1beta1::Document Document}.
|
583
|
+
# @!attribute [rw] gcs_source
|
584
|
+
# @return [Google::Cloud::AutoML::V1beta1::GcsSource]
|
585
|
+
# The Google Cloud Storage location of the document file. Only a single path
|
586
|
+
# should be given.
|
587
|
+
# Max supported size: 512MB.
|
588
|
+
# Supported extensions: .PDF.
|
589
|
+
class DocumentInputConfig; end
|
590
|
+
|
591
|
+
# * For Translation:
|
592
|
+
# CSV file `translation.csv`, with each line in format:
|
593
|
+
# ML_USE,GCS_FILE_PATH
|
594
|
+
# GCS_FILE_PATH leads to a .TSV file which describes examples that have
|
595
|
+
# given ML_USE, using the following row format per line:
|
596
|
+
# TEXT_SNIPPET (in source language) \t TEXT_SNIPPET (in target
|
597
|
+
# language)
|
598
|
+
#
|
599
|
+
# * For Tables:
|
600
|
+
# Output depends on whether the dataset was imported from GCS or
|
601
|
+
# BigQuery.
|
602
|
+
# GCS case:
|
603
|
+
#
|
604
|
+
# {Google::Cloud::AutoML::V1beta1::OutputConfig#gcs_destination gcs_destination}
|
605
|
+
# must be set. Exported are CSV file(s) `tables_1.csv`,
|
606
|
+
# `tables_2.csv`,...,`tables_N.csv` with each having as header line
|
607
|
+
# the table's column names, and all other lines contain values for
|
608
|
+
# the header columns.
|
609
|
+
# BigQuery case:
|
610
|
+
#
|
611
|
+
# {Google::Cloud::AutoML::V1beta1::OutputConfig#bigquery_destination bigquery_destination}
|
612
|
+
# pointing to a BigQuery project must be set. In the given project a
|
613
|
+
# new dataset will be created with name
|
614
|
+
#
|
615
|
+
# `export_data_<automl-dataset-display-name>_<timestamp-of-export-call>`
|
616
|
+
# where <automl-dataset-display-name> will be made
|
617
|
+
# BigQuery-dataset-name compatible (e.g. most special characters will
|
618
|
+
# become underscores), and timestamp will be in
|
619
|
+
# YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In that
|
620
|
+
# dataset a new table called `primary_table` will be created, and
|
621
|
+
# filled with precisely the same data as this obtained on import.
|
622
|
+
# @!attribute [rw] gcs_destination
|
623
|
+
# @return [Google::Cloud::AutoML::V1beta1::GcsDestination]
|
624
|
+
# The Google Cloud Storage location where the output is to be written to.
|
625
|
+
# For Image Object Detection, Text Extraction, Video Classification and
|
626
|
+
# Tables, in the given directory a new directory will be created with name:
|
627
|
+
# export_data-<dataset-display-name>-<timestamp-of-export-call> where
|
628
|
+
# timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export
|
629
|
+
# output will be written into that directory.
|
630
|
+
# @!attribute [rw] bigquery_destination
|
631
|
+
# @return [Google::Cloud::AutoML::V1beta1::BigQueryDestination]
|
632
|
+
# The BigQuery location where the output is to be written to.
|
633
|
+
class OutputConfig; end
|
634
|
+
|
635
|
+
# Output configuration for BatchPredict Action.
|
636
|
+
#
|
637
|
+
# As destination the
|
638
|
+
#
|
639
|
+
# {Google::Cloud::AutoML::V1beta1::BatchPredictOutputConfig#gcs_destination gcs_destination}
|
640
|
+
# must be set unless specified otherwise for a domain. If gcs_destination is
|
641
|
+
# set then in the given directory a new directory will be created. Its name
|
642
|
+
# will be
|
643
|
+
# "prediction-<model-display-name>-<timestamp-of-prediction-call>",
|
644
|
+
# where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents
|
645
|
+
# of it depends on the ML problem the predictions are made for.
|
646
|
+
# * For Video Classification:
|
647
|
+
# In the created directory a video_classification.csv file, and a .JSON
|
648
|
+
# file per each video classification requested in the input (i.e. each
|
649
|
+
# line in given CSV(s)), will be created.
|
650
|
+
#
|
651
|
+
# The format of video_classification.csv is:
|
652
|
+
#
|
653
|
+
# GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS
|
654
|
+
# where:
|
655
|
+
# GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1
|
656
|
+
# the prediction input lines (i.e. video_classification.csv has
|
657
|
+
# precisely the same number of lines as the prediction input had.)
|
658
|
+
# JSON_FILE_NAME = Name of .JSON file in the output directory, which
|
659
|
+
# contains prediction responses for the video time segment.
|
660
|
+
# STATUS = "OK" if prediction completed successfully, or an error code
|
661
|
+
# with message otherwise. If STATUS is not "OK" then the .JSON file
|
662
|
+
# for that line may not exist or be empty.
|
663
|
+
#
|
664
|
+
# Each .JSON file, assuming STATUS is "OK", will contain a list of
|
665
|
+
# AnnotationPayload protos in JSON format, which are the predictions
|
666
|
+
# for the video time segment the file is assigned to in the
|
667
|
+
# video_classification.csv. All AnnotationPayload protos will have
|
668
|
+
# video_classification field set, and will be sorted by
|
669
|
+
# video_classification.type field (note that the returned types are
|
670
|
+
# governed by `classifaction_types` parameter in
|
671
|
+
# {PredictService::BatchPredictRequest#params}).
|
672
|
+
#
|
673
|
+
# * For Video Object Tracking:
|
674
|
+
# In the created directory a video_object_tracking.csv file will be
|
675
|
+
# created, and multiple files video_object_trackinng_1.json,
|
676
|
+
# video_object_trackinng_2.json,..., video_object_trackinng_N.json,
|
677
|
+
# where N is the number of requests in the input (i.e. the number of
|
678
|
+
# lines in given CSV(s)).
|
679
|
+
#
|
680
|
+
# The format of video_object_tracking.csv is:
|
681
|
+
#
|
682
|
+
# GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS
|
683
|
+
# where:
|
684
|
+
# GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1
|
685
|
+
# the prediction input lines (i.e. video_object_tracking.csv has
|
686
|
+
# precisely the same number of lines as the prediction input had.)
|
687
|
+
# JSON_FILE_NAME = Name of .JSON file in the output directory, which
|
688
|
+
# contains prediction responses for the video time segment.
|
689
|
+
# STATUS = "OK" if prediction completed successfully, or an error
|
690
|
+
# code with message otherwise. If STATUS is not "OK" then the .JSON
|
691
|
+
# file for that line may not exist or be empty.
|
692
|
+
#
|
693
|
+
# Each .JSON file, assuming STATUS is "OK", will contain a list of
|
694
|
+
# AnnotationPayload protos in JSON format, which are the predictions
|
695
|
+
# for each frame of the video time segment the file is assigned to in
|
696
|
+
# video_object_tracking.csv. All AnnotationPayload protos will have
|
697
|
+
# video_object_tracking field set.
|
698
|
+
# * For Text Extraction:
|
699
|
+
# In the created directory files `text_extraction_1.jsonl`,
|
700
|
+
# `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl`
|
701
|
+
# will be created, where N may be 1, and depends on the
|
702
|
+
# total number of inputs and annotations found.
|
703
|
+
# The contents of these .JSONL file(s) depend on whether the input
|
704
|
+
# used inline text, or documents.
|
705
|
+
# If input was inline, then each .JSONL file will contain, per line,
|
706
|
+
# a JSON representation of a proto that wraps given in request text
|
707
|
+
# snippet's "id" : "<id_value>" followed by a list of zero or more
|
708
|
+
# AnnotationPayload protos (called annotations), which have
|
709
|
+
# text_extraction detail populated. A single text snippet will be
|
710
|
+
# listed only once with all its annotations, and its annotations will
|
711
|
+
# never be split across files.
|
712
|
+
# If input used documents, then each .JSONL file will contain, per
|
713
|
+
# line, a JSON representation of a proto that wraps given in request
|
714
|
+
# document proto, followed by its OCR-ed representation in the form
|
715
|
+
# of a text snippet, finally followed by a list of zero or more
|
716
|
+
# AnnotationPayload protos (called annotations), which have
|
717
|
+
# text_extraction detail populated and refer, via their indices, to
|
718
|
+
# the OCR-ed text snippet. A single document (and its text snippet)
|
719
|
+
# will be listed only once with all its annotations, and its
|
720
|
+
# annotations will never be split across files.
|
721
|
+
# If prediction for any text snippet failed (partially or completely),
|
722
|
+
# then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
|
723
|
+
# `errors_N.jsonl` files will be created (N depends on total number of
|
724
|
+
# failed predictions). These files will have a JSON representation of a
|
725
|
+
# proto that wraps either the "id" : "<id_value>" (in case of inline)
|
726
|
+
# or the document proto (in case of document) but here followed by
|
727
|
+
# exactly one
|
728
|
+
#
|
729
|
+
# [`google.rpc.Status`](https:
|
730
|
+
# //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
|
731
|
+
# containing only `code` and `message`.
|
732
|
+
#
|
733
|
+
# * For Tables:
|
734
|
+
# Output depends on whether
|
735
|
+
#
|
736
|
+
# {Google::Cloud::AutoML::V1beta1::BatchPredictOutputConfig#gcs_destination gcs_destination}
|
737
|
+
# or
|
738
|
+
#
|
739
|
+
# {Google::Cloud::AutoML::V1beta1::BatchPredictOutputConfig#bigquery_destination bigquery_destination}
|
740
|
+
# is set (either is allowed).
|
741
|
+
# GCS case:
|
742
|
+
# In the created directory files `tables_1.csv`, `tables_2.csv`,...,
|
743
|
+
# `tables_N.csv` will be created, where N may be 1, and depends on
|
744
|
+
# the total number of the successfully predicted rows.
|
745
|
+
# For all CLASSIFICATION
|
746
|
+
#
|
747
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#prediction_type prediction_type-s}:
|
748
|
+
# Each .csv file will contain a header, listing all columns'
|
749
|
+
#
|
750
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name-s}
|
751
|
+
# given on input followed by M target column names in the format of
|
752
|
+
#
|
753
|
+
# "<{Google::Cloud::AutoML::V1beta1::TablesModelMetadata#target_column_spec target_column_specs}
|
754
|
+
#
|
755
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name}>_<target
|
756
|
+
# value>_score" where M is the number of distinct target values,
|
757
|
+
# i.e. number of distinct values in the target column of the table
|
758
|
+
# used to train the model. Subsequent lines will contain the
|
759
|
+
# respective values of successfully predicted rows, with the last,
|
760
|
+
# i.e. the target, columns having the corresponding prediction
|
761
|
+
# {Google::Cloud::AutoML::V1beta1::TablesAnnotation#score scores}.
|
762
|
+
# For REGRESSION and FORECASTING
|
763
|
+
#
|
764
|
+
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#prediction_type prediction_type-s}:
|
765
|
+
# Each .csv file will contain a header, listing all columns'
|
766
|
+
# {Google::Cloud::AutoML::V1beta1::Display_name display_name-s} given
|
767
|
+
# on input followed by the predicted target column with name in the
|
768
|
+
# format of
|
769
|
+
#
|
770
|
+
# "predicted_<{Google::Cloud::AutoML::V1beta1::TablesModelMetadata#target_column_spec target_column_specs}
|
771
|
+
#
|
772
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name}>"
|
773
|
+
# Subsequent lines will contain the respective values of
|
774
|
+
# successfully predicted rows, with the last, i.e. the target,
|
775
|
+
# column having the predicted target value.
|
776
|
+
# If prediction for any rows failed, then an additional
|
777
|
+
# `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be
|
778
|
+
# created (N depends on total number of failed rows). These files
|
779
|
+
# will have analogous format as `tables_*.csv`, but always with a
|
780
|
+
# single target column having
|
781
|
+
#
|
782
|
+
# [`google.rpc.Status`](https:
|
783
|
+
# //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
|
784
|
+
# represented as a JSON string, and containing only `code` and
|
785
|
+
# `message`.
|
786
|
+
# BigQuery case:
|
787
|
+
#
|
788
|
+
# {Google::Cloud::AutoML::V1beta1::OutputConfig#bigquery_destination bigquery_destination}
|
789
|
+
# pointing to a BigQuery project must be set. In the given project a
|
790
|
+
# new dataset will be created with name
|
791
|
+
# `prediction_<model-display-name>_<timestamp-of-prediction-call>`
|
792
|
+
# where <model-display-name> will be made
|
793
|
+
# BigQuery-dataset-name compatible (e.g. most special characters will
|
794
|
+
# become underscores), and timestamp will be in
|
795
|
+
# YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset
|
796
|
+
# two tables will be created, `predictions`, and `errors`.
|
797
|
+
# The `predictions` table's column names will be the input columns'
|
798
|
+
#
|
799
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name-s}
|
800
|
+
# followed by the target column with name in the format of
|
801
|
+
#
|
802
|
+
# "predicted_<{Google::Cloud::AutoML::V1beta1::TablesModelMetadata#target_column_spec target_column_specs}
|
803
|
+
#
|
804
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name}>"
|
805
|
+
# The input feature columns will contain the respective values of
|
806
|
+
# successfully predicted rows, with the target column having an
|
807
|
+
# ARRAY of
|
808
|
+
#
|
809
|
+
# {Google::Cloud::AutoML::V1beta1::AnnotationPayload AnnotationPayloads},
|
810
|
+
# represented as STRUCT-s, containing
|
811
|
+
# {Google::Cloud::AutoML::V1beta1::TablesAnnotation TablesAnnotation}.
|
812
|
+
# The `errors` table contains rows for which the prediction has
|
813
|
+
# failed, it has analogous input columns while the target column name
|
814
|
+
# is in the format of
|
815
|
+
#
|
816
|
+
# "errors_<{Google::Cloud::AutoML::V1beta1::TablesModelMetadata#target_column_spec target_column_specs}
|
817
|
+
#
|
818
|
+
# {Google::Cloud::AutoML::V1beta1::ColumnSpec#display_name display_name}>",
|
819
|
+
# and as a value has
|
820
|
+
#
|
821
|
+
# [`google.rpc.Status`](https:
|
822
|
+
# //github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
|
823
|
+
# represented as a STRUCT, and containing only `code` and `message`.
|
824
|
+
# @!attribute [rw] gcs_destination
|
825
|
+
# @return [Google::Cloud::AutoML::V1beta1::GcsDestination]
|
826
|
+
# The Google Cloud Storage location of the directory where the output is to
|
827
|
+
# be written to.
|
828
|
+
# @!attribute [rw] bigquery_destination
|
829
|
+
# @return [Google::Cloud::AutoML::V1beta1::BigQueryDestination]
|
830
|
+
# The BigQuery location where the output is to be written to.
|
831
|
+
class BatchPredictOutputConfig; end
|
832
|
+
|
833
|
+
# Output configuration for ModelExport Action.
|
834
|
+
# @!attribute [rw] gcs_destination
|
835
|
+
# @return [Google::Cloud::AutoML::V1beta1::GcsDestination]
|
836
|
+
# The Google Cloud Storage location where the model is to be written to.
|
837
|
+
# This location may only be set for the following model formats:
|
838
|
+
# "tflite", "edgetpu_tflite", "core_ml", "docker".
|
839
|
+
#
|
840
|
+
# Under the directory given as the destination a new one with name
|
841
|
+
# "model-export-<model-display-name>-<timestamp-of-export-call>",
|
842
|
+
# where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
|
843
|
+
# will be created. Inside the model and any of its supporting files
|
844
|
+
# will be written.
|
845
|
+
# @!attribute [rw] gcr_destination
|
846
|
+
# @return [Google::Cloud::AutoML::V1beta1::GcrDestination]
|
847
|
+
# The GCR location where model image is to be pushed to. This location
|
848
|
+
# may only be set for the following model formats:
|
849
|
+
# "docker".
|
850
|
+
#
|
851
|
+
# The model image will be created under the given URI.
|
852
|
+
# @!attribute [rw] model_format
|
853
|
+
# @return [String]
|
854
|
+
# The format in which the model must be exported. The available, and default,
|
855
|
+
# formats depend on the problem and model type (if given problem and type
|
856
|
+
# combination doesn't have a format listed, it means its models are not
|
857
|
+
# exportable):
|
858
|
+
#
|
859
|
+
# * For Image Classification mobile-low-latency-1, mobile-versatile-1,
|
860
|
+
# mobile-high-accuracy-1:
|
861
|
+
# "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".
|
862
|
+
#
|
863
|
+
# * For Image Classification mobile-core-ml-low-latency-1,
|
864
|
+
# mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1:
|
865
|
+
# "core_ml" (default).
|
866
|
+
# Formats description:
|
867
|
+
#
|
868
|
+
# * tflite - Used for Android mobile devices.
|
869
|
+
# * edgetpu_tflite - Used for [Edge TPU](https://cloud.google.com/edge-tpu/)
|
870
|
+
# devices.
|
871
|
+
# * tf_saved_model - A tensorflow model in SavedModel format.
|
872
|
+
# * docker - Used for Docker containers. Use the params field to customize
|
873
|
+
# the container. The container is verified to work correctly on
|
874
|
+
# ubuntu 16.04 operating system. See more at
|
875
|
+
# [containers quickstart](https://cloud.google.com/vision/automl/docs/containers-gcs-quickstart)
|
876
|
+
# * core_ml - Used for iOS mobile devices.
|
877
|
+
# @!attribute [rw] params
|
878
|
+
# @return [Hash{String => String}]
|
879
|
+
# Additional model-type and format specific parameters describing the
|
880
|
+
# requirements for the to be exported model files, any string must be up to
|
881
|
+
# 25000 characters long.
|
882
|
+
#
|
883
|
+
# * For `docker` format:
|
884
|
+
# `cpu_architecture` - (string) "x86_64" (default).
|
885
|
+
# `gpu_architecture` - (string) "none" (default), "nvidia".
|
886
|
+
class ModelExportOutputConfig; end
|
887
|
+
|
888
|
+
# Output configuration for ExportEvaluatedExamples Action. Note that this call
|
889
|
+
# is available only for 30 days since the moment the model was evaluated.
|
890
|
+
# The output depends on the domain, as follows (note that only examples from
|
891
|
+
# the TEST set are exported):
|
892
|
+
#
|
893
|
+
# * For Tables:
|
894
|
+
#
|
895
|
+
# {Google::Cloud::AutoML::V1beta1::OutputConfig#bigquery_destination bigquery_destination}
|
896
|
+
# pointing to a BigQuery project must be set. In the given project a
|
897
|
+
# new dataset will be created with name
|
898
|
+
#
|
899
|
+
# `export_evaluated_examples_<model-display-name>_<timestamp-of-export-call>`
|
900
|
+
# where <model-display-name> will be made BigQuery-dataset-name
|
901
|
+
# compatible (e.g. most special characters will become underscores),
|
902
|
+
# and timestamp will be in YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601"
|
903
|
+
# format. In the dataset an `evaluated_examples` table will be
|
904
|
+
# created. It will have all the same columns as the
|
905
|
+
#
|
906
|
+
# {Google::Cloud::AutoML::V1beta1::TablesDatasetMetadata#primary_table_spec_id primary_table}
|
907
|
+
# of the
|
908
|
+
# {Google::Cloud::AutoML::V1beta1::Model#dataset_id dataset} from which
|
909
|
+
# the model was created, as they were at the moment of model's
|
910
|
+
# evaluation (this includes the target column with its ground
|
911
|
+
# truth), followed by a column called "predicted_<target_column>". That
|
912
|
+
# last column will contain the model's prediction result for each
|
913
|
+
# respective row, given as ARRAY of
|
914
|
+
# {Google::Cloud::AutoML::V1beta1::AnnotationPayload AnnotationPayloads},
|
915
|
+
# represented as STRUCT-s, containing
|
916
|
+
# {Google::Cloud::AutoML::V1beta1::TablesAnnotation TablesAnnotation}.
|
917
|
+
# @!attribute [rw] bigquery_destination
|
918
|
+
# @return [Google::Cloud::AutoML::V1beta1::BigQueryDestination]
|
919
|
+
# The BigQuery location where the output is to be written to.
|
920
|
+
class ExportEvaluatedExamplesOutputConfig; end
|
921
|
+
|
922
|
+
# The Google Cloud Storage location for the input content.
|
923
|
+
# @!attribute [rw] input_uris
|
924
|
+
# @return [Array<String>]
|
925
|
+
# Required. Google Cloud Storage URIs to input files, up to 2000 characters
|
926
|
+
# long. Accepted forms:
|
927
|
+
# * Full object path, e.g. gs://bucket/directory/object.csv
|
928
|
+
class GcsSource; end
|
929
|
+
|
930
|
+
# The BigQuery location for the input content.
|
931
|
+
# @!attribute [rw] input_uri
|
932
|
+
# @return [String]
|
933
|
+
# Required. BigQuery URI to a table, up to 2000 characters long.
|
934
|
+
# Accepted forms:
|
935
|
+
# * BigQuery path e.g. bq://projectId.bqDatasetId.bqTableId
|
936
|
+
class BigQuerySource; end
|
937
|
+
|
938
|
+
# The Google Cloud Storage location where the output is to be written to.
|
939
|
+
# @!attribute [rw] output_uri_prefix
|
940
|
+
# @return [String]
|
941
|
+
# Required. Google Cloud Storage URI to output directory, up to 2000
|
942
|
+
# characters long.
|
943
|
+
# Accepted forms:
|
944
|
+
# * Prefix path: gs://bucket/directory
|
945
|
+
# The requesting user must have write permission to the bucket.
|
946
|
+
# The directory is created if it doesn't exist.
|
947
|
+
class GcsDestination; end
|
948
|
+
|
949
|
+
# The BigQuery location for the output content.
|
950
|
+
# @!attribute [rw] output_uri
|
951
|
+
# @return [String]
|
952
|
+
# Required. BigQuery URI to a project, up to 2000 characters long.
|
953
|
+
# Accepted forms:
|
954
|
+
# * BigQuery path e.g. bq://projectId
|
955
|
+
class BigQueryDestination; end
|
956
|
+
|
957
|
+
# The GCR location where the image must be pushed to.
|
958
|
+
# @!attribute [rw] output_uri
|
959
|
+
# @return [String]
|
960
|
+
# Required. Google Contained Registry URI of the new image, up to 2000
|
961
|
+
# characters long. See
|
962
|
+
#
|
963
|
+
# https:
|
964
|
+
# //cloud.google.com/container-registry/do
|
965
|
+
# // cs/pushing-and-pulling#pushing_an_image_to_a_registry
|
966
|
+
# Accepted forms:
|
967
|
+
# * [HOSTNAME]/[PROJECT-ID]/[IMAGE]
|
968
|
+
# * [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG]
|
969
|
+
#
|
970
|
+
# The requesting user must have permission to push images the project.
|
971
|
+
class GcrDestination; end
|
972
|
+
end
|
973
|
+
end
|
974
|
+
end
|
975
|
+
end
|