blob: bcca3bbc2779eecda75e000ed4da61911f3f189e [file] [log] [blame]
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="documentai_v1beta2.html">Cloud Document AI API</a> . <a href="documentai_v1beta2.projects.html">projects</a> . <a href="documentai_v1beta2.projects.documents.html">documents</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#batchProcess">batchProcess(parent, body=None, x__xgafv=None)</a></code></p>
79<p class="firstline">LRO endpoint to batch process many documents. The output is written</p>
80<p class="toc_element">
81 <code><a href="#process">process(parent, body=None, x__xgafv=None)</a></code></p>
82<p class="firstline">Processes a single document.</p>
83<h3>Method Details</h3>
84<div class="method">
85 <code class="details" id="batchProcess">batchProcess(parent, body=None, x__xgafv=None)</code>
86 <pre>LRO endpoint to batch process many documents. The output is written
87to Cloud Storage as JSON in the [Document] format.
88
89Args:
90 parent: string, Target project and location to make a call.
91
92Format: `projects/{project-id}/locations/{location-id}`.
93
94If no location is specified, a region will be chosen automatically. (required)
95 body: object, The request body.
96 The object takes the form of:
97
98{ # Request to batch process documents as an asynchronous operation. The output
99 # is written to Cloud Storage as JSON in the [Document] format.
100 &quot;requests&quot;: [ # Required. Individual requests for each document.
101 { # Request to process one document.
102 &quot;ocrParams&quot;: { # Parameters to control Optical Character Recognition (OCR) behavior. # Controls OCR behavior. If not specified, the system will decide reasonable
103 # defaults.
104 &quot;languageHints&quot;: [ # List of languages to use for OCR. In most cases, an empty value
105 # yields the best results since it enables automatic language detection. For
106 # languages based on the Latin alphabet, setting `language_hints` is not
107 # needed. In rare cases, when the language of the text in the image is known,
108 # setting a hint will help get better results (although it will be a
109 # significant hindrance if the hint is wrong). Document processing returns an
110 # error if one or more of the specified languages is not one of the
111 # supported languages.
112 &quot;A String&quot;,
113 ],
114 },
115 &quot;tableExtractionParams&quot;: { # Parameters to control table extraction behavior. # Controls table extraction behavior. If not specified, the system will
116 # decide reasonable defaults.
117 &quot;tableBoundHints&quot;: [ # Optional. Table bounding box hints that can be provided to complex cases
118 # which our algorithm cannot locate the table(s) in.
119 { # A hint for a table bounding box on the page for table parsing.
120 &quot;pageNumber&quot;: 42, # Optional. Page number for multi-paged inputs this hint applies to. If not
121 # provided, this hint will apply to all pages by default. This value is
122 # 1-based.
123 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # Bounding box hint for a table on this page. The coordinates must be
124 # normalized to [0,1] and the bounding box must be an axis-aligned rectangle.
125 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
126 { # A vertex represents a 2D point in the image.
127 # NOTE: the normalized vertex coordinates are relative to the original image
128 # and range from 0 to 1.
129 &quot;x&quot;: 3.14, # X coordinate.
130 &quot;y&quot;: 3.14, # Y coordinate.
131 },
132 ],
133 &quot;vertices&quot;: [ # The bounding polygon vertices.
134 { # A vertex represents a 2D point in the image.
135 # NOTE: the vertex coordinates are in the same scale as the original image.
136 &quot;x&quot;: 42, # X coordinate.
137 &quot;y&quot;: 42, # Y coordinate.
138 },
139 ],
140 },
141 },
142 ],
143 &quot;headerHints&quot;: [ # Optional. Reserved for future use.
144 &quot;A String&quot;,
145 ],
146 &quot;modelVersion&quot;: &quot;A String&quot;, # Model version of the table extraction system. Default is &quot;builtin/stable&quot;.
147 # Specify &quot;builtin/latest&quot; for the latest model.
148 &quot;enabled&quot;: True or False, # Whether to enable table extraction.
149 },
150 &quot;automlParams&quot;: { # Parameters to control AutoML model prediction behavior. # Controls AutoML model prediction behavior. AutoMlParams cannot be used
151 # together with other Params.
152 &quot;model&quot;: &quot;A String&quot;, # Resource name of the AutoML model.
153 #
154 # Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
155 },
156 &quot;inputConfig&quot;: { # The desired input location and metadata. # Required. Information about the input file.
157 &quot;gcsSource&quot;: { # The Google Cloud Storage location where the input file will be read from. # The Google Cloud Storage location to read the input from. This must be a
158 # single file.
159 &quot;uri&quot;: &quot;A String&quot;,
160 },
161 &quot;contents&quot;: &quot;A String&quot;, # Content in bytes, represented as a stream of bytes.
162 # Note: As with all `bytes` fields, proto buffer messages use a pure binary
163 # representation, whereas JSON representations use base64.
164 #
165 # This field only works for synchronous ProcessDocument method.
166 &quot;mimeType&quot;: &quot;A String&quot;, # Required. Mimetype of the input. Current supported mimetypes are application/pdf,
167 # image/tiff, and image/gif.
168 # In addition, application/json type is supported for requests with
169 # ProcessDocumentRequest.automl_params field set. The JSON file needs to
170 # be in Document format.
171 },
172 &quot;formExtractionParams&quot;: { # Parameters to control form extraction behavior. # Controls form extraction behavior. If not specified, the system will
173 # decide reasonable defaults.
174 &quot;modelVersion&quot;: &quot;A String&quot;, # Model version of the form extraction system. Default is
175 # &quot;builtin/stable&quot;. Specify &quot;builtin/latest&quot; for the latest model.
176 # For custom form models, specify: “custom/{model_name}&quot;. Model name
177 # format is &quot;bucket_name/path/to/modeldir&quot; corresponding to
178 # &quot;gs://bucket_name/path/to/modeldir&quot; where annotated examples are stored.
179 &quot;enabled&quot;: True or False, # Whether to enable form extraction.
180 &quot;keyValuePairHints&quot;: [ # Reserved for future use.
181 { # Reserved for future use.
182 &quot;valueTypes&quot;: [ # Type of the value. This is case-insensitive, and could be one of:
183 # ADDRESS, LOCATION, ORGANIZATION, PERSON, PHONE_NUMBER,
184 # ID, NUMBER, EMAIL, PRICE, TERMS, DATE, NAME. Types not in this list will
185 # be ignored.
186 &quot;A String&quot;,
187 ],
188 &quot;key&quot;: &quot;A String&quot;, # The key text for the hint.
189 },
190 ],
191 },
192 &quot;documentType&quot;: &quot;A String&quot;, # Specifies a known document type for deeper structure detection. Valid
193 # values are currently &quot;general&quot; and &quot;invoice&quot;. If not provided, &quot;general&quot;\
194 # is used as default. If any other value is given, the request is rejected.
195 &quot;parent&quot;: &quot;A String&quot;, # Target project and location to make a call.
196 #
197 # Format: `projects/{project-id}/locations/{location-id}`.
198 #
199 # If no location is specified, a region will be chosen automatically.
200 # This field is only populated when used in ProcessDocument method.
201 &quot;outputConfig&quot;: { # The desired output location and metadata. # The desired output location. This field is only needed in
202 # BatchProcessDocumentsRequest.
203 &quot;pagesPerShard&quot;: 42, # The max number of pages to include into each output Document shard JSON on
204 # Google Cloud Storage.
205 #
206 # The valid range is [1, 100]. If not specified, the default value is 20.
207 #
208 # For example, for one pdf file with 100 pages, 100 parsed pages will be
209 # produced. If `pages_per_shard` = 20, then 5 Document shard JSON files each
210 # containing 20 parsed pages will be written under the prefix
211 # OutputConfig.gcs_destination.uri and suffix pages-x-to-y.json where
212 # x and y are 1-indexed page numbers.
213 #
214 # Example GCS outputs with 157 pages and pages_per_shard = 50:
215 #
216 # &lt;prefix&gt;pages-001-to-050.json
217 # &lt;prefix&gt;pages-051-to-100.json
218 # &lt;prefix&gt;pages-101-to-150.json
219 # &lt;prefix&gt;pages-151-to-157.json
220 &quot;gcsDestination&quot;: { # The Google Cloud Storage location where the output file will be written to. # The Google Cloud Storage location to write the output to.
221 &quot;uri&quot;: &quot;A String&quot;,
222 },
223 },
224 &quot;entityExtractionParams&quot;: { # Parameters to control entity extraction behavior. # Controls entity extraction behavior. If not specified, the system will
225 # decide reasonable defaults.
226 &quot;enabled&quot;: True or False, # Whether to enable entity extraction.
227 &quot;modelVersion&quot;: &quot;A String&quot;, # Model version of the entity extraction. Default is
228 # &quot;builtin/stable&quot;. Specify &quot;builtin/latest&quot; for the latest model.
229 },
230 },
231 ],
232 }
233
234 x__xgafv: string, V1 error format.
235 Allowed values
236 1 - v1 error format
237 2 - v2 error format
238
239Returns:
240 An object of the form:
241
242 { # This resource represents a long-running operation that is the result of a
243 # network API call.
244 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
245 # contains progress information and common metadata such as create time.
246 # Some services might not provide such metadata. Any method that returns a
247 # long-running operation should document the metadata type, if any.
248 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
249 },
250 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
251 # originally returns it. If you use the default HTTP mapping, the
252 # `name` should be a resource name ending with `operations/{unique_id}`.
253 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
254 # different programming environments, including REST APIs and RPC APIs. It is
255 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
256 # three pieces of data: error code, error message, and error details.
257 #
258 # You can find out more about this error model and how to work with it in the
259 # [API Design Guide](https://cloud.google.com/apis/design/errors).
260 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
261 # user-facing error message should be localized and sent in the
262 # google.rpc.Status.details field, or localized by the client.
263 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
264 # message types for APIs to use.
265 {
266 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
267 },
268 ],
269 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
270 },
271 &quot;response&quot;: { # The normal response of the operation in case of success. If the original
272 # method returns no data on success, such as `Delete`, the response is
273 # `google.protobuf.Empty`. If the original method is standard
274 # `Get`/`Create`/`Update`, the response should be the resource. For other
275 # methods, the response should have the type `XxxResponse`, where `Xxx`
276 # is the original method name. For example, if the original method name
277 # is `TakeSnapshot()`, the inferred response type is
278 # `TakeSnapshotResponse`.
279 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
280 },
281 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
282 # If `true`, the operation is completed, and either `error` or `response` is
283 # available.
284 }</pre>
285</div>
286
287<div class="method">
288 <code class="details" id="process">process(parent, body=None, x__xgafv=None)</code>
289 <pre>Processes a single document.
290
291Args:
292 parent: string, Target project and location to make a call.
293
294Format: `projects/{project-id}/locations/{location-id}`.
295
296If no location is specified, a region will be chosen automatically.
297This field is only populated when used in ProcessDocument method. (required)
298 body: object, The request body.
299 The object takes the form of:
300
301{ # Request to process one document.
302 &quot;ocrParams&quot;: { # Parameters to control Optical Character Recognition (OCR) behavior. # Controls OCR behavior. If not specified, the system will decide reasonable
303 # defaults.
304 &quot;languageHints&quot;: [ # List of languages to use for OCR. In most cases, an empty value
305 # yields the best results since it enables automatic language detection. For
306 # languages based on the Latin alphabet, setting `language_hints` is not
307 # needed. In rare cases, when the language of the text in the image is known,
308 # setting a hint will help get better results (although it will be a
309 # significant hindrance if the hint is wrong). Document processing returns an
310 # error if one or more of the specified languages is not one of the
311 # supported languages.
312 &quot;A String&quot;,
313 ],
314 },
315 &quot;tableExtractionParams&quot;: { # Parameters to control table extraction behavior. # Controls table extraction behavior. If not specified, the system will
316 # decide reasonable defaults.
317 &quot;tableBoundHints&quot;: [ # Optional. Table bounding box hints that can be provided to complex cases
318 # which our algorithm cannot locate the table(s) in.
319 { # A hint for a table bounding box on the page for table parsing.
320 &quot;pageNumber&quot;: 42, # Optional. Page number for multi-paged inputs this hint applies to. If not
321 # provided, this hint will apply to all pages by default. This value is
322 # 1-based.
323 &quot;boundingBox&quot;: { # A bounding polygon for the detected image annotation. # Bounding box hint for a table on this page. The coordinates must be
324 # normalized to [0,1] and the bounding box must be an axis-aligned rectangle.
325 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
326 { # A vertex represents a 2D point in the image.
327 # NOTE: the normalized vertex coordinates are relative to the original image
328 # and range from 0 to 1.
329 &quot;x&quot;: 3.14, # X coordinate.
330 &quot;y&quot;: 3.14, # Y coordinate.
331 },
332 ],
333 &quot;vertices&quot;: [ # The bounding polygon vertices.
334 { # A vertex represents a 2D point in the image.
335 # NOTE: the vertex coordinates are in the same scale as the original image.
336 &quot;x&quot;: 42, # X coordinate.
337 &quot;y&quot;: 42, # Y coordinate.
338 },
339 ],
340 },
341 },
342 ],
343 &quot;headerHints&quot;: [ # Optional. Reserved for future use.
344 &quot;A String&quot;,
345 ],
346 &quot;modelVersion&quot;: &quot;A String&quot;, # Model version of the table extraction system. Default is &quot;builtin/stable&quot;.
347 # Specify &quot;builtin/latest&quot; for the latest model.
348 &quot;enabled&quot;: True or False, # Whether to enable table extraction.
349 },
350 &quot;automlParams&quot;: { # Parameters to control AutoML model prediction behavior. # Controls AutoML model prediction behavior. AutoMlParams cannot be used
351 # together with other Params.
352 &quot;model&quot;: &quot;A String&quot;, # Resource name of the AutoML model.
353 #
354 # Format: `projects/{project-id}/locations/{location-id}/models/{model-id}`.
355 },
356 &quot;inputConfig&quot;: { # The desired input location and metadata. # Required. Information about the input file.
357 &quot;gcsSource&quot;: { # The Google Cloud Storage location where the input file will be read from. # The Google Cloud Storage location to read the input from. This must be a
358 # single file.
359 &quot;uri&quot;: &quot;A String&quot;,
360 },
361 &quot;contents&quot;: &quot;A String&quot;, # Content in bytes, represented as a stream of bytes.
362 # Note: As with all `bytes` fields, proto buffer messages use a pure binary
363 # representation, whereas JSON representations use base64.
364 #
365 # This field only works for synchronous ProcessDocument method.
366 &quot;mimeType&quot;: &quot;A String&quot;, # Required. Mimetype of the input. Current supported mimetypes are application/pdf,
367 # image/tiff, and image/gif.
368 # In addition, application/json type is supported for requests with
369 # ProcessDocumentRequest.automl_params field set. The JSON file needs to
370 # be in Document format.
371 },
372 &quot;formExtractionParams&quot;: { # Parameters to control form extraction behavior. # Controls form extraction behavior. If not specified, the system will
373 # decide reasonable defaults.
374 &quot;modelVersion&quot;: &quot;A String&quot;, # Model version of the form extraction system. Default is
375 # &quot;builtin/stable&quot;. Specify &quot;builtin/latest&quot; for the latest model.
376 # For custom form models, specify: “custom/{model_name}&quot;. Model name
377 # format is &quot;bucket_name/path/to/modeldir&quot; corresponding to
378 # &quot;gs://bucket_name/path/to/modeldir&quot; where annotated examples are stored.
379 &quot;enabled&quot;: True or False, # Whether to enable form extraction.
380 &quot;keyValuePairHints&quot;: [ # Reserved for future use.
381 { # Reserved for future use.
382 &quot;valueTypes&quot;: [ # Type of the value. This is case-insensitive, and could be one of:
383 # ADDRESS, LOCATION, ORGANIZATION, PERSON, PHONE_NUMBER,
384 # ID, NUMBER, EMAIL, PRICE, TERMS, DATE, NAME. Types not in this list will
385 # be ignored.
386 &quot;A String&quot;,
387 ],
388 &quot;key&quot;: &quot;A String&quot;, # The key text for the hint.
389 },
390 ],
391 },
392 &quot;documentType&quot;: &quot;A String&quot;, # Specifies a known document type for deeper structure detection. Valid
393 # values are currently &quot;general&quot; and &quot;invoice&quot;. If not provided, &quot;general&quot;\
394 # is used as default. If any other value is given, the request is rejected.
395 &quot;parent&quot;: &quot;A String&quot;, # Target project and location to make a call.
396 #
397 # Format: `projects/{project-id}/locations/{location-id}`.
398 #
399 # If no location is specified, a region will be chosen automatically.
400 # This field is only populated when used in ProcessDocument method.
401 &quot;outputConfig&quot;: { # The desired output location and metadata. # The desired output location. This field is only needed in
402 # BatchProcessDocumentsRequest.
403 &quot;pagesPerShard&quot;: 42, # The max number of pages to include into each output Document shard JSON on
404 # Google Cloud Storage.
405 #
406 # The valid range is [1, 100]. If not specified, the default value is 20.
407 #
408 # For example, for one pdf file with 100 pages, 100 parsed pages will be
409 # produced. If `pages_per_shard` = 20, then 5 Document shard JSON files each
410 # containing 20 parsed pages will be written under the prefix
411 # OutputConfig.gcs_destination.uri and suffix pages-x-to-y.json where
412 # x and y are 1-indexed page numbers.
413 #
414 # Example GCS outputs with 157 pages and pages_per_shard = 50:
415 #
416 # &lt;prefix&gt;pages-001-to-050.json
417 # &lt;prefix&gt;pages-051-to-100.json
418 # &lt;prefix&gt;pages-101-to-150.json
419 # &lt;prefix&gt;pages-151-to-157.json
420 &quot;gcsDestination&quot;: { # The Google Cloud Storage location where the output file will be written to. # The Google Cloud Storage location to write the output to.
421 &quot;uri&quot;: &quot;A String&quot;,
422 },
423 },
424 &quot;entityExtractionParams&quot;: { # Parameters to control entity extraction behavior. # Controls entity extraction behavior. If not specified, the system will
425 # decide reasonable defaults.
426 &quot;enabled&quot;: True or False, # Whether to enable entity extraction.
427 &quot;modelVersion&quot;: &quot;A String&quot;, # Model version of the entity extraction. Default is
428 # &quot;builtin/stable&quot;. Specify &quot;builtin/latest&quot; for the latest model.
429 },
430 }
431
432 x__xgafv: string, V1 error format.
433 Allowed values
434 1 - v1 error format
435 2 - v2 error format
436
437Returns:
438 An object of the form:
439
440 { # Document represents the canonical document resource in Document Understanding
441 # AI.
442 # It is an interchange format that provides insights into documents and allows
443 # for collaboration between users and Document Understanding AI to iterate and
444 # optimize for quality.
445 &quot;content&quot;: &quot;A String&quot;, # Inline document content, represented as a stream of bytes.
446 # Note: As with all `bytes` fields, protobuffers use a pure binary
447 # representation, whereas JSON representations use base64.
448 &quot;labels&quot;: [ # Labels for this document.
449 { # Label attaches schema information and/or other metadata to segments within
450 # a Document. Multiple Labels on a single field can denote either
451 # different labels, different instances of the same label created at
452 # different times, or some combination of both.
453 &quot;automlModel&quot;: &quot;A String&quot;, # Label is generated AutoML model. This field stores the full resource
454 # name of the AutoML model.
455 #
456 # Format:
457 # `projects/{project-id}/locations/{location-id}/models/{model-id}`
458 &quot;confidence&quot;: 3.14, # Confidence score between 0 and 1 for label assignment.
459 &quot;name&quot;: &quot;A String&quot;, # Name of the label.
460 #
461 # When the label is generated from AutoML Text Classification model, this
462 # field represents the name of the category.
463 },
464 ],
465 &quot;uri&quot;: &quot;A String&quot;, # Currently supports Google Cloud Storage URI of the form
466 # `gs://bucket_name/object_name`. Object versioning is not supported.
467 # See [Google Cloud Storage Request
468 # URIs](https://cloud.google.com/storage/docs/reference-uris) for more
469 # info.
470 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # Any error that occurred while processing this document.
471 # different programming environments, including REST APIs and RPC APIs. It is
472 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
473 # three pieces of data: error code, error message, and error details.
474 #
475 # You can find out more about this error model and how to work with it in the
476 # [API Design Guide](https://cloud.google.com/apis/design/errors).
477 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
478 # user-facing error message should be localized and sent in the
479 # google.rpc.Status.details field, or localized by the client.
480 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
481 # message types for APIs to use.
482 {
483 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
484 },
485 ],
486 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
487 },
488 &quot;pages&quot;: [ # Visual page layout for the Document.
489 { # A page in a Document.
490 &quot;dimension&quot;: { # Dimension for the page. # Physical dimension of the page.
491 &quot;width&quot;: 3.14, # Page width.
492 &quot;height&quot;: 3.14, # Page height.
493 &quot;unit&quot;: &quot;A String&quot;, # Dimension unit.
494 },
495 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
496 { # Detected language for a structural component.
497 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
498 # information, see
499 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
500 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
501 },
502 ],
503 &quot;tables&quot;: [ # A list of visually detected tables on the page.
504 { # A table representation similar to HTML table structure.
505 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for Table.
506 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
507 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
508 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
509 { # A vertex represents a 2D point in the image.
510 # NOTE: the normalized vertex coordinates are relative to the original image
511 # and range from 0 to 1.
512 &quot;x&quot;: 3.14, # X coordinate.
513 &quot;y&quot;: 3.14, # Y coordinate.
514 },
515 ],
516 &quot;vertices&quot;: [ # The bounding polygon vertices.
517 { # A vertex represents a 2D point in the image.
518 # NOTE: the vertex coordinates are in the same scale as the original image.
519 &quot;x&quot;: 42, # X coordinate.
520 &quot;y&quot;: 42, # Y coordinate.
521 },
522 ],
523 },
524 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
525 # layout is for. e.g. confidence can be for a single token, a table,
526 # a visual element, etc. depending on context. Range [0, 1].
527 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
528 &quot;textSegments&quot;: [ # The text segments from the Document.text.
529 { # A text segment in the Document.text. The indices may be out of bounds
530 # which indicate that the text extends into another document shard for
531 # large sharded documents. See ShardInfo.text_offset
532 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
533 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
534 # Document.text.
535 },
536 ],
537 },
538 },
539 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
540 { # Detected language for a structural component.
541 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
542 # information, see
543 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
544 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
545 },
546 ],
547 &quot;bodyRows&quot;: [ # Body rows of the table.
548 { # A row of table cells.
549 &quot;cells&quot;: [ # Cells that make up this row.
550 { # A cell representation inside the table.
551 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
552 { # Detected language for a structural component.
553 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
554 # information, see
555 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
556 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
557 },
558 ],
559 &quot;rowSpan&quot;: 42, # How many rows this cell spans.
560 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for TableCell.
561 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
562 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
563 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
564 { # A vertex represents a 2D point in the image.
565 # NOTE: the normalized vertex coordinates are relative to the original image
566 # and range from 0 to 1.
567 &quot;x&quot;: 3.14, # X coordinate.
568 &quot;y&quot;: 3.14, # Y coordinate.
569 },
570 ],
571 &quot;vertices&quot;: [ # The bounding polygon vertices.
572 { # A vertex represents a 2D point in the image.
573 # NOTE: the vertex coordinates are in the same scale as the original image.
574 &quot;x&quot;: 42, # X coordinate.
575 &quot;y&quot;: 42, # Y coordinate.
576 },
577 ],
578 },
579 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
580 # layout is for. e.g. confidence can be for a single token, a table,
581 # a visual element, etc. depending on context. Range [0, 1].
582 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
583 &quot;textSegments&quot;: [ # The text segments from the Document.text.
584 { # A text segment in the Document.text. The indices may be out of bounds
585 # which indicate that the text extends into another document shard for
586 # large sharded documents. See ShardInfo.text_offset
587 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
588 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
589 # Document.text.
590 },
591 ],
592 },
593 },
594 &quot;colSpan&quot;: 42, # How many columns this cell spans.
595 },
596 ],
597 },
598 ],
599 &quot;headerRows&quot;: [ # Header rows of the table.
600 { # A row of table cells.
601 &quot;cells&quot;: [ # Cells that make up this row.
602 { # A cell representation inside the table.
603 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
604 { # Detected language for a structural component.
605 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
606 # information, see
607 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
608 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
609 },
610 ],
611 &quot;rowSpan&quot;: 42, # How many rows this cell spans.
612 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for TableCell.
613 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
614 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
615 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
616 { # A vertex represents a 2D point in the image.
617 # NOTE: the normalized vertex coordinates are relative to the original image
618 # and range from 0 to 1.
619 &quot;x&quot;: 3.14, # X coordinate.
620 &quot;y&quot;: 3.14, # Y coordinate.
621 },
622 ],
623 &quot;vertices&quot;: [ # The bounding polygon vertices.
624 { # A vertex represents a 2D point in the image.
625 # NOTE: the vertex coordinates are in the same scale as the original image.
626 &quot;x&quot;: 42, # X coordinate.
627 &quot;y&quot;: 42, # Y coordinate.
628 },
629 ],
630 },
631 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
632 # layout is for. e.g. confidence can be for a single token, a table,
633 # a visual element, etc. depending on context. Range [0, 1].
634 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
635 &quot;textSegments&quot;: [ # The text segments from the Document.text.
636 { # A text segment in the Document.text. The indices may be out of bounds
637 # which indicate that the text extends into another document shard for
638 # large sharded documents. See ShardInfo.text_offset
639 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
640 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
641 # Document.text.
642 },
643 ],
644 },
645 },
646 &quot;colSpan&quot;: 42, # How many columns this cell spans.
647 },
648 ],
649 },
650 ],
651 },
652 ],
653 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for the page.
654 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
655 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
656 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
657 { # A vertex represents a 2D point in the image.
658 # NOTE: the normalized vertex coordinates are relative to the original image
659 # and range from 0 to 1.
660 &quot;x&quot;: 3.14, # X coordinate.
661 &quot;y&quot;: 3.14, # Y coordinate.
662 },
663 ],
664 &quot;vertices&quot;: [ # The bounding polygon vertices.
665 { # A vertex represents a 2D point in the image.
666 # NOTE: the vertex coordinates are in the same scale as the original image.
667 &quot;x&quot;: 42, # X coordinate.
668 &quot;y&quot;: 42, # Y coordinate.
669 },
670 ],
671 },
672 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
673 # layout is for. e.g. confidence can be for a single token, a table,
674 # a visual element, etc. depending on context. Range [0, 1].
675 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
676 &quot;textSegments&quot;: [ # The text segments from the Document.text.
677 { # A text segment in the Document.text. The indices may be out of bounds
678 # which indicate that the text extends into another document shard for
679 # large sharded documents. See ShardInfo.text_offset
680 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
681 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
682 # Document.text.
683 },
684 ],
685 },
686 },
687 &quot;lines&quot;: [ # A list of visually detected text lines on the page.
688 # A collection of tokens that a human would perceive as a line.
689 { # A collection of tokens that a human would perceive as a line.
690 # Does not cross column boundaries, can be horizontal, vertical, etc.
691 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for Line.
692 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
693 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
694 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
695 { # A vertex represents a 2D point in the image.
696 # NOTE: the normalized vertex coordinates are relative to the original image
697 # and range from 0 to 1.
698 &quot;x&quot;: 3.14, # X coordinate.
699 &quot;y&quot;: 3.14, # Y coordinate.
700 },
701 ],
702 &quot;vertices&quot;: [ # The bounding polygon vertices.
703 { # A vertex represents a 2D point in the image.
704 # NOTE: the vertex coordinates are in the same scale as the original image.
705 &quot;x&quot;: 42, # X coordinate.
706 &quot;y&quot;: 42, # Y coordinate.
707 },
708 ],
709 },
710 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
711 # layout is for. e.g. confidence can be for a single token, a table,
712 # a visual element, etc. depending on context. Range [0, 1].
713 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
714 &quot;textSegments&quot;: [ # The text segments from the Document.text.
715 { # A text segment in the Document.text. The indices may be out of bounds
716 # which indicate that the text extends into another document shard for
717 # large sharded documents. See ShardInfo.text_offset
718 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
719 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
720 # Document.text.
721 },
722 ],
723 },
724 },
725 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
726 { # Detected language for a structural component.
727 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
728 # information, see
729 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
730 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
731 },
732 ],
733 },
734 ],
735 &quot;paragraphs&quot;: [ # A list of visually detected text paragraphs on the page.
736 # A collection of lines that a human would perceive as a paragraph.
737 { # A collection of lines that a human would perceive as a paragraph.
738 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
739 { # Detected language for a structural component.
740 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
741 # information, see
742 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
743 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
744 },
745 ],
746 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for Paragraph.
747 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
748 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
749 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
750 { # A vertex represents a 2D point in the image.
751 # NOTE: the normalized vertex coordinates are relative to the original image
752 # and range from 0 to 1.
753 &quot;x&quot;: 3.14, # X coordinate.
754 &quot;y&quot;: 3.14, # Y coordinate.
755 },
756 ],
757 &quot;vertices&quot;: [ # The bounding polygon vertices.
758 { # A vertex represents a 2D point in the image.
759 # NOTE: the vertex coordinates are in the same scale as the original image.
760 &quot;x&quot;: 42, # X coordinate.
761 &quot;y&quot;: 42, # Y coordinate.
762 },
763 ],
764 },
765 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
766 # layout is for. e.g. confidence can be for a single token, a table,
767 # a visual element, etc. depending on context. Range [0, 1].
768 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
769 &quot;textSegments&quot;: [ # The text segments from the Document.text.
770 { # A text segment in the Document.text. The indices may be out of bounds
771 # which indicate that the text extends into another document shard for
772 # large sharded documents. See ShardInfo.text_offset
773 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
774 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
775 # Document.text.
776 },
777 ],
778 },
779 },
780 },
781 ],
782 &quot;formFields&quot;: [ # A list of visually detected form fields on the page.
783 { # A form field detected on the page.
784 &quot;valueType&quot;: &quot;A String&quot;, # If the value is non-textual, this field represents the type. Current
785 # valid values are:
786 # - blank (this indicates the field_value is normal text)
787 # - &quot;unfilled_checkbox&quot;
788 # - &quot;filled_checkbox&quot;
789 &quot;fieldName&quot;: { # Visual element describing a layout unit on a page. # Layout for the FormField name. e.g. `Address`, `Email`,
790 # `Grand total`, `Phone number`, etc.
791 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
792 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
793 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
794 { # A vertex represents a 2D point in the image.
795 # NOTE: the normalized vertex coordinates are relative to the original image
796 # and range from 0 to 1.
797 &quot;x&quot;: 3.14, # X coordinate.
798 &quot;y&quot;: 3.14, # Y coordinate.
799 },
800 ],
801 &quot;vertices&quot;: [ # The bounding polygon vertices.
802 { # A vertex represents a 2D point in the image.
803 # NOTE: the vertex coordinates are in the same scale as the original image.
804 &quot;x&quot;: 42, # X coordinate.
805 &quot;y&quot;: 42, # Y coordinate.
806 },
807 ],
808 },
809 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
810 # layout is for. e.g. confidence can be for a single token, a table,
811 # a visual element, etc. depending on context. Range [0, 1].
812 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
813 &quot;textSegments&quot;: [ # The text segments from the Document.text.
814 { # A text segment in the Document.text. The indices may be out of bounds
815 # which indicate that the text extends into another document shard for
816 # large sharded documents. See ShardInfo.text_offset
817 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
818 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
819 # Document.text.
820 },
821 ],
822 },
823 },
824 &quot;nameDetectedLanguages&quot;: [ # A list of detected languages for name together with confidence.
825 { # Detected language for a structural component.
826 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
827 # information, see
828 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
829 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
830 },
831 ],
832 &quot;valueDetectedLanguages&quot;: [ # A list of detected languages for value together with confidence.
833 { # Detected language for a structural component.
834 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
835 # information, see
836 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
837 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
838 },
839 ],
840 &quot;fieldValue&quot;: { # Visual element describing a layout unit on a page. # Layout for the FormField value.
841 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
842 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
843 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
844 { # A vertex represents a 2D point in the image.
845 # NOTE: the normalized vertex coordinates are relative to the original image
846 # and range from 0 to 1.
847 &quot;x&quot;: 3.14, # X coordinate.
848 &quot;y&quot;: 3.14, # Y coordinate.
849 },
850 ],
851 &quot;vertices&quot;: [ # The bounding polygon vertices.
852 { # A vertex represents a 2D point in the image.
853 # NOTE: the vertex coordinates are in the same scale as the original image.
854 &quot;x&quot;: 42, # X coordinate.
855 &quot;y&quot;: 42, # Y coordinate.
856 },
857 ],
858 },
859 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
860 # layout is for. e.g. confidence can be for a single token, a table,
861 # a visual element, etc. depending on context. Range [0, 1].
862 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
863 &quot;textSegments&quot;: [ # The text segments from the Document.text.
864 { # A text segment in the Document.text. The indices may be out of bounds
865 # which indicate that the text extends into another document shard for
866 # large sharded documents. See ShardInfo.text_offset
867 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
868 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
869 # Document.text.
870 },
871 ],
872 },
873 },
874 },
875 ],
876 &quot;blocks&quot;: [ # A list of visually detected text blocks on the page.
877 # A block has a set of lines (collected into paragraphs) that have a common
878 # line-spacing and orientation.
879 { # A block has a set of lines (collected into paragraphs) that have a
880 # common line-spacing and orientation.
881 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for Block.
882 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
883 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
884 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
885 { # A vertex represents a 2D point in the image.
886 # NOTE: the normalized vertex coordinates are relative to the original image
887 # and range from 0 to 1.
888 &quot;x&quot;: 3.14, # X coordinate.
889 &quot;y&quot;: 3.14, # Y coordinate.
890 },
891 ],
892 &quot;vertices&quot;: [ # The bounding polygon vertices.
893 { # A vertex represents a 2D point in the image.
894 # NOTE: the vertex coordinates are in the same scale as the original image.
895 &quot;x&quot;: 42, # X coordinate.
896 &quot;y&quot;: 42, # Y coordinate.
897 },
898 ],
899 },
900 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
901 # layout is for. e.g. confidence can be for a single token, a table,
902 # a visual element, etc. depending on context. Range [0, 1].
903 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
904 &quot;textSegments&quot;: [ # The text segments from the Document.text.
905 { # A text segment in the Document.text. The indices may be out of bounds
906 # which indicate that the text extends into another document shard for
907 # large sharded documents. See ShardInfo.text_offset
908 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
909 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
910 # Document.text.
911 },
912 ],
913 },
914 },
915 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
916 { # Detected language for a structural component.
917 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
918 # information, see
919 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
920 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
921 },
922 ],
923 },
924 ],
925 &quot;tokens&quot;: [ # A list of visually detected tokens on the page.
926 { # A detected token.
927 &quot;detectedBreak&quot;: { # Detected break at the end of a Token. # Detected break at the end of a Token.
928 &quot;type&quot;: &quot;A String&quot;, # Detected break type.
929 },
930 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
931 { # Detected language for a structural component.
932 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
933 # information, see
934 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
935 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
936 },
937 ],
938 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for Token.
939 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
940 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
941 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
942 { # A vertex represents a 2D point in the image.
943 # NOTE: the normalized vertex coordinates are relative to the original image
944 # and range from 0 to 1.
945 &quot;x&quot;: 3.14, # X coordinate.
946 &quot;y&quot;: 3.14, # Y coordinate.
947 },
948 ],
949 &quot;vertices&quot;: [ # The bounding polygon vertices.
950 { # A vertex represents a 2D point in the image.
951 # NOTE: the vertex coordinates are in the same scale as the original image.
952 &quot;x&quot;: 42, # X coordinate.
953 &quot;y&quot;: 42, # Y coordinate.
954 },
955 ],
956 },
957 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
958 # layout is for. e.g. confidence can be for a single token, a table,
959 # a visual element, etc. depending on context. Range [0, 1].
960 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
961 &quot;textSegments&quot;: [ # The text segments from the Document.text.
962 { # A text segment in the Document.text. The indices may be out of bounds
963 # which indicate that the text extends into another document shard for
964 # large sharded documents. See ShardInfo.text_offset
965 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
966 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
967 # Document.text.
968 },
969 ],
970 },
971 },
972 },
973 ],
974 &quot;pageNumber&quot;: 42, # 1-based index for current Page in a parent Document.
975 # Useful when a page is taken out of a Document for individual
976 # processing.
977 &quot;visualElements&quot;: [ # A list of detected non-text visual elements e.g. checkbox,
978 # signature etc. on the page.
979 { # Detected non-text visual elements e.g. checkbox, signature etc. on the
980 # page.
981 &quot;detectedLanguages&quot;: [ # A list of detected languages together with confidence.
982 { # Detected language for a structural component.
983 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
984 # information, see
985 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
986 &quot;confidence&quot;: 3.14, # Confidence of detected language. Range [0, 1].
987 },
988 ],
989 &quot;type&quot;: &quot;A String&quot;, # Type of the VisualElement.
990 &quot;layout&quot;: { # Visual element describing a layout unit on a page. # Layout for VisualElement.
991 &quot;orientation&quot;: &quot;A String&quot;, # Detected orientation for the Layout.
992 &quot;boundingPoly&quot;: { # A bounding polygon for the detected image annotation. # The bounding polygon for the Layout.
993 &quot;normalizedVertices&quot;: [ # The bounding polygon normalized vertices.
994 { # A vertex represents a 2D point in the image.
995 # NOTE: the normalized vertex coordinates are relative to the original image
996 # and range from 0 to 1.
997 &quot;x&quot;: 3.14, # X coordinate.
998 &quot;y&quot;: 3.14, # Y coordinate.
999 },
1000 ],
1001 &quot;vertices&quot;: [ # The bounding polygon vertices.
1002 { # A vertex represents a 2D point in the image.
1003 # NOTE: the vertex coordinates are in the same scale as the original image.
1004 &quot;x&quot;: 42, # X coordinate.
1005 &quot;y&quot;: 42, # Y coordinate.
1006 },
1007 ],
1008 },
1009 &quot;confidence&quot;: 3.14, # Confidence of the current Layout within context of the object this
1010 # layout is for. e.g. confidence can be for a single token, a table,
1011 # a visual element, etc. depending on context. Range [0, 1].
1012 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
1013 &quot;textSegments&quot;: [ # The text segments from the Document.text.
1014 { # A text segment in the Document.text. The indices may be out of bounds
1015 # which indicate that the text extends into another document shard for
1016 # large sharded documents. See ShardInfo.text_offset
1017 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
1018 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
1019 # Document.text.
1020 },
1021 ],
1022 },
1023 },
1024 },
1025 ],
1026 },
1027 ],
1028 &quot;text&quot;: &quot;A String&quot;, # UTF-8 encoded text in reading order from the document.
1029 &quot;mimeType&quot;: &quot;A String&quot;, # An IANA published MIME type (also referred to as media type). For more
1030 # information, see
1031 # https://www.iana.org/assignments/media-types/media-types.xhtml.
1032 &quot;entityRelations&quot;: [ # Relationship among Document.entities.
1033 { # Relationship between Entities.
1034 &quot;objectId&quot;: &quot;A String&quot;, # Object entity id.
1035 &quot;relation&quot;: &quot;A String&quot;, # Relationship description.
1036 &quot;subjectId&quot;: &quot;A String&quot;, # Subject entity id.
1037 },
1038 ],
1039 &quot;translations&quot;: [ # A list of translations on Document.text. For document shards,
1040 # translations in this list may cross shard boundaries.
1041 { # A translation of the text segment.
1042 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Provenance of the translation.
1043 # Text anchor indexing into the Document.text.
1044 &quot;textSegments&quot;: [ # The text segments from the Document.text.
1045 { # A text segment in the Document.text. The indices may be out of bounds
1046 # which indicate that the text extends into another document shard for
1047 # large sharded documents. See ShardInfo.text_offset
1048 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
1049 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
1050 # Document.text.
1051 },
1052 ],
1053 },
1054 &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more
1055 # information, see
1056 # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1057 &quot;translatedText&quot;: &quot;A String&quot;, # Text translated into the target language.
1058 },
1059 ],
1060 &quot;shardInfo&quot;: { # For a large document, sharding may be performed to produce several # Information about the sharding if this document is sharded part of a larger
1061 # document. If the document is not sharded, this message is not specified.
1062 # document shards. Each document shard contains this field to detail which
1063 # shard it is.
1064 &quot;shardIndex&quot;: &quot;A String&quot;, # The 0-based index of this shard.
1065 &quot;textOffset&quot;: &quot;A String&quot;, # The index of the first character in Document.text in the overall
1066 # document global text.
1067 &quot;shardCount&quot;: &quot;A String&quot;, # Total number of shards.
1068 },
1069 &quot;textStyles&quot;: [ # Styles for the Document.text.
1070 { # Annotation for common text style attributes. This adheres to CSS
1071 # conventions as much as possible.
1072 &quot;fontWeight&quot;: &quot;A String&quot;, # Font weight. Possible values are normal, bold, bolder, and lighter.
1073 # https://www.w3schools.com/cssref/pr_font_weight.asp
1074 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Text anchor indexing into the Document.text.
1075 &quot;textSegments&quot;: [ # The text segments from the Document.text.
1076 { # A text segment in the Document.text. The indices may be out of bounds
1077 # which indicate that the text extends into another document shard for
1078 # large sharded documents. See ShardInfo.text_offset
1079 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
1080 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
1081 # Document.text.
1082 },
1083 ],
1084 },
1085 &quot;textDecoration&quot;: &quot;A String&quot;, # Text decoration. Follows CSS standard.
1086 # &lt;text-decoration-line&gt; &lt;text-decoration-color&gt; &lt;text-decoration-style&gt;
1087 # https://www.w3schools.com/cssref/pr_text_text-decoration.asp
1088 &quot;color&quot;: { # Represents a color in the RGBA color space. This representation is designed # Text color.
1089 # for simplicity of conversion to/from color representations in various
1090 # languages over compactness; for example, the fields of this representation
1091 # can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
1092 # can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
1093 # method in iOS; and, with just a little work, it can be easily formatted into
1094 # a CSS &quot;rgba()&quot; string in JavaScript, as well.
1095 #
1096 # Note: this proto does not carry information about the absolute color space
1097 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
1098 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
1099 # space.
1100 #
1101 # Note: when color equality needs to be decided, implementations, unless
1102 # documented otherwise, will treat two colors to be equal if all their red,
1103 # green, blue and alpha values each differ by at most 1e-5.
1104 #
1105 # Example (Java):
1106 #
1107 # import com.google.type.Color;
1108 #
1109 # // ...
1110 # public static java.awt.Color fromProto(Color protocolor) {
1111 # float alpha = protocolor.hasAlpha()
1112 # ? protocolor.getAlpha().getValue()
1113 # : 1.0;
1114 #
1115 # return new java.awt.Color(
1116 # protocolor.getRed(),
1117 # protocolor.getGreen(),
1118 # protocolor.getBlue(),
1119 # alpha);
1120 # }
1121 #
1122 # public static Color toProto(java.awt.Color color) {
1123 # float red = (float) color.getRed();
1124 # float green = (float) color.getGreen();
1125 # float blue = (float) color.getBlue();
1126 # float denominator = 255.0;
1127 # Color.Builder resultBuilder =
1128 # Color
1129 # .newBuilder()
1130 # .setRed(red / denominator)
1131 # .setGreen(green / denominator)
1132 # .setBlue(blue / denominator);
1133 # int alpha = color.getAlpha();
1134 # if (alpha != 255) {
1135 # result.setAlpha(
1136 # FloatValue
1137 # .newBuilder()
1138 # .setValue(((float) alpha) / denominator)
1139 # .build());
1140 # }
1141 # return resultBuilder.build();
1142 # }
1143 # // ...
1144 #
1145 # Example (iOS / Obj-C):
1146 #
1147 # // ...
1148 # static UIColor* fromProto(Color* protocolor) {
1149 # float red = [protocolor red];
1150 # float green = [protocolor green];
1151 # float blue = [protocolor blue];
1152 # FloatValue* alpha_wrapper = [protocolor alpha];
1153 # float alpha = 1.0;
1154 # if (alpha_wrapper != nil) {
1155 # alpha = [alpha_wrapper value];
1156 # }
1157 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
1158 # }
1159 #
1160 # static Color* toProto(UIColor* color) {
1161 # CGFloat red, green, blue, alpha;
1162 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
1163 # return nil;
1164 # }
1165 # Color* result = [[Color alloc] init];
1166 # [result setRed:red];
1167 # [result setGreen:green];
1168 # [result setBlue:blue];
1169 # if (alpha &lt;= 0.9999) {
1170 # [result setAlpha:floatWrapperWithValue(alpha)];
1171 # }
1172 # [result autorelease];
1173 # return result;
1174 # }
1175 # // ...
1176 #
1177 # Example (JavaScript):
1178 #
1179 # // ...
1180 #
1181 # var protoToCssColor = function(rgb_color) {
1182 # var redFrac = rgb_color.red || 0.0;
1183 # var greenFrac = rgb_color.green || 0.0;
1184 # var blueFrac = rgb_color.blue || 0.0;
1185 # var red = Math.floor(redFrac * 255);
1186 # var green = Math.floor(greenFrac * 255);
1187 # var blue = Math.floor(blueFrac * 255);
1188 #
1189 # if (!(&#x27;alpha&#x27; in rgb_color)) {
1190 # return rgbToCssColor_(red, green, blue);
1191 # }
1192 #
1193 # var alphaFrac = rgb_color.alpha.value || 0.0;
1194 # var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
1195 # return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
1196 # };
1197 #
1198 # var rgbToCssColor_ = function(red, green, blue) {
1199 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
1200 # var hexString = rgbNumber.toString(16);
1201 # var missingZeros = 6 - hexString.length;
1202 # var resultBuilder = [&#x27;#&#x27;];
1203 # for (var i = 0; i &lt; missingZeros; i++) {
1204 # resultBuilder.push(&#x27;0&#x27;);
1205 # }
1206 # resultBuilder.push(hexString);
1207 # return resultBuilder.join(&#x27;&#x27;);
1208 # };
1209 #
1210 # // ...
1211 &quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is,
1212 # the final pixel color is defined by the equation:
1213 #
1214 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
1215 #
1216 # This means that a value of 1.0 corresponds to a solid color, whereas
1217 # a value of 0.0 corresponds to a completely transparent color. This
1218 # uses a wrapper message rather than a simple float scalar so that it is
1219 # possible to distinguish between a default value and the value being unset.
1220 # If omitted, this color object is to be rendered as a solid color
1221 # (as if the alpha value had been explicitly given with a value of 1.0).
1222 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
1223 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
1224 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
1225 },
1226 &quot;fontSize&quot;: { # Font size with unit. # Font size.
1227 &quot;size&quot;: 3.14, # Font size for the text.
1228 &quot;unit&quot;: &quot;A String&quot;, # Unit for the font size. Follows CSS naming (in, px, pt, etc.).
1229 },
1230 &quot;backgroundColor&quot;: { # Represents a color in the RGBA color space. This representation is designed # Text background color.
1231 # for simplicity of conversion to/from color representations in various
1232 # languages over compactness; for example, the fields of this representation
1233 # can be trivially provided to the constructor of &quot;java.awt.Color&quot; in Java; it
1234 # can also be trivially provided to UIColor&#x27;s &quot;+colorWithRed:green:blue:alpha&quot;
1235 # method in iOS; and, with just a little work, it can be easily formatted into
1236 # a CSS &quot;rgba()&quot; string in JavaScript, as well.
1237 #
1238 # Note: this proto does not carry information about the absolute color space
1239 # that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB,
1240 # DCI-P3, BT.2020, etc.). By default, applications SHOULD assume the sRGB color
1241 # space.
1242 #
1243 # Note: when color equality needs to be decided, implementations, unless
1244 # documented otherwise, will treat two colors to be equal if all their red,
1245 # green, blue and alpha values each differ by at most 1e-5.
1246 #
1247 # Example (Java):
1248 #
1249 # import com.google.type.Color;
1250 #
1251 # // ...
1252 # public static java.awt.Color fromProto(Color protocolor) {
1253 # float alpha = protocolor.hasAlpha()
1254 # ? protocolor.getAlpha().getValue()
1255 # : 1.0;
1256 #
1257 # return new java.awt.Color(
1258 # protocolor.getRed(),
1259 # protocolor.getGreen(),
1260 # protocolor.getBlue(),
1261 # alpha);
1262 # }
1263 #
1264 # public static Color toProto(java.awt.Color color) {
1265 # float red = (float) color.getRed();
1266 # float green = (float) color.getGreen();
1267 # float blue = (float) color.getBlue();
1268 # float denominator = 255.0;
1269 # Color.Builder resultBuilder =
1270 # Color
1271 # .newBuilder()
1272 # .setRed(red / denominator)
1273 # .setGreen(green / denominator)
1274 # .setBlue(blue / denominator);
1275 # int alpha = color.getAlpha();
1276 # if (alpha != 255) {
1277 # result.setAlpha(
1278 # FloatValue
1279 # .newBuilder()
1280 # .setValue(((float) alpha) / denominator)
1281 # .build());
1282 # }
1283 # return resultBuilder.build();
1284 # }
1285 # // ...
1286 #
1287 # Example (iOS / Obj-C):
1288 #
1289 # // ...
1290 # static UIColor* fromProto(Color* protocolor) {
1291 # float red = [protocolor red];
1292 # float green = [protocolor green];
1293 # float blue = [protocolor blue];
1294 # FloatValue* alpha_wrapper = [protocolor alpha];
1295 # float alpha = 1.0;
1296 # if (alpha_wrapper != nil) {
1297 # alpha = [alpha_wrapper value];
1298 # }
1299 # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
1300 # }
1301 #
1302 # static Color* toProto(UIColor* color) {
1303 # CGFloat red, green, blue, alpha;
1304 # if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) {
1305 # return nil;
1306 # }
1307 # Color* result = [[Color alloc] init];
1308 # [result setRed:red];
1309 # [result setGreen:green];
1310 # [result setBlue:blue];
1311 # if (alpha &lt;= 0.9999) {
1312 # [result setAlpha:floatWrapperWithValue(alpha)];
1313 # }
1314 # [result autorelease];
1315 # return result;
1316 # }
1317 # // ...
1318 #
1319 # Example (JavaScript):
1320 #
1321 # // ...
1322 #
1323 # var protoToCssColor = function(rgb_color) {
1324 # var redFrac = rgb_color.red || 0.0;
1325 # var greenFrac = rgb_color.green || 0.0;
1326 # var blueFrac = rgb_color.blue || 0.0;
1327 # var red = Math.floor(redFrac * 255);
1328 # var green = Math.floor(greenFrac * 255);
1329 # var blue = Math.floor(blueFrac * 255);
1330 #
1331 # if (!(&#x27;alpha&#x27; in rgb_color)) {
1332 # return rgbToCssColor_(red, green, blue);
1333 # }
1334 #
1335 # var alphaFrac = rgb_color.alpha.value || 0.0;
1336 # var rgbParams = [red, green, blue].join(&#x27;,&#x27;);
1337 # return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;);
1338 # };
1339 #
1340 # var rgbToCssColor_ = function(red, green, blue) {
1341 # var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue);
1342 # var hexString = rgbNumber.toString(16);
1343 # var missingZeros = 6 - hexString.length;
1344 # var resultBuilder = [&#x27;#&#x27;];
1345 # for (var i = 0; i &lt; missingZeros; i++) {
1346 # resultBuilder.push(&#x27;0&#x27;);
1347 # }
1348 # resultBuilder.push(hexString);
1349 # return resultBuilder.join(&#x27;&#x27;);
1350 # };
1351 #
1352 # // ...
1353 &quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is,
1354 # the final pixel color is defined by the equation:
1355 #
1356 # pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
1357 #
1358 # This means that a value of 1.0 corresponds to a solid color, whereas
1359 # a value of 0.0 corresponds to a completely transparent color. This
1360 # uses a wrapper message rather than a simple float scalar so that it is
1361 # possible to distinguish between a default value and the value being unset.
1362 # If omitted, this color object is to be rendered as a solid color
1363 # (as if the alpha value had been explicitly given with a value of 1.0).
1364 &quot;blue&quot;: 3.14, # The amount of blue in the color as a value in the interval [0, 1].
1365 &quot;green&quot;: 3.14, # The amount of green in the color as a value in the interval [0, 1].
1366 &quot;red&quot;: 3.14, # The amount of red in the color as a value in the interval [0, 1].
1367 },
1368 &quot;textStyle&quot;: &quot;A String&quot;, # Text style. Possible values are normal, italic, and oblique.
1369 # https://www.w3schools.com/cssref/pr_font_font-style.asp
1370 },
1371 ],
1372 &quot;entities&quot;: [ # A list of entities detected on Document.text. For document shards,
1373 # entities in this list may cross shard boundaries.
1374 { # A phrase in the text that is a known entity type, such as a person, an
1375 # organization, or location.
1376 &quot;textAnchor&quot;: { # Text reference indexing into the Document.text. # Provenance of the entity.
1377 # Text anchor indexing into the Document.text.
1378 &quot;textSegments&quot;: [ # The text segments from the Document.text.
1379 { # A text segment in the Document.text. The indices may be out of bounds
1380 # which indicate that the text extends into another document shard for
1381 # large sharded documents. See ShardInfo.text_offset
1382 &quot;startIndex&quot;: &quot;A String&quot;, # TextSegment start UTF-8 char index in the Document.text.
1383 &quot;endIndex&quot;: &quot;A String&quot;, # TextSegment half open end UTF-8 char index in the
1384 # Document.text.
1385 },
1386 ],
1387 },
1388 &quot;mentionId&quot;: &quot;A String&quot;, # Deprecated. Use `id` field instead.
1389 &quot;type&quot;: &quot;A String&quot;, # Entity type from a schema e.g. `Address`.
1390 &quot;confidence&quot;: 3.14, # Optional. Confidence of detected Schema entity. Range [0, 1].
1391 &quot;mentionText&quot;: &quot;A String&quot;, # Text value in the document e.g. `1600 Amphitheatre Pkwy`.
1392 },
1393 ],
1394 }</pre>
1395</div>
1396
1397</body></html>