TECHNOLOGY

Prodigy validate_answer: enforce annotation structure without inventing a required judgment

In this article
THE QUICK TAKE

Structural validity and semantic correctness are different; a validator should not force a positive label when the evidence supports none.

Decide what the validator can establish

A custom annotation interface can produce an answer that is structurally incomplete even when the user clicked an available button. The Prodigy recipe guide describes validate_answer for checking submitted annotations and returning an error to the annotator when a constraint fails. Use that mechanism for explicit task rules. A successful validation result confirms those implemented rules, not that the human’s interpretation is objectively correct.

Check the submitted object

The web application reference documents answer validation separately from batch submission. Inspect the actual answer object produced by the selected interface, including edited spans or selected choices. Visual controls can help users, but their appearance does not prove that every submitted object has the relationships the downstream trainer requires. Test the server-side rule with representative valid and invalid submissions rather than assuming the browser cannot construct an unexpected combination.

Keep legitimate negative outcomes possible

Requiring a span in every example can corrupt a task where some documents contain no target entity. Similarly, requiring a preference can invent a winner when the instructions allow an unresolved comparison. Define accepted, rejected and skipped outcomes according to the annotation objective. The validator should enforce the right contract for the chosen outcome, not apply the same positive-label requirement regardless of what the source evidence actually contains.

Make error messages actionable

The component reference places answer validation among controller callbacks. Return an explanation that identifies the violated task rule without revealing a preferred label that the reviewer is supposed to determine independently. When several structural conditions fail, describe enough context for a correction rather than sending the user through an opaque sequence of failures. Keep complex dataset conversion outside this check so validation remains understandable and reproducible.

Audit the collected population

Inspect rejected submissions and skipped tasks when assessing whether the rules excluded particular kinds of source material. The guides on verified negative labels and selection bias explain why these outcomes matter. Retain the validator revision with the annotation run. A stricter interface can improve structural consistency while changing which examples survive into the dataset; those effects need separate evidence before attributing a model-quality change to better human judgments.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles