Rules
Following are the configurations and details on how to use different rules in process flows:
Regex Rule
Regex validation rule can be used for validating if a regex expression is present in the specified target key. Regex extraction rule can be used for extracting the value specified in the first target group in the regex expression and storing the extracted value in the specified target key.
Filter Rule
Filter rule can be used for validating whether the value corresponding to the specified target key passes the specified filter condition. Currently supported operators are [gte, ge, eq, ne, lt, lte, in]. For all operators except 'eq' and 'in', the values corresponding to the key must be numeric or else the rule will fail. For the 'in' operator, user can specify a list of comma separated values. If the value for the key matches with any of the Values specified in the rule, the filter condition is satisfied.
Substring Rule
This rule can be used for extracting only a substring with specified start and end indexes from the value corresponding to a target key
Concat Rule
This rule can be used for concatenating values corresponding to a list of keys specified in the rule. Users can define the list of keys using a comma separated string. Users also need to specify a delimiter by which these values will be concatenated. If the value corresponding to one of the keys in the list is not found, it would be returned in the result as null
Transformations Rule
This rule can be used to transform the values corresponding to a specified target key. Currently supported transformation operations include:
- rename - Rename the value
- make-uppercase/make-lowercase - Make the resulting value uppercase or lowercase
- add/remove prefix/suffix - Add or remove a prefix/suffix in the value
- replace prefix/suffix - Replace prefix or suffix(if present) in the value
Key Transformations Rule
This rule can be used to transform the specified target key. Currently supported transformation operations include:
- rename - Rename the key
- make-uppercase/make-lowercase - Make the specified key uppercase or lowercase
- add/remove prefix/suffix - Add or remove a prefix/suffix to the key
- replace prefix/suffix - Replace prefix or suffix(if present) in the key
Key Mapping Rule
This rule can used to map values corresponding to a list of keys to the specified target key. The first non-null value corresponding to a key specified in the key list would be mapped back.
Confidence Score Rule
This value can be used for validating the confidence score for a key that is returned in the OCR results. This rule is applicable only to files generated by Textract Engines. If a file processed by any Models is selected for this rule, it will be skipped from processing.
Textract Queries Rule
This rule utilizes the AWS Textract 'Queries' feature to map the results of a textual query to a target key. The first non-null value returned in the Textract result will be mapped back accordingly. This rule is applicable only to files generated by Textract Engines.
If a file processed by any Models is selected for the Confidence-Score rule or the Textract-Queries rule, it will be skipped from processing.
Query Model Rule
This rule enables querying the extracted output using OpenAI or Bedrock models. Users must provide an efficient prompt to obtain the desired results, which will then be mapped to the selected target key. This rule applies only to files whose output is generated by Bedrock or OpenAI models.
If a file processed by the Textract or None engine is selected for this Query-Model rule, it will be skipped from processing.