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
EU requests return a signed result_url; the REST examples below download it before reading the output. See Regional Result Downloads, including the Python SDK 0.5.0 limitation.

How It Works

Confidence scoring runs in cloud fast extraction mode only. When extraction_mode is omitted, the team’s configured default applies. To receive scores you must request fast mode explicitly: extraction_mode="fast". In turbo, balanced, and accurate modes, no numeric scores are produced; extraction_score_average can be absent or null (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. After scoring succeeds, later polls include _score fields and a non-null extraction_score_average. Scoring can fail independently of extraction, so scores are not guaranteed to arrive. A missing or null average means scores are unavailable, not zero confidence. 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. Use a bounded polling window and handle unavailable scores separately from low scores.
Using balanced or accurate extraction mode? These modes do not produce numeric confidence scores. Instead they include 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/accurate mode for inline verification. See Balanced and Accurate Modes.

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