Introduction
Retab can flag extractions that need a second look based on conditions you control. Add any boolean in your schema (or computed during inference) and connect it to the human-in-the-loop criteria. When the condition triggers:- requires_human_review: true in the projects/extract response (field on the completion object)
- human_review_flag: “pending” in the stored extraction and in the dashboard
Define a condition in your schema
You can designate any boolean field as a human-in-the-loop trigger. For example, define a field likeis_document_an_invoice and instruct the model to act as a judge for this condition during inference. If the condition evaluates to the trigger state (e.g., false), the extraction is flagged for review.
Example condition
- Field:
is_document_an_invoice: boolean - Trigger: When
is_document_an_invoiceis false - Outcome: The extraction requires human review and appears in the dashboard with a pending status
API response (projects/extract)
When you callPOST /v1/projects/extract/{project_id} (or client.projects.extract in the SDK), the response is a RetabParsedChatCompletion. Use requires_human_review to know if a human review is needed.
(6)
human_review_flag on the stored extraction.
Review in the dashboard
- Where: Project → Monitor -> Files -> Requires review
- Filter: Use the “Requires review” filter (internally
human_review_flag = "pending"). - Actions:
- Inspect the parsed output and the document
- Make corrections to the extracted object as needed
- Mark the extraction as reviewed
human_review_flag = "reviewed" and is removed from the pending queue.
That’s it — use boolean conditions to route edge cases to reviewers and keep your pipeline robust.