Extraction scoring is in beta.We’d love your feedback — reach out at support@datalab.to.Scoring is free.
- A Datalab account with an API key (new accounts include $5 in free credits)
- Python 3.10+ installed
- The Datalab SDK:
pip install datalab-python-sdk - Your
DATALAB_API_KEYenvironment 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
When you run extraction withextraction_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
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:
_score object, and the top-level response includes an extraction_score_average:
extraction_score_average (4.5 in this case), averaging all field scores.
Score Rubric
Using Scores in Practice
Useextraction_score_average for a quick quality check, then inspect individual _score fields to flag low-confidence results:
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