Skip to content

Commit 1a87094

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added new messages EntityValidationOutput and EntitiesRevision
feat: Added new fields `entity_validation_output`, `entities_revisions`, and `entities_revision_id` to the `Document` message docs: The field `training_method` in `TrainProcessorVersionRequest` is now marked as optional PiperOrigin-RevId: 816853859
1 parent 50a2632 commit 1a87094

File tree

2 files changed

+74
-2
lines changed

2 files changed

+74
-2
lines changed

google/cloud/documentai/v1/document.proto

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,62 @@ message Document {
10691069
repeated Chunk chunks = 1;
10701070
}
10711071

1072+
// The output of the validation given the document and the validation rules.
1073+
message EntityValidationOutput {
1074+
// Validation result for a single validation rule.
1075+
message ValidationResult {
1076+
// The result of the validation rule.
1077+
enum ValidationResultType {
1078+
// The validation result type is unspecified.
1079+
VALIDATION_RESULT_TYPE_UNSPECIFIED = 0;
1080+
1081+
// The validation is valid.
1082+
VALIDATION_RESULT_TYPE_VALID = 1;
1083+
1084+
// The validation is invalid.
1085+
VALIDATION_RESULT_TYPE_INVALID = 2;
1086+
1087+
// The validation is skipped.
1088+
VALIDATION_RESULT_TYPE_SKIPPED = 3;
1089+
1090+
// The validation is not applicable.
1091+
VALIDATION_RESULT_TYPE_NOT_APPLICABLE = 4;
1092+
}
1093+
1094+
// The name of the validation rule.
1095+
string rule_name = 1;
1096+
1097+
// The description of the validation rule.
1098+
string rule_description = 2;
1099+
1100+
// The result of the validation rule.
1101+
ValidationResultType validation_result_type = 3;
1102+
1103+
// The detailed information of the running the validation process using
1104+
// the entity from the document based on the validation rule.
1105+
string validation_details = 4;
1106+
}
1107+
1108+
// The result of each validation rule.
1109+
repeated ValidationResult validation_results = 1;
1110+
1111+
// The overall result of the validation, true if all applicable rules are
1112+
// valid.
1113+
bool pass_all_rules = 2;
1114+
}
1115+
1116+
// Entity revision.
1117+
message EntitiesRevision {
1118+
// The revision id.
1119+
string revision_id = 1;
1120+
1121+
// The entities in this revision.
1122+
repeated Entity entities = 2;
1123+
1124+
// The entity validation output for this revision.
1125+
EntityValidationOutput entity_validation_output = 3;
1126+
}
1127+
10721128
// Original source document from the user.
10731129
oneof source {
10741130
// Optional. Currently supports Google Cloud Storage URI of the form
@@ -1129,4 +1185,20 @@ message Document {
11291185

11301186
// Document chunked based on chunking config.
11311187
ChunkedDocument chunked_document = 18;
1188+
1189+
// The entity validation output for the document. This is the validation
1190+
// output for `document.entities` field.
1191+
EntityValidationOutput entity_validation_output = 21;
1192+
1193+
// A list of entity revisions. The entity revisions are appended to the
1194+
// document in the processing order. This field can be used for comparing the
1195+
// entity extraction results at different stages of the processing.
1196+
repeated EntitiesRevision entities_revisions = 22;
1197+
1198+
// The entity revision id that `document.entities` field is based on.
1199+
// If this field is set and `entities_revisions` is not empty, the entities in
1200+
// `document.entities` field are the entities in the entity revision with this
1201+
// id and `document.entity_validation_output` field is the
1202+
// `entity_validation_output` field in this entity revision.
1203+
string entities_revision_id = 23;
11321204
}

google/cloud/documentai/v1/document_processor_service.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,8 +1008,8 @@ message TrainProcessorVersionRequest {
10081008
TEMPLATE_BASED = 2;
10091009
}
10101010

1011-
// Training method to use for CDE training.
1012-
TrainingMethod training_method = 3;
1011+
// Optional. Training method to use for CDE training.
1012+
TrainingMethod training_method = 3 [(google.api.field_behavior) = OPTIONAL];
10131013
}
10141014

10151015
// Options to control foundation model tuning of the processor.

0 commit comments

Comments
 (0)