Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added TrainProcessorVersion, EvaluateProcessorVersion, GetEvaluation, and ListEvaluations v1beta3 APIs #3632

Merged
merged 9 commits into from
Dec 9, 2022
Merged
4 changes: 4 additions & 0 deletions packages/google-cloud-documentai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,19 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
| Document_processor_service.deploy_processor_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.deploy_processor_version.js,samples/README.md) |
| Document_processor_service.disable_processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.disable_processor.js,samples/README.md) |
| Document_processor_service.enable_processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.enable_processor.js,samples/README.md) |
| Document_processor_service.evaluate_processor_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.evaluate_processor_version.js,samples/README.md) |
| Document_processor_service.fetch_processor_types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.fetch_processor_types.js,samples/README.md) |
| Document_processor_service.get_evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_evaluation.js,samples/README.md) |
| Document_processor_service.get_processor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor.js,samples/README.md) |
| Document_processor_service.get_processor_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.get_processor_version.js,samples/README.md) |
| Document_processor_service.list_evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_evaluations.js,samples/README.md) |
| Document_processor_service.list_processor_types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_types.js,samples/README.md) |
| Document_processor_service.list_processor_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processor_versions.js,samples/README.md) |
| Document_processor_service.list_processors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.list_processors.js,samples/README.md) |
| Document_processor_service.process_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.process_document.js,samples/README.md) |
| Document_processor_service.review_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.review_document.js,samples/README.md) |
| Document_processor_service.set_default_processor_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.set_default_processor_version.js,samples/README.md) |
| Document_processor_service.train_processor_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.train_processor_version.js,samples/README.md) |
| Document_processor_service.undeploy_processor_version | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/generated/v1beta3/document_processor_service.undeploy_processor_version.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/quickstart.js,samples/README.md) |
| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-documentai/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-documentai/samples/test/quickstart.test.js,samples/README.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,42 @@ option ruby_package = "Google::Cloud::DocumentAI::V1beta3";
message Barcode {
// Format of a barcode.
// The supported formats are:
// CODE_128: Code 128 type.
// CODE_39: Code 39 type.
// CODE_93: Code 93 type.
// CODABAR: Codabar type.
// DATA_MATRIX: 2D Data Matrix type.
// ITF: ITF type.
// EAN_13: EAN-13 type.
// EAN_8: EAN-8 type.
// QR_CODE: 2D QR code type.
// UPC_A: UPC-A type.
// UPC_E: UPC-E type.
// PDF417: PDF417 type.
// AZTEC: 2D Aztec code type.
// DATABAR: GS1 DataBar code type.
//
// - `CODE_128`: Code 128 type.
// - `CODE_39`: Code 39 type.
// - `CODE_93`: Code 93 type.
// - `CODABAR`: Codabar type.
// - `DATA_MATRIX`: 2D Data Matrix type.
// - `ITF`: ITF type.
// - `EAN_13`: EAN-13 type.
// - `EAN_8`: EAN-8 type.
// - `QR_CODE`: 2D QR code type.
// - `UPC_A`: UPC-A type.
// - `UPC_E`: UPC-E type.
// - `PDF417`: PDF417 type.
// - `AZTEC`: 2D Aztec code type.
// - `DATABAR`: GS1 DataBar code type.
string format = 1;

// Value format describes the format of the value that a barcode
// encodes.
// The supported formats are:
// CONTACT_INFO: Contact information.
// EMAIL: Email address.
// ISBN: ISBN identifier.
// PHONE: Phone number.
// PRODUCT: Product.
// SMS: SMS message.
// TEXT: Text string.
// URL: URL address.
// WIFI: Wifi information.
// GEO: Geo-localization.
// CALENDAR_EVENT: Calendar event.
// DRIVER_LICENSE: Driver's license.
//
// - `CONTACT_INFO`: Contact information.
// - `EMAIL`: Email address.
// - `ISBN`: ISBN identifier.
// - `PHONE`: Phone number.
// - `PRODUCT`: Product.
// - `SMS`: SMS message.
// - `TEXT`: Text string.
// - `URL`: URL address.
// - `WIFI`: Wifi information.
// - `GEO`: Geo-localization.
// - `CALENDAR_EVENT`: Calendar event.
// - `DRIVER_LICENSE`: Driver's license.
string value_format = 2;

// Raw value encoded in the barcode.
// For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'.
// For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`.
string raw_value = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ message Document {

// Font size.
FontSize font_size = 7;

// Font family such as `Arial`, `Times New Roman`.
// https://www.w3schools.com/cssref/pr_font_font-family.asp
string font_family = 8;
}

// A page in a [Document][google.cloud.documentai.v1beta3.Document].
Expand Down Expand Up @@ -169,7 +173,7 @@ message Document {

// Confidence of the current [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] within context of the object this
// layout is for. e.g. confidence can be for a single token, a table,
// a visual element, etc. depending on context. Range [0, 1].
// a visual element, etc. depending on context. Range `[0, 1]`.
float confidence = 2;

// The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout].
Expand All @@ -189,7 +193,7 @@ message Document {
repeated DetectedLanguage detected_languages = 2;

// The history of this annotation.
Provenance provenance = 3;
Provenance provenance = 3 [deprecated = true];
}

// A collection of lines that a human would perceive as a paragraph.
Expand All @@ -201,7 +205,7 @@ message Document {
repeated DetectedLanguage detected_languages = 2;

// The history of this annotation.
Provenance provenance = 3;
Provenance provenance = 3 [deprecated = true];
}

// A collection of tokens that a human would perceive as a line.
Expand All @@ -214,7 +218,7 @@ message Document {
repeated DetectedLanguage detected_languages = 2;

// The history of this annotation.
Provenance provenance = 3;
Provenance provenance = 3 [deprecated = true];
}

// A detected token.
Expand Down Expand Up @@ -249,8 +253,8 @@ message Document {
// A list of detected languages together with confidence.
repeated DetectedLanguage detected_languages = 3;

// The history of this annotation.
Provenance provenance = 4;
// The history of this annotation.
Provenance provenance = 4 [deprecated = true];
}

// A detected symbol.
Expand Down Expand Up @@ -309,6 +313,9 @@ message Document {

// A list of detected languages together with confidence.
repeated DetectedLanguage detected_languages = 4;

// The history of this table.
Provenance provenance = 5;
}

// A form field detected on the page.
Expand Down Expand Up @@ -358,15 +365,43 @@ message Document {

// Detected language for a structural component.
message DetectedLanguage {
// The BCP-47 language code, such as "en-US" or "sr-Latn". For more
// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more
// information, see
// https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
string language_code = 1;

// Confidence of detected language. Range [0, 1].
// Confidence of detected language. Range `[0, 1]`.
float confidence = 2;
}

// Image Quality Scores for the page image
message ImageQualityScores {
// Image Quality Defects
message DetectedDefect {
// Name of the defect type. Supported values are:
//
// - `quality/defect_blurry`
// - `quality/defect_noisy`
// - `quality/defect_dark`
// - `quality/defect_faint`
// - `quality/defect_text_too_small`
// - `quality/defect_document_cutoff`
// - `quality/defect_text_cutoff`
// - `quality/defect_glare`
string type = 1;

// Confidence of detected defect. Range `[0, 1]` where 1 indicates
// strong confidence of that the defect exists.
float confidence = 2;
}

// The overall quality score. Range `[0, 1]` where 1 is perfect quality.
float quality_score = 1;

// A list of detected defects.
repeated DetectedDefect detected_defects = 2;
}

// 1-based index for current [Page][google.cloud.documentai.v1beta3.Document.Page] in a parent [Document][google.cloud.documentai.v1beta3.Document].
// Useful when a page is taken out of a [Document][google.cloud.documentai.v1beta3.Document] for individual
// processing.
Expand Down Expand Up @@ -422,8 +457,11 @@ message Document {
// A list of detected barcodes.
repeated DetectedBarcode detected_barcodes = 15;

// Image Quality Scores.
ImageQualityScores image_quality_scores = 17;

// The history of this page.
Provenance provenance = 16;
Provenance provenance = 16 [deprecated = true];
}

// An entity that could be a phrase in the text or a property that belongs to
Expand Down Expand Up @@ -471,6 +509,7 @@ message Document {
// or int normalized text by default.
//
// Below are sample formats mapped to structured values.
//
// - Money/Currency type (`money_value`) is in the ISO 4217 text format.
// - Date type (`date_value`) is in the ISO 8601 text format.
// - Datetime type (`datetime_value`) is in the ISO 8601 text format.
Expand All @@ -484,14 +523,13 @@ message Document {
// Required. Entity type from a schema e.g. `Address`.
string type = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity
// is not present in the document, this field will be empty.
// Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`.
string mention_text = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. Deprecated. Use `id` field instead.
string mention_id = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. Confidence of detected Schema entity. Range [0, 1].
// Optional. Confidence of detected Schema entity. Range `[0, 1]`.
float confidence = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. Represents the provenance of this entity wrt. the location on the
Expand Down Expand Up @@ -605,7 +643,7 @@ message Document {
// Optional. Identifies the bounding polygon of a layout element on the page.
BoundingPoly bounding_poly = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. Confidence of detected page element, if applicable. Range [0, 1].
// Optional. Confidence of detected page element, if applicable. Range `[0, 1]`.
float confidence = 5 [(google.api.field_behavior) = OPTIONAL];
}

Expand Down Expand Up @@ -726,7 +764,7 @@ message Document {
string changed_text = 2;

// The history of this annotation.
repeated Provenance provenance = 3;
repeated Provenance provenance = 3 [deprecated = true];
}

// Original source document from the user.
Expand Down Expand Up @@ -765,9 +803,9 @@ message Document {
// Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1beta3.Document.entities].
repeated EntityRelation entity_relations = 8;

// Placeholder. A list of text corrections made to [Document.text]. This is
// usually used for annotating corrections to OCR mistakes. Text changes for
// a given revision may not overlap with each other.
// Placeholder. A list of text corrections made to [Document.text][google.cloud.documentai.v1beta3.Document.text]. This
// is usually used for annotating corrections to OCR mistakes. Text changes
// for a given revision may not overlap with each other.
repeated TextChange text_changes = 14;

// Information about the sharding if this document is sharded part of a larger
Expand Down
Loading