google-cloud-automl-v1 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 +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +71 -0
- data/lib/google/cloud/automl/v1/annotation_payload_pb.rb +37 -0
- data/lib/google/cloud/automl/v1/annotation_spec_pb.rb +26 -0
- data/lib/google/cloud/automl/v1/automl/client.rb +1851 -0
- data/lib/google/cloud/automl/v1/automl/credentials.rb +51 -0
- data/lib/google/cloud/automl/v1/automl/operations.rb +564 -0
- data/lib/google/cloud/automl/v1/automl/paths.rb +130 -0
- data/lib/google/cloud/automl/v1/automl.rb +63 -0
- data/lib/google/cloud/automl/v1/classification_pb.rb +65 -0
- data/lib/google/cloud/automl/v1/data_items_pb.rb +87 -0
- data/lib/google/cloud/automl/v1/dataset_pb.rb +42 -0
- data/lib/google/cloud/automl/v1/detection_pb.rb +45 -0
- data/lib/google/cloud/automl/v1/geometry_pb.rb +28 -0
- data/lib/google/cloud/automl/v1/image_pb.rb +57 -0
- data/lib/google/cloud/automl/v1/io_pb.rb +65 -0
- data/lib/google/cloud/automl/v1/model_evaluation_pb.rb +41 -0
- data/lib/google/cloud/automl/v1/model_pb.rb +49 -0
- data/lib/google/cloud/automl/v1/operations_pb.rb +88 -0
- data/lib/google/cloud/automl/v1/prediction_service/client.rb +634 -0
- data/lib/google/cloud/automl/v1/prediction_service/credentials.rb +51 -0
- data/lib/google/cloud/automl/v1/prediction_service/operations.rb +564 -0
- data/lib/google/cloud/automl/v1/prediction_service/paths.rb +52 -0
- data/lib/google/cloud/automl/v1/prediction_service.rb +53 -0
- data/lib/google/cloud/automl/v1/prediction_service_pb.rb +50 -0
- data/lib/google/cloud/automl/v1/prediction_service_services_pb.rb +103 -0
- data/lib/google/cloud/automl/v1/service_pb.rb +139 -0
- data/lib/google/cloud/automl/v1/service_services_pb.rb +137 -0
- data/lib/google/cloud/automl/v1/text_extraction_pb.rb +39 -0
- data/lib/google/cloud/automl/v1/text_pb.rb +41 -0
- data/lib/google/cloud/automl/v1/text_segment_pb.rb +25 -0
- data/lib/google/cloud/automl/v1/text_sentiment_pb.rb +35 -0
- data/lib/google/cloud/automl/v1/translation_pb.rb +41 -0
- data/lib/google/cloud/automl/v1/version.rb +28 -0
- data/lib/google/cloud/automl/v1.rb +36 -0
- data/lib/google/cloud/common_resources_pb.rb +15 -0
- data/lib/google-cloud-automl-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/cloud/automl/v1/annotation_payload.rb +60 -0
- data/proto_docs/google/cloud/automl/v1/annotation_spec.rb +46 -0
- data/proto_docs/google/cloud/automl/v1/classification.rb +191 -0
- data/proto_docs/google/cloud/automl/v1/data_items.rb +197 -0
- data/proto_docs/google/cloud/automl/v1/dataset.rb +94 -0
- data/proto_docs/google/cloud/automl/v1/detection.rb +97 -0
- data/proto_docs/google/cloud/automl/v1/geometry.rb +53 -0
- data/proto_docs/google/cloud/automl/v1/image.rb +217 -0
- data/proto_docs/google/cloud/automl/v1/io.rb +1402 -0
- data/proto_docs/google/cloud/automl/v1/model.rb +109 -0
- data/proto_docs/google/cloud/automl/v1/model_evaluation.rb +94 -0
- data/proto_docs/google/cloud/automl/v1/operations.rb +180 -0
- data/proto_docs/google/cloud/automl/v1/prediction_service.rb +271 -0
- data/proto_docs/google/cloud/automl/v1/service.rb +322 -0
- data/proto_docs/google/cloud/automl/v1/text.rb +76 -0
- data/proto_docs/google/cloud/automl/v1/text_extraction.rb +73 -0
- data/proto_docs/google/cloud/automl/v1/text_segment.rb +44 -0
- data/proto_docs/google/cloud/automl/v1/text_sentiment.rb +82 -0
- data/proto_docs/google/cloud/automl/v1/translation.rb +79 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +227 -0
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module AutoML
|
23
|
+
module V1
|
24
|
+
# Contains annotation information that is relevant to AutoML.
|
25
|
+
# @!attribute [rw] translation
|
26
|
+
# @return [Google::Cloud::AutoML::V1::TranslationAnnotation]
|
27
|
+
# Annotation details for translation.
|
28
|
+
# @!attribute [rw] classification
|
29
|
+
# @return [Google::Cloud::AutoML::V1::ClassificationAnnotation]
|
30
|
+
# Annotation details for content or image classification.
|
31
|
+
# @!attribute [rw] image_object_detection
|
32
|
+
# @return [Google::Cloud::AutoML::V1::ImageObjectDetectionAnnotation]
|
33
|
+
# Annotation details for image object detection.
|
34
|
+
# @!attribute [rw] text_extraction
|
35
|
+
# @return [Google::Cloud::AutoML::V1::TextExtractionAnnotation]
|
36
|
+
# Annotation details for text extraction.
|
37
|
+
# @!attribute [rw] text_sentiment
|
38
|
+
# @return [Google::Cloud::AutoML::V1::TextSentimentAnnotation]
|
39
|
+
# Annotation details for text sentiment.
|
40
|
+
# @!attribute [rw] annotation_spec_id
|
41
|
+
# @return [String]
|
42
|
+
# Output only . The resource ID of the annotation spec that
|
43
|
+
# this annotation pertains to. The annotation spec comes from either an
|
44
|
+
# ancestor dataset, or the dataset that was used to train the model in use.
|
45
|
+
# @!attribute [rw] display_name
|
46
|
+
# @return [String]
|
47
|
+
# Output only. The value of
|
48
|
+
# {Google::Cloud::AutoML::V1::AnnotationSpec#display_name display_name}
|
49
|
+
# when the model was trained. Because this field returns a value at model
|
50
|
+
# training time, for different models trained using the same dataset, the
|
51
|
+
# returned value could be different as model owner could update the
|
52
|
+
# `display_name` between any two model training.
|
53
|
+
class AnnotationPayload
|
54
|
+
include Google::Protobuf::MessageExts
|
55
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module AutoML
|
23
|
+
module V1
|
24
|
+
# A definition of an annotation spec.
|
25
|
+
# @!attribute [rw] name
|
26
|
+
# @return [String]
|
27
|
+
# Output only. Resource name of the annotation spec.
|
28
|
+
# Form:
|
29
|
+
#
|
30
|
+
# 'projects/\\{project_id}/locations/\\{location_id}/datasets/\\{dataset_id}/annotationSpecs/\\{annotation_spec_id}'
|
31
|
+
# @!attribute [rw] display_name
|
32
|
+
# @return [String]
|
33
|
+
# Required. The name of the annotation spec to show in the interface. The name can be
|
34
|
+
# up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
|
35
|
+
# @!attribute [rw] example_count
|
36
|
+
# @return [Integer]
|
37
|
+
# Output only. The number of examples in the parent dataset
|
38
|
+
# labeled by the annotation spec.
|
39
|
+
class AnnotationSpec
|
40
|
+
include Google::Protobuf::MessageExts
|
41
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,191 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module AutoML
|
23
|
+
module V1
|
24
|
+
# Contains annotation details specific to classification.
|
25
|
+
# @!attribute [rw] score
|
26
|
+
# @return [Float]
|
27
|
+
# Output only. A confidence estimate between 0.0 and 1.0. A higher value
|
28
|
+
# means greater confidence that the annotation is positive. If a user
|
29
|
+
# approves an annotation as negative or positive, the score value remains
|
30
|
+
# unchanged. If a user creates an annotation, the score is 0 for negative or
|
31
|
+
# 1 for positive.
|
32
|
+
class ClassificationAnnotation
|
33
|
+
include Google::Protobuf::MessageExts
|
34
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
35
|
+
end
|
36
|
+
|
37
|
+
# Model evaluation metrics for classification problems.
|
38
|
+
# Note: For Video Classification this metrics only describe quality of the
|
39
|
+
# Video Classification predictions of "segment_classification" type.
|
40
|
+
# @!attribute [rw] au_prc
|
41
|
+
# @return [Float]
|
42
|
+
# Output only. The Area Under Precision-Recall Curve metric. Micro-averaged
|
43
|
+
# for the overall evaluation.
|
44
|
+
# @!attribute [rw] au_roc
|
45
|
+
# @return [Float]
|
46
|
+
# Output only. The Area Under Receiver Operating Characteristic curve metric.
|
47
|
+
# Micro-averaged for the overall evaluation.
|
48
|
+
# @!attribute [rw] log_loss
|
49
|
+
# @return [Float]
|
50
|
+
# Output only. The Log Loss metric.
|
51
|
+
# @!attribute [rw] confidence_metrics_entry
|
52
|
+
# @return [Array<Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfidenceMetricsEntry>]
|
53
|
+
# Output only. Metrics for each confidence_threshold in
|
54
|
+
# 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and
|
55
|
+
# position_threshold = INT32_MAX_VALUE.
|
56
|
+
# ROC and precision-recall curves, and other aggregated metrics are derived
|
57
|
+
# from them. The confidence metrics entries may also be supplied for
|
58
|
+
# additional values of position_threshold, but from these no aggregated
|
59
|
+
# metrics are computed.
|
60
|
+
# @!attribute [rw] confusion_matrix
|
61
|
+
# @return [Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfusionMatrix]
|
62
|
+
# Output only. Confusion matrix of the evaluation.
|
63
|
+
# Only set for MULTICLASS classification problems where number
|
64
|
+
# of labels is no more than 10.
|
65
|
+
# Only set for model level evaluation, not for evaluation per label.
|
66
|
+
# @!attribute [rw] annotation_spec_id
|
67
|
+
# @return [Array<String>]
|
68
|
+
# Output only. The annotation spec ids used for this evaluation.
|
69
|
+
class ClassificationEvaluationMetrics
|
70
|
+
include Google::Protobuf::MessageExts
|
71
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
72
|
+
|
73
|
+
# Metrics for a single confidence threshold.
|
74
|
+
# @!attribute [rw] confidence_threshold
|
75
|
+
# @return [Float]
|
76
|
+
# Output only. Metrics are computed with an assumption that the model
|
77
|
+
# never returns predictions with score lower than this value.
|
78
|
+
# @!attribute [rw] position_threshold
|
79
|
+
# @return [Integer]
|
80
|
+
# Output only. Metrics are computed with an assumption that the model
|
81
|
+
# always returns at most this many predictions (ordered by their score,
|
82
|
+
# descendingly), but they all still need to meet the confidence_threshold.
|
83
|
+
# @!attribute [rw] recall
|
84
|
+
# @return [Float]
|
85
|
+
# Output only. Recall (True Positive Rate) for the given confidence
|
86
|
+
# threshold.
|
87
|
+
# @!attribute [rw] precision
|
88
|
+
# @return [Float]
|
89
|
+
# Output only. Precision for the given confidence threshold.
|
90
|
+
# @!attribute [rw] false_positive_rate
|
91
|
+
# @return [Float]
|
92
|
+
# Output only. False Positive Rate for the given confidence threshold.
|
93
|
+
# @!attribute [rw] f1_score
|
94
|
+
# @return [Float]
|
95
|
+
# Output only. The harmonic mean of recall and precision.
|
96
|
+
# @!attribute [rw] recall_at1
|
97
|
+
# @return [Float]
|
98
|
+
# Output only. The Recall (True Positive Rate) when only considering the
|
99
|
+
# label that has the highest prediction score and not below the confidence
|
100
|
+
# threshold for each example.
|
101
|
+
# @!attribute [rw] precision_at1
|
102
|
+
# @return [Float]
|
103
|
+
# Output only. The precision when only considering the label that has the
|
104
|
+
# highest prediction score and not below the confidence threshold for each
|
105
|
+
# example.
|
106
|
+
# @!attribute [rw] false_positive_rate_at1
|
107
|
+
# @return [Float]
|
108
|
+
# Output only. The False Positive Rate when only considering the label that
|
109
|
+
# has the highest prediction score and not below the confidence threshold
|
110
|
+
# for each example.
|
111
|
+
# @!attribute [rw] f1_score_at1
|
112
|
+
# @return [Float]
|
113
|
+
# Output only. The harmonic mean of {Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfidenceMetricsEntry#recall_at1 recall_at1} and {Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfidenceMetricsEntry#precision_at1 precision_at1}.
|
114
|
+
# @!attribute [rw] true_positive_count
|
115
|
+
# @return [Integer]
|
116
|
+
# Output only. The number of model created labels that match a ground truth
|
117
|
+
# label.
|
118
|
+
# @!attribute [rw] false_positive_count
|
119
|
+
# @return [Integer]
|
120
|
+
# Output only. The number of model created labels that do not match a
|
121
|
+
# ground truth label.
|
122
|
+
# @!attribute [rw] false_negative_count
|
123
|
+
# @return [Integer]
|
124
|
+
# Output only. The number of ground truth labels that are not matched
|
125
|
+
# by a model created label.
|
126
|
+
# @!attribute [rw] true_negative_count
|
127
|
+
# @return [Integer]
|
128
|
+
# Output only. The number of labels that were not created by the model,
|
129
|
+
# but if they would, they would not match a ground truth label.
|
130
|
+
class ConfidenceMetricsEntry
|
131
|
+
include Google::Protobuf::MessageExts
|
132
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
133
|
+
end
|
134
|
+
|
135
|
+
# Confusion matrix of the model running the classification.
|
136
|
+
# @!attribute [rw] annotation_spec_id
|
137
|
+
# @return [Array<String>]
|
138
|
+
# Output only. IDs of the annotation specs used in the confusion matrix.
|
139
|
+
# For Tables CLASSIFICATION
|
140
|
+
#
|
141
|
+
# [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
|
142
|
+
# only list of [annotation_spec_display_name-s][] is populated.
|
143
|
+
# @!attribute [rw] display_name
|
144
|
+
# @return [Array<String>]
|
145
|
+
# Output only. Display name of the annotation specs used in the confusion
|
146
|
+
# matrix, as they were at the moment of the evaluation. For Tables
|
147
|
+
# CLASSIFICATION
|
148
|
+
#
|
149
|
+
# [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
|
150
|
+
# distinct values of the target column at the moment of the model
|
151
|
+
# evaluation are populated here.
|
152
|
+
# @!attribute [rw] row
|
153
|
+
# @return [Array<Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfusionMatrix::Row>]
|
154
|
+
# Output only. Rows in the confusion matrix. The number of rows is equal to
|
155
|
+
# the size of `annotation_spec_id`.
|
156
|
+
# `row[i].example_count[j]` is the number of examples that have ground
|
157
|
+
# truth of the `annotation_spec_id[i]` and are predicted as
|
158
|
+
# `annotation_spec_id[j]` by the model being evaluated.
|
159
|
+
class ConfusionMatrix
|
160
|
+
include Google::Protobuf::MessageExts
|
161
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
162
|
+
|
163
|
+
# Output only. A row in the confusion matrix.
|
164
|
+
# @!attribute [rw] example_count
|
165
|
+
# @return [Array<Integer>]
|
166
|
+
# Output only. Value of the specific cell in the confusion matrix.
|
167
|
+
# The number of values each row has (i.e. the length of the row) is equal
|
168
|
+
# to the length of the `annotation_spec_id` field or, if that one is not
|
169
|
+
# populated, length of the {Google::Cloud::AutoML::V1::ClassificationEvaluationMetrics::ConfusionMatrix#display_name display_name} field.
|
170
|
+
class Row
|
171
|
+
include Google::Protobuf::MessageExts
|
172
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# Type of the classification problem.
|
178
|
+
module ClassificationType
|
179
|
+
# An un-set value of this enum.
|
180
|
+
CLASSIFICATION_TYPE_UNSPECIFIED = 0
|
181
|
+
|
182
|
+
# At most one label is allowed per example.
|
183
|
+
MULTICLASS = 1
|
184
|
+
|
185
|
+
# Multiple labels are allowed for one example.
|
186
|
+
MULTILABEL = 2
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
@@ -0,0 +1,197 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module AutoML
|
23
|
+
module V1
|
24
|
+
# A representation of an image.
|
25
|
+
# Only images up to 30MB in size are supported.
|
26
|
+
# @!attribute [rw] image_bytes
|
27
|
+
# @return [String]
|
28
|
+
# Image content represented as a stream of bytes.
|
29
|
+
# Note: As with all `bytes` fields, protobuffers use a pure binary
|
30
|
+
# representation, whereas JSON representations use base64.
|
31
|
+
# @!attribute [rw] thumbnail_uri
|
32
|
+
# @return [String]
|
33
|
+
# Output only. HTTP URI to the thumbnail image.
|
34
|
+
class Image
|
35
|
+
include Google::Protobuf::MessageExts
|
36
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
37
|
+
end
|
38
|
+
|
39
|
+
# A representation of a text snippet.
|
40
|
+
# @!attribute [rw] content
|
41
|
+
# @return [String]
|
42
|
+
# Required. The content of the text snippet as a string. Up to 250000
|
43
|
+
# characters long.
|
44
|
+
# @!attribute [rw] mime_type
|
45
|
+
# @return [String]
|
46
|
+
# Optional. The format of {Google::Cloud::AutoML::V1::TextSnippet#content content}. Currently the only two allowed
|
47
|
+
# values are "text/html" and "text/plain". If left blank, the format is
|
48
|
+
# automatically determined from the type of the uploaded {Google::Cloud::AutoML::V1::TextSnippet#content content}.
|
49
|
+
# @!attribute [rw] content_uri
|
50
|
+
# @return [String]
|
51
|
+
# Output only. HTTP URI where you can download the content.
|
52
|
+
class TextSnippet
|
53
|
+
include Google::Protobuf::MessageExts
|
54
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
55
|
+
end
|
56
|
+
|
57
|
+
# Message that describes dimension of a document.
|
58
|
+
# @!attribute [rw] unit
|
59
|
+
# @return [Google::Cloud::AutoML::V1::DocumentDimensions::DocumentDimensionUnit]
|
60
|
+
# Unit of the dimension.
|
61
|
+
# @!attribute [rw] width
|
62
|
+
# @return [Float]
|
63
|
+
# Width value of the document, works together with the unit.
|
64
|
+
# @!attribute [rw] height
|
65
|
+
# @return [Float]
|
66
|
+
# Height value of the document, works together with the unit.
|
67
|
+
class DocumentDimensions
|
68
|
+
include Google::Protobuf::MessageExts
|
69
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
70
|
+
|
71
|
+
# Unit of the document dimension.
|
72
|
+
module DocumentDimensionUnit
|
73
|
+
# Should not be used.
|
74
|
+
DOCUMENT_DIMENSION_UNIT_UNSPECIFIED = 0
|
75
|
+
|
76
|
+
# Document dimension is measured in inches.
|
77
|
+
INCH = 1
|
78
|
+
|
79
|
+
# Document dimension is measured in centimeters.
|
80
|
+
CENTIMETER = 2
|
81
|
+
|
82
|
+
# Document dimension is measured in points. 72 points = 1 inch.
|
83
|
+
POINT = 3
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# A structured text document e.g. a PDF.
|
88
|
+
# @!attribute [rw] input_config
|
89
|
+
# @return [Google::Cloud::AutoML::V1::DocumentInputConfig]
|
90
|
+
# An input config specifying the content of the document.
|
91
|
+
# @!attribute [rw] document_text
|
92
|
+
# @return [Google::Cloud::AutoML::V1::TextSnippet]
|
93
|
+
# The plain text version of this document.
|
94
|
+
# @!attribute [rw] layout
|
95
|
+
# @return [Array<Google::Cloud::AutoML::V1::Document::Layout>]
|
96
|
+
# Describes the layout of the document.
|
97
|
+
# Sorted by [page_number][].
|
98
|
+
# @!attribute [rw] document_dimensions
|
99
|
+
# @return [Google::Cloud::AutoML::V1::DocumentDimensions]
|
100
|
+
# The dimensions of the page in the document.
|
101
|
+
# @!attribute [rw] page_count
|
102
|
+
# @return [Integer]
|
103
|
+
# Number of pages in the document.
|
104
|
+
class Document
|
105
|
+
include Google::Protobuf::MessageExts
|
106
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
107
|
+
|
108
|
+
# Describes the layout information of a {Google::Cloud::AutoML::V1::Document::Layout#text_segment text_segment} in the document.
|
109
|
+
# @!attribute [rw] text_segment
|
110
|
+
# @return [Google::Cloud::AutoML::V1::TextSegment]
|
111
|
+
# Text Segment that represents a segment in
|
112
|
+
# [document_text][google.cloud.automl.v1p1beta.Document.document_text].
|
113
|
+
# @!attribute [rw] page_number
|
114
|
+
# @return [Integer]
|
115
|
+
# Page number of the {Google::Cloud::AutoML::V1::Document::Layout#text_segment text_segment} in the original document, starts
|
116
|
+
# from 1.
|
117
|
+
# @!attribute [rw] bounding_poly
|
118
|
+
# @return [Google::Cloud::AutoML::V1::BoundingPoly]
|
119
|
+
# The position of the {Google::Cloud::AutoML::V1::Document::Layout#text_segment text_segment} in the page.
|
120
|
+
# Contains exactly 4
|
121
|
+
#
|
122
|
+
# [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices]
|
123
|
+
# and they are connected by edges in the order provided, which will
|
124
|
+
# represent a rectangle parallel to the frame. The
|
125
|
+
# [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are
|
126
|
+
# relative to the page.
|
127
|
+
# Coordinates are based on top-left as point (0,0).
|
128
|
+
# @!attribute [rw] text_segment_type
|
129
|
+
# @return [Google::Cloud::AutoML::V1::Document::Layout::TextSegmentType]
|
130
|
+
# The type of the {Google::Cloud::AutoML::V1::Document::Layout#text_segment text_segment} in document.
|
131
|
+
class Layout
|
132
|
+
include Google::Protobuf::MessageExts
|
133
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
134
|
+
|
135
|
+
# The type of TextSegment in the context of the original document.
|
136
|
+
module TextSegmentType
|
137
|
+
# Should not be used.
|
138
|
+
TEXT_SEGMENT_TYPE_UNSPECIFIED = 0
|
139
|
+
|
140
|
+
# The text segment is a token. e.g. word.
|
141
|
+
TOKEN = 1
|
142
|
+
|
143
|
+
# The text segment is a paragraph.
|
144
|
+
PARAGRAPH = 2
|
145
|
+
|
146
|
+
# The text segment is a form field.
|
147
|
+
FORM_FIELD = 3
|
148
|
+
|
149
|
+
# The text segment is the name part of a form field. It will be treated
|
150
|
+
# as child of another FORM_FIELD TextSegment if its span is subspan of
|
151
|
+
# another TextSegment with type FORM_FIELD.
|
152
|
+
FORM_FIELD_NAME = 4
|
153
|
+
|
154
|
+
# The text segment is the text content part of a form field. It will be
|
155
|
+
# treated as child of another FORM_FIELD TextSegment if its span is
|
156
|
+
# subspan of another TextSegment with type FORM_FIELD.
|
157
|
+
FORM_FIELD_CONTENTS = 5
|
158
|
+
|
159
|
+
# The text segment is a whole table, including headers, and all rows.
|
160
|
+
TABLE = 6
|
161
|
+
|
162
|
+
# The text segment is a table's headers. It will be treated as child of
|
163
|
+
# another TABLE TextSegment if its span is subspan of another TextSegment
|
164
|
+
# with type TABLE.
|
165
|
+
TABLE_HEADER = 7
|
166
|
+
|
167
|
+
# The text segment is a row in table. It will be treated as child of
|
168
|
+
# another TABLE TextSegment if its span is subspan of another TextSegment
|
169
|
+
# with type TABLE.
|
170
|
+
TABLE_ROW = 8
|
171
|
+
|
172
|
+
# The text segment is a cell in table. It will be treated as child of
|
173
|
+
# another TABLE_ROW TextSegment if its span is subspan of another
|
174
|
+
# TextSegment with type TABLE_ROW.
|
175
|
+
TABLE_CELL = 9
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Example data used for training or prediction.
|
181
|
+
# @!attribute [rw] image
|
182
|
+
# @return [Google::Cloud::AutoML::V1::Image]
|
183
|
+
# Example image.
|
184
|
+
# @!attribute [rw] text_snippet
|
185
|
+
# @return [Google::Cloud::AutoML::V1::TextSnippet]
|
186
|
+
# Example text.
|
187
|
+
# @!attribute [rw] document
|
188
|
+
# @return [Google::Cloud::AutoML::V1::Document]
|
189
|
+
# Example document.
|
190
|
+
class ExamplePayload
|
191
|
+
include Google::Protobuf::MessageExts
|
192
|
+
extend Google::Protobuf::MessageExts::ClassMethods
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|