Skip to main content
Before you begin, make sure you have:
  1. A Datalab account with an API key
  2. Python 3.11+ installed
  3. The Datalab SDK: pip install datalab-python-sdk
  4. Your DATALAB_API_KEY environment variable set
Evals are in open beta. The request and response shapes may change.
An Eval runs 2 to 4 variants of a pipeline on the same files, then compares their outputs. For a pipeline of Convert steps, it compares the pages. For a pipeline with one Extract step, it compares the extracted fields. Each place where the variants differ gets a verdict: which variant reads it as the page does.

Run an Eval from Python

This example uploads files, starts an Eval on a pipeline, waits for it to finish, and reads which variant wins:

Compare specific variants

Omit variants to compare the Fast, Balanced, and Accurate modes. To compare your own settings, give 2 to 4 named variants. A variant may change only the mode settings:
  • For a pipeline of Convert steps: output_mode and merge_cross_page.
  • For a pipeline with one Extract step: extraction_mode, and the Convert step’s output_mode.
For a pipeline with an Extract step, a variant sets extraction_mode instead:
Compare a collection instead of uploaded files by passing collection_id instead of file_ids. Give exactly one of the two.

Read the result

Call get_eval_differences(eval_id, file_id) for one file to see each place the variants disagree: the page, each variant’s reading, the winning variant(s), and the verdict (decided, none, unclear, or ignored). For an Eval of Extract, question names the field and description is the field’s description from your schema. get_eval_differences() also returns fields for an Eval of Extract: every compared field, equal or not, with each variant’s value in the order of variant_names.

CLI

Add --json to any eval command to print the raw result instead of a summary.

Pricing

The comparison bills $20 per 1,000 pages, once for each document that it compares. Each variant’s own run bills at its own rate on top of that. See pricing.

Limits

  • 2 to 4 variants per Eval.
  • Up to 100 files per Eval: PDFs and images. Spreadsheets have no pages to compare.
  • A variant changes only the mode settings described above. For now, an Eval does not compare Segment steps or other settings.

Need help?

For questions about Evals or help with a custom evaluation, contact us at support@datalab.to.

Next Steps

Forge Evals overview

Start an Eval from the app, and how to read the results.

Pipelines

Create and run the pipeline that an Eval compares.