google-cloud-document_ai-v1 0.8.0 → 0.10.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/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +562 -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 +42 -0
- data/lib/google/cloud/document_ai/v1/document_processor_service.rb +1 -1
- data/lib/google/cloud/document_ai/v1/version.rb +1 -1
- data/lib/google/cloud/document_ai/v1.rb +2 -2
- data/lib/google/cloud/documentai/v1/document_pb.rb +1 -0
- data/lib/google/cloud/documentai/v1/document_processor_service_pb.rb +64 -0
- data/lib/google/cloud/documentai/v1/document_processor_service_services_pb.rb +13 -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 +172 -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 +11 -9
@@ -158,13 +158,11 @@ module Google
|
|
158
158
|
# # Call the list_operations method.
|
159
159
|
# result = client.list_operations request
|
160
160
|
#
|
161
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
162
|
-
# #
|
163
|
-
#
|
164
|
-
# # methods are also available for managing paging directly.
|
165
|
-
# result.each do |response|
|
161
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
162
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
163
|
+
# result.each do |item|
|
166
164
|
# # Each element is of type ::Google::Longrunning::Operation.
|
167
|
-
# p
|
165
|
+
# p item
|
168
166
|
# end
|
169
167
|
#
|
170
168
|
def list_operations request, options = nil
|
@@ -253,14 +251,14 @@ module Google
|
|
253
251
|
# # Call the get_operation method.
|
254
252
|
# result = client.get_operation request
|
255
253
|
#
|
256
|
-
# # The returned object is of type Gapic::Operation. You can use
|
257
|
-
# #
|
258
|
-
# #
|
254
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
255
|
+
# # check the status of an operation, cancel it, or wait for results.
|
256
|
+
# # Here is how to wait for a response.
|
259
257
|
# result.wait_until_done! timeout: 60
|
260
258
|
# if result.response?
|
261
259
|
# p result.response
|
262
260
|
# else
|
263
|
-
# puts "
|
261
|
+
# puts "No response received."
|
264
262
|
# end
|
265
263
|
#
|
266
264
|
def get_operation request, options = nil
|
@@ -540,14 +538,14 @@ module Google
|
|
540
538
|
# # Call the wait_operation method.
|
541
539
|
# result = client.wait_operation request
|
542
540
|
#
|
543
|
-
# # The returned object is of type Gapic::Operation. You can use
|
544
|
-
# #
|
545
|
-
# #
|
541
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
542
|
+
# # check the status of an operation, cancel it, or wait for results.
|
543
|
+
# # Here is how to wait for a response.
|
546
544
|
# result.wait_until_done! timeout: 60
|
547
545
|
# if result.response?
|
548
546
|
# p result.response
|
549
547
|
# else
|
550
|
-
# puts "
|
548
|
+
# puts "No response received."
|
551
549
|
# end
|
552
550
|
#
|
553
551
|
def wait_operation request, options = nil
|
@@ -24,6 +24,29 @@ module Google
|
|
24
24
|
module DocumentProcessorService
|
25
25
|
# Path helper methods for the DocumentProcessorService API.
|
26
26
|
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Evaluation resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
# @param processor [String]
|
37
|
+
# @param processor_version [String]
|
38
|
+
# @param evaluation [String]
|
39
|
+
#
|
40
|
+
# @return [::String]
|
41
|
+
def evaluation_path project:, location:, processor:, processor_version:, evaluation:
|
42
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
43
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
44
|
+
raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/"
|
45
|
+
raise ::ArgumentError, "processor_version cannot contain /" if processor_version.to_s.include? "/"
|
46
|
+
|
47
|
+
"projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}/evaluations/#{evaluation}"
|
48
|
+
end
|
49
|
+
|
27
50
|
##
|
28
51
|
# Create a fully-qualified HumanReviewConfig resource string.
|
29
52
|
#
|
@@ -79,6 +102,25 @@ module Google
|
|
79
102
|
"projects/#{project}/locations/#{location}/processors/#{processor}"
|
80
103
|
end
|
81
104
|
|
105
|
+
##
|
106
|
+
# Create a fully-qualified ProcessorType resource string.
|
107
|
+
#
|
108
|
+
# The resource will be in the following format:
|
109
|
+
#
|
110
|
+
# `projects/{project}/locations/{location}/processorTypes/{processor_type}`
|
111
|
+
#
|
112
|
+
# @param project [String]
|
113
|
+
# @param location [String]
|
114
|
+
# @param processor_type [String]
|
115
|
+
#
|
116
|
+
# @return [::String]
|
117
|
+
def processor_type_path project:, location:, processor_type:
|
118
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
119
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
120
|
+
|
121
|
+
"projects/#{project}/locations/#{location}/processorTypes/#{processor_type}"
|
122
|
+
end
|
123
|
+
|
82
124
|
##
|
83
125
|
# Create a fully-qualified ProcessorVersion resource string.
|
84
126
|
#
|
@@ -37,7 +37,7 @@ module Google
|
|
37
37
|
# AI such as natural language, computer vision, and translation to extract
|
38
38
|
# structured information from unstructured or semi-structured documents.
|
39
39
|
#
|
40
|
-
#
|
40
|
+
# @example Load this service and instantiate a gRPC client
|
41
41
|
#
|
42
42
|
# require "google/cloud/document_ai/v1/document_processor_service"
|
43
43
|
# client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new
|
@@ -23,9 +23,9 @@ module Google
|
|
23
23
|
module Cloud
|
24
24
|
module DocumentAI
|
25
25
|
##
|
26
|
-
#
|
26
|
+
# API client module.
|
27
27
|
#
|
28
|
-
# @example
|
28
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
29
29
|
#
|
30
30
|
# require "google/cloud/document_ai/v1"
|
31
31
|
# client = ::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new
|
@@ -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'
|
@@ -99,6 +101,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
99
101
|
repeated :processors, :message, 1, "google.cloud.documentai.v1.Processor"
|
100
102
|
optional :next_page_token, :string, 2
|
101
103
|
end
|
104
|
+
add_message "google.cloud.documentai.v1.GetProcessorTypeRequest" do
|
105
|
+
optional :name, :string, 1
|
106
|
+
end
|
102
107
|
add_message "google.cloud.documentai.v1.GetProcessorRequest" do
|
103
108
|
optional :name, :string, 1
|
104
109
|
end
|
@@ -171,6 +176,31 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
171
176
|
add_message "google.cloud.documentai.v1.SetDefaultProcessorVersionMetadata" do
|
172
177
|
optional :common_metadata, :message, 1, "google.cloud.documentai.v1.CommonOperationMetadata"
|
173
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
|
174
204
|
add_message "google.cloud.documentai.v1.ReviewDocumentRequest" do
|
175
205
|
optional :human_review_config, :string, 1
|
176
206
|
optional :enable_schema_validation, :bool, 3
|
@@ -198,6 +228,28 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
198
228
|
optional :common_metadata, :message, 5, "google.cloud.documentai.v1.CommonOperationMetadata"
|
199
229
|
optional :question_id, :string, 6
|
200
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
|
201
253
|
end
|
202
254
|
end
|
203
255
|
|
@@ -220,6 +272,7 @@ module Google
|
|
220
272
|
ListProcessorTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorTypesResponse").msgclass
|
221
273
|
ListProcessorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorsRequest").msgclass
|
222
274
|
ListProcessorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorsResponse").msgclass
|
275
|
+
GetProcessorTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorTypeRequest").msgclass
|
223
276
|
GetProcessorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorRequest").msgclass
|
224
277
|
GetProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.GetProcessorVersionRequest").msgclass
|
225
278
|
ListProcessorVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ListProcessorVersionsRequest").msgclass
|
@@ -244,11 +297,22 @@ module Google
|
|
244
297
|
SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionRequest").msgclass
|
245
298
|
SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.SetDefaultProcessorVersionResponse").msgclass
|
246
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
|
247
305
|
ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentRequest").msgclass
|
248
306
|
ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentRequest.Priority").enummodule
|
249
307
|
ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentResponse").msgclass
|
250
308
|
ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.ReviewDocumentResponse.State").enummodule
|
251
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
|
252
316
|
end
|
253
317
|
end
|
254
318
|
end
|
@@ -46,10 +46,16 @@ module Google
|
|
46
46
|
rpc :FetchProcessorTypes, ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse
|
47
47
|
# Lists the processor types that exist.
|
48
48
|
rpc :ListProcessorTypes, ::Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorTypesResponse
|
49
|
+
# Gets a processor type detail.
|
50
|
+
rpc :GetProcessorType, ::Google::Cloud::DocumentAI::V1::GetProcessorTypeRequest, ::Google::Cloud::DocumentAI::V1::ProcessorType
|
49
51
|
# Lists all processors which belong to this project.
|
50
52
|
rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1::ListProcessorsResponse
|
51
53
|
# Gets a processor detail.
|
52
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
|
53
59
|
# Gets a processor version detail.
|
54
60
|
rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1::ProcessorVersion
|
55
61
|
# Lists all versions of a processor.
|
@@ -80,6 +86,13 @@ module Google
|
|
80
86
|
# Send a document for Human Review. The input document should be processed by
|
81
87
|
# the specified processor.
|
82
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
|
83
96
|
end
|
84
97
|
|
85
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.
|
@@ -286,6 +286,15 @@ module Google
|
|
286
286
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
287
287
|
end
|
288
288
|
|
289
|
+
# Request message for get processor.
|
290
|
+
# @!attribute [rw] name
|
291
|
+
# @return [::String]
|
292
|
+
# Required. The processor type resource name.
|
293
|
+
class GetProcessorTypeRequest
|
294
|
+
include ::Google::Protobuf::MessageExts
|
295
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
296
|
+
end
|
297
|
+
|
289
298
|
# Request message for get processor.
|
290
299
|
# @!attribute [rw] name
|
291
300
|
# @return [::String]
|
@@ -521,6 +530,90 @@ module Google
|
|
521
530
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
522
531
|
end
|
523
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
|
+
|
524
617
|
# Request message for review document method.
|
525
618
|
# @!attribute [rw] inline_document
|
526
619
|
# @return [::Google::Cloud::DocumentAI::V1::Document]
|
@@ -592,6 +685,85 @@ module Google
|
|
592
685
|
include ::Google::Protobuf::MessageExts
|
593
686
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
594
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
|
595
767
|
end
|
596
768
|
end
|
597
769
|
end
|