Real-time validation
Add real-time human-in-the-loop validation to predictions.

How it works

Getting started

To upload documents under the conditional validation workflow, a few changes to the standard fileupload form-data parameters are required:
  • Specify the validation workflow type by setting: workflowId=validate
  • Specify the fieldSet or fieldSets parameter to predict against
  • Configure the workflowOptions according to the required validation rules
Validation workflows are a BETA feature and subject to change. This guide is under-construction.
Sample Postman configuration for a file-upload with the validate workflow

Validation Parameters

Workflow options are strings which contain a JSON-formatted object that controls how the steps in the validation workflow are executed. Here's a sample workflowOptions string which validates the confidence of the bpay.crn field:
1
{
2
"prediction":{
3
"fieldset": "sypht.bpay",
4
"conditions":[
5
{
6
"type": "field-confidence-range",
7
"field": "bpay.crn",
8
"min": 0.5
9
}
10
],
11
"createTask":{
12
"submit": true,
13
"priority": 1
14
}
15
}
16
}
Copied!
For the sample above, extractions which include a bpay.crn with confidence less than 0.5 will produce a validation task for the sypht.bpay specification.
The fieldset specified to validate in the workflowOptions should be contained in the fieldSets requested to predict against on the base /fileupload/ request
The full set of validation conditions includes:
  • field-confidence-range
    • Validates whether a given field's prediction condidence value falls within an expected range.
    • Predictions with values outside the allowed range will trigger validation of the field.
    • Typically used to identify and review low confidence predictions.
    • Required
      • field - Id of the field to validate
    • Options
      • min - The minimum value for the predicted field confidence
        • Inclusive
        • Default = null for no minimum
      • max - The maximum value for the predicted field confidence
        • Inclusive
        • Default = null for no maximum
  • field-value-range
    • Validates whether a given field's normalised value falls within an expected range.
    • Predictions with values outside the allowed range will trigger validation of the field.
    • Required
      • field - Id of the field to validate
    • Options
      • min - The minimum value for the predicted field confidence
        • Inclusive
        • Default = null for no minimum
      • max - The maximum value for the predicted field confidence
        • Inclusive
        • Default = null for no maximum
  • field-present
    • Verifies the presence of a value for a field on a document.
    • Documents missing values for this field will trigger validation of the field.
    • Required
      • field - Id of the field to validate
Response
1
{
2
"fileId": "815c63f6-6152-467c-9182-f07223d057cb",
3
"uploadedAt": "2020-08-20T03:19:07.319Z",
4
"status": "RECEIVED"
5
}
Copied!

Tasks

Collecting results

While tasks are in progress, the results endpoint will block requests for up-to 30 seconds and return an IN PROGRESS status.
1
GET https://api.sypht.com/result/final/815c63f6-6152-467c-9182-f07223d057cb
2
3
Response
4
{
5
"fileId": "1111111-6152-467c-9182-f07223d057cb",
6
"status": "IN PROGRESS"
7
}
8
Copied!
One complete, results will be returned normally.
1
Response (once prediction/ is complete)
2
{
3
"fileId": "1111111-6152-467c-9182-f07223d057cb",
4
"status": "FINALISED",
5
"results": {
6
"timestamp": "2020-08-20T03:30:09.703Z",
7
"fields": [
8
{
9
"name": "vehicle.odometerKm",
10
"value": "148500",
11
"confidence": 0.9958282699555642,
12
...
13
},
14
...
15
]
16
}
17
}
Copied!