Skip to main content
Score your structured extraction results to get per-field confidence ratings (1–5) with reasoning that explains what evidence was found or missing.
Extraction scoring is in beta.We’d love your feedback — reach out at support@datalab.to.Scoring is free.
Before you begin, make sure you have:
  1. A Datalab account with an API key (new accounts include $5 in free credits)
  2. Python 3.10+ installed
  3. The Datalab SDK: pip install datalab-python-sdk
  4. Your DATALAB_API_KEY environment variable set

How It Works

Confidence scoring runs in fast extraction mode only, and extraction_mode defaults to balanced. To receive scores you must request fast mode explicitly: extraction_mode="fast". In balanced and turbo modes, _score fields and extraction_score_average are never returned no matter how long you poll (see the note below).
When you run extraction with extraction_mode="fast", scoring runs automatically afterward. When you poll request_check_url, the extraction result initially contains just the extracted fields and citations. If you continue polling the same URL, the response will eventually include _score fields and an extraction_score_average once scoring completes (typically within a minute of status becoming complete). Each scored field receives:
  • A score from 1 (very low confidence) to 5 (high confidence)
  • A reasoning string explaining what evidence supports or undermines the extracted value
Beyond setting extraction_mode="fast", no extra parameters or endpoints are needed — just keep polling until scores appear.
Using balanced extraction mode? Balanced mode does not produce _score fields or extraction_score_average. Instead it includes its own per-field verification (_meta.verification, with a status of PASS/FAIL_* and feedback) that runs inline as part of the extraction pipeline — a richer, different signal than the numeric confidence scores described here. The two mechanisms are mutually exclusive: use fast mode for numeric _scores, or balanced mode for inline verification. See Balanced Mode.

Example

Response Format

Without scoring, extraction_schema_json contains fields and citations:
With scoring, each field also gets a _score object, and the top-level response includes an extraction_score_average:
The top-level response also includes extraction_score_average (4.5 in this case), averaging all field scores.

Score Rubric

Using Scores in Practice

Use extraction_score_average for a quick quality check, then inspect individual _score fields to flag low-confidence results:
This is useful for building review workflows — auto-accept high-confidence fields and route low-confidence ones to a human reviewer.

Next Steps

Structured Extraction

Full extraction API reference and schema examples

Handling Long Documents

Strategies for extracting from 100+ page documents

Pipelines

Chain processors into versioned, reusable pipelines.

Document Conversion

Convert documents to various formats