google-cloud-document_ai-v1 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/document_ai/v1/bindings_override.rb +118 -0
- data/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +470 -54
- data/lib/google/cloud/document_ai/v1/document_processor_service/operations.rb +12 -14
- data/lib/google/cloud/document_ai/v1/document_processor_service/paths.rb +23 -0
- data/lib/google/cloud/document_ai/v1/document_processor_service/rest/client.rb +1984 -0
- data/lib/google/cloud/document_ai/v1/document_processor_service/rest/operations.rb +820 -0
- data/lib/google/cloud/document_ai/v1/document_processor_service/rest/service_stub.rb +1373 -0
- data/lib/google/cloud/document_ai/v1/document_processor_service/rest.rb +57 -0
- data/lib/google/cloud/document_ai/v1/document_processor_service.rb +6 -0
- data/lib/google/cloud/document_ai/v1/rest.rb +38 -0
- data/lib/google/cloud/document_ai/v1/version.rb +1 -1
- data/lib/google/cloud/document_ai/v1.rb +5 -0
- data/lib/google/cloud/documentai/v1/document_pb.rb +1 -0
- data/lib/google/cloud/documentai/v1/document_processor_service_pb.rb +60 -0
- data/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb +11 -0
- data/lib/google/cloud/documentai/v1/evaluation_pb.rb +79 -0
- data/lib/google/cloud/documentai/v1/processor_pb.rb +2 -0
- data/proto_docs/google/cloud/documentai/v1/document.rb +16 -7
- data/proto_docs/google/cloud/documentai/v1/document_processor_service.rb +163 -0
- data/proto_docs/google/cloud/documentai/v1/document_schema.rb +14 -6
- data/proto_docs/google/cloud/documentai/v1/evaluation.rb +199 -0
- data/proto_docs/google/cloud/documentai/v1/processor.rb +3 -0
- metadata +19 -9
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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
|
+
require "gapic/rest"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/document_ai/v1/version"
|
24
|
+
require "google/cloud/document_ai/v1/bindings_override"
|
25
|
+
|
26
|
+
require "google/cloud/document_ai/v1/document_processor_service/credentials"
|
27
|
+
require "google/cloud/document_ai/v1/document_processor_service/paths"
|
28
|
+
require "google/cloud/document_ai/v1/document_processor_service/rest/operations"
|
29
|
+
require "google/cloud/document_ai/v1/document_processor_service/rest/client"
|
30
|
+
|
31
|
+
module Google
|
32
|
+
module Cloud
|
33
|
+
module DocumentAI
|
34
|
+
module V1
|
35
|
+
##
|
36
|
+
# Service to call Cloud DocumentAI to process documents according to the
|
37
|
+
# processor's definition. Processors are built using state-of-the-art Google
|
38
|
+
# AI such as natural language, computer vision, and translation to extract
|
39
|
+
# structured information from unstructured or semi-structured documents.
|
40
|
+
#
|
41
|
+
# To load this service and instantiate a REST client:
|
42
|
+
#
|
43
|
+
# require "google/cloud/document_ai/v1/document_processor_service/rest"
|
44
|
+
# client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
|
45
|
+
#
|
46
|
+
module DocumentProcessorService
|
47
|
+
# Client for the REST transport
|
48
|
+
module Rest
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
helper_path = ::File.join __dir__, "rest", "helpers.rb"
|
57
|
+
require "google/cloud/document_ai/v1/document_processor_service/rest/helpers" if ::File.file? helper_path
|
@@ -26,6 +26,7 @@ require "google/cloud/document_ai/v1/document_processor_service/credentials"
|
|
26
26
|
require "google/cloud/document_ai/v1/document_processor_service/paths"
|
27
27
|
require "google/cloud/document_ai/v1/document_processor_service/operations"
|
28
28
|
require "google/cloud/document_ai/v1/document_processor_service/client"
|
29
|
+
require "google/cloud/document_ai/v1/document_processor_service/rest"
|
29
30
|
|
30
31
|
module Google
|
31
32
|
module Cloud
|
@@ -42,6 +43,11 @@ module Google
|
|
42
43
|
# require "google/cloud/document_ai/v1/document_processor_service"
|
43
44
|
# client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new
|
44
45
|
#
|
46
|
+
# @example Load this service and instantiate a REST client
|
47
|
+
#
|
48
|
+
# require "google/cloud/document_ai/v1/document_processor_service/rest"
|
49
|
+
# client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
|
50
|
+
#
|
45
51
|
module DocumentProcessorService
|
46
52
|
end
|
47
53
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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
|
+
require "google/cloud/document_ai/v1/document_processor_service/rest"
|
20
|
+
require "google/cloud/document_ai/v1/bindings_override"
|
21
|
+
require "google/cloud/document_ai/v1/version"
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module DocumentAI
|
26
|
+
##
|
27
|
+
# To load just the REST part of this package, including all its services, and instantiate a REST client:
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
#
|
31
|
+
# require "google/cloud/document_ai/v1/rest"
|
32
|
+
# client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
|
33
|
+
#
|
34
|
+
module V1
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -30,6 +30,11 @@ module Google
|
|
30
30
|
# require "google/cloud/document_ai/v1"
|
31
31
|
# client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new
|
32
32
|
#
|
33
|
+
# @example Load this package, including all its services, and instantiate a REST client
|
34
|
+
#
|
35
|
+
# require "google/cloud/document_ai/v1"
|
36
|
+
# client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Rest::Client.new
|
37
|
+
#
|
33
38
|
module V1
|
34
39
|
end
|
35
40
|
end
|
@@ -10,10 +10,12 @@ require 'google/api/resource_pb'
|
|
10
10
|
require 'google/cloud/documentai/v1/document_pb'
|
11
11
|
require 'google/cloud/documentai/v1/document_io_pb'
|
12
12
|
require 'google/cloud/documentai/v1/document_schema_pb'
|
13
|
+
require 'google/cloud/documentai/v1/evaluation_pb'
|
13
14
|
require 'google/cloud/documentai/v1/operation_metadata_pb'
|
14
15
|
require 'google/cloud/documentai/v1/processor_pb'
|
15
16
|
require 'google/cloud/documentai/v1/processor_type_pb'
|
16
17
|
require 'google/longrunning/operations_pb'
|
18
|
+
require 'google/protobuf/empty_pb'
|
17
19
|
require 'google/protobuf/field_mask_pb'
|
18
20
|
require 'google/protobuf/timestamp_pb'
|
19
21
|
require 'google/rpc/status_pb'
|
@@ -174,6 +176,31 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
174
176
|
add_message "google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata" do
|
175
177
|
optional :common_metadata, :message, 1, "google.cloud.documentai.v1.CommonOperationMetadata"
|
176
178
|
end
|
179
|
+
add_message "google.cloud.documentai.v1.TrainProcessorVersionRequest" do
|
180
|
+
optional :parent, :string, 1
|
181
|
+
optional :processor_version, :message, 2, "google.cloud.documentai.v1.ProcessorVersion"
|
182
|
+
optional :document_schema, :message, 10, "google.cloud.documentai.v1.DocumentSchema"
|
183
|
+
optional :input_data, :message, 4, "google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData"
|
184
|
+
optional :base_processor_version, :string, 8
|
185
|
+
end
|
186
|
+
add_message "google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData" do
|
187
|
+
optional :training_documents, :message, 3, "google.cloud.documentai.v1.BatchDocumentsInputConfig"
|
188
|
+
optional :test_documents, :message, 4, "google.cloud.documentai.v1.BatchDocumentsInputConfig"
|
189
|
+
end
|
190
|
+
add_message "google.cloud.documentai.v1.TrainProcessorVersionResponse" do
|
191
|
+
optional :processor_version, :string, 1
|
192
|
+
end
|
193
|
+
add_message "google.cloud.documentai.v1.TrainProcessorVersionMetadata" do
|
194
|
+
optional :common_metadata, :message, 1, "google.cloud.documentai.v1.CommonOperationMetadata"
|
195
|
+
optional :training_dataset_validation, :message, 2, "google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation"
|
196
|
+
optional :test_dataset_validation, :message, 3, "google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation"
|
197
|
+
end
|
198
|
+
add_message "google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation" do
|
199
|
+
optional :document_error_count, :int32, 3
|
200
|
+
optional :dataset_error_count, :int32, 4
|
201
|
+
repeated :document_errors, :message, 1, "google.rpc.Status"
|
202
|
+
repeated :dataset_errors, :message, 2, "google.rpc.Status"
|
203
|
+
end
|
177
204
|
add_message "google.cloud.documentai.v1.ReviewDocumentRequest" do
|
178
205
|
optional :human_review_config, :string, 1
|
179
206
|
optional :enable_schema_validation, :bool, 3
|
@@ -201,6 +228,28 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
201
228
|
optional :common_metadata, :message, 5, "google.cloud.documentai.v1.CommonOperationMetadata"
|
202
229
|
optional :question_id, :string, 6
|
203
230
|
end
|
231
|
+
add_message "google.cloud.documentai.v1.EvaluateProcessorVersionRequest" do
|
232
|
+
optional :processor_version, :string, 1
|
233
|
+
optional :evaluation_documents, :message, 3, "google.cloud.documentai.v1.BatchDocumentsInputConfig"
|
234
|
+
end
|
235
|
+
add_message "google.cloud.documentai.v1.EvaluateProcessorVersionMetadata" do
|
236
|
+
optional :common_metadata, :message, 1, "google.cloud.documentai.v1.CommonOperationMetadata"
|
237
|
+
end
|
238
|
+
add_message "google.cloud.documentai.v1.EvaluateProcessorVersionResponse" do
|
239
|
+
optional :evaluation, :string, 2
|
240
|
+
end
|
241
|
+
add_message "google.cloud.documentai.v1.GetEvaluationRequest" do
|
242
|
+
optional :name, :string, 1
|
243
|
+
end
|
244
|
+
add_message "google.cloud.documentai.v1.ListEvaluationsRequest" do
|
245
|
+
optional :parent, :string, 1
|
246
|
+
optional :page_size, :int32, 2
|
247
|
+
optional :page_token, :string, 3
|
248
|
+
end
|
249
|
+
add_message "google.cloud.documentai.v1.ListEvaluationsResponse" do
|
250
|
+
repeated :evaluations, :message, 1, "google.cloud.documentai.v1.Evaluation"
|
251
|
+
optional :next_page_token, :string, 2
|
252
|
+
end
|
204
253
|
end
|
205
254
|
end
|
206
255
|
|
@@ -248,11 +297,22 @@ module Google
|
|
248
297
|
SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionRequest").msgclass
|
249
298
|
SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionResponse").msgclass
|
250
299
|
SetDefaultProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata").msgclass
|
300
|
+
TrainProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest").msgclass
|
301
|
+
TrainProcessorVersionRequest::InputData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionRequest.InputData").msgclass
|
302
|
+
TrainProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionResponse").msgclass
|
303
|
+
TrainProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionMetadata").msgclass
|
304
|
+
TrainProcessorVersionMetadata::DatasetValidation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.TrainProcessorVersionMetadata.DatasetValidation").msgclass
|
251
305
|
ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentRequest").msgclass
|
252
306
|
ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentRequest.Priority").enummodule
|
253
307
|
ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentResponse").msgclass
|
254
308
|
ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentResponse.State").enummodule
|
255
309
|
ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentOperationMetadata").msgclass
|
310
|
+
EvaluateProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionRequest").msgclass
|
311
|
+
EvaluateProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionMetadata").msgclass
|
312
|
+
EvaluateProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluateProcessorVersionResponse").msgclass
|
313
|
+
GetEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetEvaluationRequest").msgclass
|
314
|
+
ListEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListEvaluationsRequest").msgclass
|
315
|
+
ListEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListEvaluationsResponse").msgclass
|
256
316
|
end
|
257
317
|
end
|
258
318
|
end
|
@@ -52,6 +52,10 @@ module Google
|
|
52
52
|
rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorsResponse
|
53
53
|
# Gets a processor detail.
|
54
54
|
rpc :GetProcessor, ::Google::Cloud::DocumentAI::V1::GetProcessorRequest, ::Google::Cloud::DocumentAI::V1::Processor
|
55
|
+
# Trains a new processor version.
|
56
|
+
# Operation metadata is returned as
|
57
|
+
# cloud_documentai_core.TrainProcessorVersionMetadata.
|
58
|
+
rpc :TrainProcessorVersion, ::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest, ::Google::Longrunning::Operation
|
55
59
|
# Gets a processor version detail.
|
56
60
|
rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1::ProcessorVersion
|
57
61
|
# Lists all versions of a processor.
|
@@ -82,6 +86,13 @@ module Google
|
|
82
86
|
# Send a document for Human Review. The input document should be processed by
|
83
87
|
# the specified processor.
|
84
88
|
rpc :ReviewDocument, ::Google::Cloud::DocumentAI::V1::ReviewDocumentRequest, ::Google::Longrunning::Operation
|
89
|
+
# Evaluates a ProcessorVersion against annotated documents, producing an
|
90
|
+
# Evaluation.
|
91
|
+
rpc :EvaluateProcessorVersion, ::Google::Cloud::DocumentAI::V1::EvaluateProcessorVersionRequest, ::Google::Longrunning::Operation
|
92
|
+
# Retrieves a specific evaluation.
|
93
|
+
rpc :GetEvaluation, ::Google::Cloud::DocumentAI::V1::GetEvaluationRequest, ::Google::Cloud::DocumentAI::V1::Evaluation
|
94
|
+
# Retrieves a set of evaluations for a given processor version.
|
95
|
+
rpc :ListEvaluations, ::Google::Cloud::DocumentAI::V1::ListEvaluationsRequest, ::Google::Cloud::DocumentAI::V1::ListEvaluationsResponse
|
85
96
|
end
|
86
97
|
|
87
98
|
Stub = Service.rpc_stub_class
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/documentai/v1/evaluation.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/resource_pb'
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
8
|
+
|
9
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
|
+
add_file("google/cloud/documentai/v1/evaluation.proto", :syntax => :proto3) do
|
11
|
+
add_message "google.cloud.documentai.v1.EvaluationReference" do
|
12
|
+
optional :operation, :string, 1
|
13
|
+
optional :evaluation, :string, 2
|
14
|
+
optional :aggregate_metrics, :message, 4, "google.cloud.documentai.v1.Evaluation.Metrics"
|
15
|
+
optional :aggregate_metrics_exact, :message, 5, "google.cloud.documentai.v1.Evaluation.Metrics"
|
16
|
+
end
|
17
|
+
add_message "google.cloud.documentai.v1.Evaluation" do
|
18
|
+
optional :name, :string, 1
|
19
|
+
optional :create_time, :message, 2, "google.protobuf.Timestamp"
|
20
|
+
optional :document_counters, :message, 5, "google.cloud.documentai.v1.Evaluation.Counters"
|
21
|
+
optional :all_entities_metrics, :message, 3, "google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics"
|
22
|
+
map :entity_metrics, :string, :message, 4, "google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics"
|
23
|
+
optional :kms_key_name, :string, 6
|
24
|
+
optional :kms_key_version_name, :string, 7
|
25
|
+
end
|
26
|
+
add_message "google.cloud.documentai.v1.Evaluation.Counters" do
|
27
|
+
optional :input_documents_count, :int32, 1
|
28
|
+
optional :invalid_documents_count, :int32, 2
|
29
|
+
optional :failed_documents_count, :int32, 3
|
30
|
+
optional :evaluated_documents_count, :int32, 4
|
31
|
+
end
|
32
|
+
add_message "google.cloud.documentai.v1.Evaluation.Metrics" do
|
33
|
+
optional :precision, :float, 1
|
34
|
+
optional :recall, :float, 2
|
35
|
+
optional :f1_score, :float, 3
|
36
|
+
optional :predicted_occurrences_count, :int32, 4
|
37
|
+
optional :ground_truth_occurrences_count, :int32, 5
|
38
|
+
optional :predicted_document_count, :int32, 10
|
39
|
+
optional :ground_truth_document_count, :int32, 11
|
40
|
+
optional :true_positives_count, :int32, 6
|
41
|
+
optional :false_positives_count, :int32, 7
|
42
|
+
optional :false_negatives_count, :int32, 8
|
43
|
+
optional :total_documents_count, :int32, 9
|
44
|
+
end
|
45
|
+
add_message "google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics" do
|
46
|
+
optional :confidence_level, :float, 1
|
47
|
+
optional :metrics, :message, 2, "google.cloud.documentai.v1.Evaluation.Metrics"
|
48
|
+
end
|
49
|
+
add_message "google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics" do
|
50
|
+
repeated :confidence_level_metrics, :message, 1, "google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics"
|
51
|
+
repeated :confidence_level_metrics_exact, :message, 4, "google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics"
|
52
|
+
optional :auprc, :float, 2
|
53
|
+
optional :estimated_calibration_error, :float, 3
|
54
|
+
optional :auprc_exact, :float, 5
|
55
|
+
optional :estimated_calibration_error_exact, :float, 6
|
56
|
+
optional :metrics_type, :enum, 7, "google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType"
|
57
|
+
end
|
58
|
+
add_enum "google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType" do
|
59
|
+
value :METRICS_TYPE_UNSPECIFIED, 0
|
60
|
+
value :AGGREGATE, 1
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
module Google
|
66
|
+
module Cloud
|
67
|
+
module DocumentAI
|
68
|
+
module V1
|
69
|
+
EvaluationReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.EvaluationReference").msgclass
|
70
|
+
Evaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation").msgclass
|
71
|
+
Evaluation::Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.Counters").msgclass
|
72
|
+
Evaluation::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.Metrics").msgclass
|
73
|
+
Evaluation::ConfidenceLevelMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.ConfidenceLevelMetrics").msgclass
|
74
|
+
Evaluation::MultiConfidenceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics").msgclass
|
75
|
+
Evaluation::MultiConfidenceMetrics::MetricsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Evaluation.MultiConfidenceMetrics.MetricsType").enummodule
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -6,6 +6,7 @@ require 'google/protobuf'
|
|
6
6
|
require 'google/api/field_behavior_pb'
|
7
7
|
require 'google/api/resource_pb'
|
8
8
|
require 'google/cloud/documentai/v1/document_schema_pb'
|
9
|
+
require 'google/cloud/documentai/v1/evaluation_pb'
|
9
10
|
require 'google/protobuf/timestamp_pb'
|
10
11
|
|
11
12
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
@@ -16,6 +17,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
16
17
|
optional :document_schema, :message, 12, "google.cloud.documentai.v1.DocumentSchema"
|
17
18
|
optional :state, :enum, 6, "google.cloud.documentai.v1.ProcessorVersion.State"
|
18
19
|
optional :create_time, :message, 7, "google.protobuf.Timestamp"
|
20
|
+
optional :latest_evaluation, :message, 8, "google.cloud.documentai.v1.EvaluationReference"
|
19
21
|
optional :kms_key_name, :string, 9
|
20
22
|
optional :kms_key_version_name, :string, 10
|
21
23
|
optional :google_managed, :bool, 11
|
@@ -876,17 +876,24 @@ module Google
|
|
876
876
|
# Remove an element identified by `parent`.
|
877
877
|
REMOVE = 2
|
878
878
|
|
879
|
-
#
|
879
|
+
# Updates any fields within the given provenance scope of the message. It
|
880
|
+
# 'overwrites' the fields rather than replacing them. This is
|
881
|
+
# especially relevant when we just want to update a field value of an
|
882
|
+
# entity without also affecting all the child properties.
|
883
|
+
UPDATE = 7
|
884
|
+
|
885
|
+
# Currently unused. Replace an element identified by `parent`.
|
880
886
|
REPLACE = 3
|
881
887
|
|
882
|
-
# Request human review for the element identified by
|
888
|
+
# Deprecated. Request human review for the element identified by
|
889
|
+
# `parent`.
|
883
890
|
EVAL_REQUESTED = 4
|
884
891
|
|
885
|
-
# Element is reviewed and approved at human review,
|
886
|
-
# set to 1.0.
|
892
|
+
# Deprecated. Element is reviewed and approved at human review,
|
893
|
+
# confidence will be set to 1.0.
|
887
894
|
EVAL_APPROVED = 5
|
888
895
|
|
889
|
-
# Element is skipped in the validation process.
|
896
|
+
# Deprecated. Element is skipped in the validation process.
|
890
897
|
EVAL_SKIPPED = 6
|
891
898
|
end
|
892
899
|
end
|
@@ -902,7 +909,8 @@ module Google
|
|
902
909
|
# resource name.
|
903
910
|
# @!attribute [rw] id
|
904
911
|
# @return [::String]
|
905
|
-
# Id of the revision
|
912
|
+
# Id of the revision, internally generated by doc proto storage.
|
913
|
+
# Unique within the context of the document.
|
906
914
|
# @!attribute [rw] parent
|
907
915
|
# @return [::Array<::Integer>]
|
908
916
|
# The revisions that this revision is based on. This can include one or
|
@@ -915,7 +923,8 @@ module Google
|
|
915
923
|
# `provenance.parent.revision` fields that index into this field.
|
916
924
|
# @!attribute [rw] create_time
|
917
925
|
# @return [::Google::Protobuf::Timestamp]
|
918
|
-
# The time that the revision was created
|
926
|
+
# The time that the revision was created, internally generated by
|
927
|
+
# doc proto storage at the time of create.
|
919
928
|
# @!attribute [rw] human_review
|
920
929
|
# @return [::Google::Cloud::DocumentAI::V1::Document::Revision::HumanReview]
|
921
930
|
# Human Review information of this revision.
|
@@ -530,6 +530,90 @@ module Google
|
|
530
530
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
531
531
|
end
|
532
532
|
|
533
|
+
# Request message for the create processor version method.
|
534
|
+
# @!attribute [rw] parent
|
535
|
+
# @return [::String]
|
536
|
+
# Required. The parent (project, location and processor) to create the new
|
537
|
+
# version for. Format:
|
538
|
+
# `projects/{project}/locations/{location}/processors/{processor}`.
|
539
|
+
# @!attribute [rw] processor_version
|
540
|
+
# @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion]
|
541
|
+
# Required. The processor version to be created.
|
542
|
+
# @!attribute [rw] document_schema
|
543
|
+
# @return [::Google::Cloud::DocumentAI::V1::DocumentSchema]
|
544
|
+
# Optional. The schema the processor version will be trained with.
|
545
|
+
# @!attribute [rw] input_data
|
546
|
+
# @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionRequest::InputData]
|
547
|
+
# Optional. The input data used to train the `ProcessorVersion`.
|
548
|
+
# @!attribute [rw] base_processor_version
|
549
|
+
# @return [::String]
|
550
|
+
# Optional. The processor version to use as a base for training. This
|
551
|
+
# processor version must be a child of `parent`. Format:
|
552
|
+
# `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
|
553
|
+
class TrainProcessorVersionRequest
|
554
|
+
include ::Google::Protobuf::MessageExts
|
555
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
556
|
+
|
557
|
+
# The input data used to train a new `ProcessorVersion`.
|
558
|
+
# @!attribute [rw] training_documents
|
559
|
+
# @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig]
|
560
|
+
# The documents used for training the new version.
|
561
|
+
# @!attribute [rw] test_documents
|
562
|
+
# @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig]
|
563
|
+
# The documents used for testing the trained version.
|
564
|
+
class InputData
|
565
|
+
include ::Google::Protobuf::MessageExts
|
566
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
567
|
+
end
|
568
|
+
end
|
569
|
+
|
570
|
+
# The response for the TrainProcessorVersion method.
|
571
|
+
# @!attribute [rw] processor_version
|
572
|
+
# @return [::String]
|
573
|
+
# The resource name of the processor version produced by training.
|
574
|
+
class TrainProcessorVersionResponse
|
575
|
+
include ::Google::Protobuf::MessageExts
|
576
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
577
|
+
end
|
578
|
+
|
579
|
+
# The metadata that represents a processor version being created.
|
580
|
+
# @!attribute [rw] common_metadata
|
581
|
+
# @return [::Google::Cloud::DocumentAI::V1::CommonOperationMetadata]
|
582
|
+
# The basic metadata of the long running operation.
|
583
|
+
# @!attribute [rw] training_dataset_validation
|
584
|
+
# @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionMetadata::DatasetValidation]
|
585
|
+
# The training dataset validation information.
|
586
|
+
# @!attribute [rw] test_dataset_validation
|
587
|
+
# @return [::Google::Cloud::DocumentAI::V1::TrainProcessorVersionMetadata::DatasetValidation]
|
588
|
+
# The test dataset validation information.
|
589
|
+
class TrainProcessorVersionMetadata
|
590
|
+
include ::Google::Protobuf::MessageExts
|
591
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
592
|
+
|
593
|
+
# The dataset validation information.
|
594
|
+
# This includes any and all errors with documents and the dataset.
|
595
|
+
# @!attribute [rw] document_error_count
|
596
|
+
# @return [::Integer]
|
597
|
+
# The total number of document errors.
|
598
|
+
# @!attribute [rw] dataset_error_count
|
599
|
+
# @return [::Integer]
|
600
|
+
# The total number of dataset errors.
|
601
|
+
# @!attribute [rw] document_errors
|
602
|
+
# @return [::Array<::Google::Rpc::Status>]
|
603
|
+
# Error information pertaining to specific documents. A maximum of 10
|
604
|
+
# document errors will be returned.
|
605
|
+
# Any document with errors will not be used throughout training.
|
606
|
+
# @!attribute [rw] dataset_errors
|
607
|
+
# @return [::Array<::Google::Rpc::Status>]
|
608
|
+
# Error information for the dataset as a whole. A maximum of 10 dataset
|
609
|
+
# errors will be returned.
|
610
|
+
# A single dataset error is terminal for training.
|
611
|
+
class DatasetValidation
|
612
|
+
include ::Google::Protobuf::MessageExts
|
613
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
614
|
+
end
|
615
|
+
end
|
616
|
+
|
533
617
|
# Request message for review document method.
|
534
618
|
# @!attribute [rw] inline_document
|
535
619
|
# @return [::Google::Cloud::DocumentAI::V1::Document]
|
@@ -601,6 +685,85 @@ module Google
|
|
601
685
|
include ::Google::Protobuf::MessageExts
|
602
686
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
603
687
|
end
|
688
|
+
|
689
|
+
# Evaluates the given ProcessorVersion against the supplied documents.
|
690
|
+
# @!attribute [rw] processor_version
|
691
|
+
# @return [::String]
|
692
|
+
# Required. The resource name of the
|
693
|
+
# {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to
|
694
|
+
# evaluate.
|
695
|
+
# `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
|
696
|
+
# @!attribute [rw] evaluation_documents
|
697
|
+
# @return [::Google::Cloud::DocumentAI::V1::BatchDocumentsInputConfig]
|
698
|
+
# Optional. The documents used in the evaluation. If unspecified, use the
|
699
|
+
# processor's dataset as evaluation input.
|
700
|
+
class EvaluateProcessorVersionRequest
|
701
|
+
include ::Google::Protobuf::MessageExts
|
702
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
703
|
+
end
|
704
|
+
|
705
|
+
# Metadata of the EvaluateProcessorVersion method.
|
706
|
+
# @!attribute [rw] common_metadata
|
707
|
+
# @return [::Google::Cloud::DocumentAI::V1::CommonOperationMetadata]
|
708
|
+
# The basic metadata of the long running operation.
|
709
|
+
class EvaluateProcessorVersionMetadata
|
710
|
+
include ::Google::Protobuf::MessageExts
|
711
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
712
|
+
end
|
713
|
+
|
714
|
+
# Metadata of the EvaluateProcessorVersion method.
|
715
|
+
# @!attribute [rw] evaluation
|
716
|
+
# @return [::String]
|
717
|
+
# The resource name of the created evaluation.
|
718
|
+
class EvaluateProcessorVersionResponse
|
719
|
+
include ::Google::Protobuf::MessageExts
|
720
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
721
|
+
end
|
722
|
+
|
723
|
+
# Retrieves a specific Evaluation.
|
724
|
+
# @!attribute [rw] name
|
725
|
+
# @return [::String]
|
726
|
+
# Required. The resource name of the
|
727
|
+
# {::Google::Cloud::DocumentAI::V1::Evaluation Evaluation} to get.
|
728
|
+
# `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
|
729
|
+
class GetEvaluationRequest
|
730
|
+
include ::Google::Protobuf::MessageExts
|
731
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
732
|
+
end
|
733
|
+
|
734
|
+
# Retrieves a list of evaluations for a given ProcessorVersion.
|
735
|
+
# @!attribute [rw] parent
|
736
|
+
# @return [::String]
|
737
|
+
# Required. The resource name of the
|
738
|
+
# {::Google::Cloud::DocumentAI::V1::ProcessorVersion ProcessorVersion} to list
|
739
|
+
# evaluations for.
|
740
|
+
# `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
|
741
|
+
# @!attribute [rw] page_size
|
742
|
+
# @return [::Integer]
|
743
|
+
# The standard list page size.
|
744
|
+
# If unspecified, at most 5 evaluations will be returned.
|
745
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
746
|
+
# @!attribute [rw] page_token
|
747
|
+
# @return [::String]
|
748
|
+
# A page token, received from a previous `ListEvaluations` call.
|
749
|
+
# Provide this to retrieve the subsequent page.
|
750
|
+
class ListEvaluationsRequest
|
751
|
+
include ::Google::Protobuf::MessageExts
|
752
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
753
|
+
end
|
754
|
+
|
755
|
+
# The response from ListEvaluations.
|
756
|
+
# @!attribute [rw] evaluations
|
757
|
+
# @return [::Array<::Google::Cloud::DocumentAI::V1::Evaluation>]
|
758
|
+
# The evaluations requested.
|
759
|
+
# @!attribute [rw] next_page_token
|
760
|
+
# @return [::String]
|
761
|
+
# A token, which can be sent as `page_token` to retrieve the next page.
|
762
|
+
# If this field is omitted, there are no subsequent pages.
|
763
|
+
class ListEvaluationsResponse
|
764
|
+
include ::Google::Protobuf::MessageExts
|
765
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
766
|
+
end
|
604
767
|
end
|
605
768
|
end
|
606
769
|
end
|
@@ -73,7 +73,7 @@ module Google
|
|
73
73
|
# one should be set.
|
74
74
|
# @!attribute [rw] properties
|
75
75
|
# @return [::Array<::Google::Cloud::DocumentAI::V1::DocumentSchema::EntityType::Property>]
|
76
|
-
#
|
76
|
+
# Description the nested structure, or composition of an entity.
|
77
77
|
class EntityType
|
78
78
|
include ::Google::Protobuf::MessageExts
|
79
79
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -104,20 +104,28 @@ module Google
|
|
104
104
|
include ::Google::Protobuf::MessageExts
|
105
105
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
106
106
|
|
107
|
-
# Types of occurrences of the entity type in the document.
|
108
|
-
# represents the number of instances of an entity
|
109
|
-
# mentions of a
|
107
|
+
# Types of occurrences of the entity type in the document. This
|
108
|
+
# represents the number of instances of instances of an entity, not
|
109
|
+
# number of mentions of an entity. For example, a bank statement may
|
110
|
+
# only have one `account_number`, but this account number may be
|
111
|
+
# mentioned in several places on the document. In this case the
|
112
|
+
# 'account_number' would be considered a `REQUIRED_ONCE` entity type. If,
|
113
|
+
# on the other hand, we expect a bank statement to contain the status of
|
114
|
+
# multiple different accounts for the customers, the occurrence type will
|
115
|
+
# be set to `REQUIRED_MULTIPLE`.
|
110
116
|
module OccurrenceType
|
111
117
|
# Unspecified occurrence type.
|
112
118
|
OCCURRENCE_TYPE_UNSPECIFIED = 0
|
113
119
|
|
114
|
-
# There will be zero or one instance of this entity type.
|
120
|
+
# There will be zero or one instance of this entity type. The same
|
121
|
+
# entity instance may be mentioned multiple times.
|
115
122
|
OPTIONAL_ONCE = 1
|
116
123
|
|
117
124
|
# The entity type will appear zero or multiple times.
|
118
125
|
OPTIONAL_MULTIPLE = 2
|
119
126
|
|
120
|
-
# The entity type will only appear exactly once.
|
127
|
+
# The entity type will only appear exactly once. The same
|
128
|
+
# entity instance may be mentioned multiple times.
|
121
129
|
REQUIRED_ONCE = 3
|
122
130
|
|
123
131
|
# The entity type will appear once or more times.
|