words, tables and layout, and averages the scores with the weights you chose. Run one eval with two configs to see which reads your documents better.
The dataset, eval and run routes each have a parse form and an extract form. The extract routes, /eval/dataset/extract, /eval/extract and /eval/run/extract, score an extraction the same way, on one rubric item. GET /eval/dataset and GET /eval list your organization’s datasets and evals of both kinds. The examples on this page are for parse.
Evals are turned on for an organization by Pulse. Until they are, every
/eval route answers 404 ROUTE_NOT_FOUND. Ask your Pulse contact to turn them on.Create a dataset
A dataset is a named list of documents, each afile_url and, if you have one, a ground_truth_url. This request creates a parse dataset of three invoices, the second without a ground truth:
cURL
201 with the dataset, an id for it and one for each document:
- Nothing is fetched when you create a dataset. A run reads each URL when it needs it, so the URLs must still work then.
- A file in Pulse’s storage can be named by its
s3://reference, as afile_urlor aground_truth_url. A run reads it with Pulse’s own access, so it keeps working, while a presigned link expires. It must be one of your organization’s files, or its document fails withPERMISSION_DENIED. - A dataset can’t be changed. To change its documents, create a new one.
- An extract dataset, created with
POST /eval/dataset/extract, also takes theparse_configthat parses its documents and theinput_schematheir extractions fill, and each of its documents needs aground_truth_url. The dataset is returned with theparse_config’s defaults filled in.
Create an eval
An eval is a dataset and a weight for each rubric item: how much that item counts in a document’s score. An eval and each run of it take aname, a label that need not be unique. This request weights words, layout and tables, and leaves every other item at 0:
cURL
201 with every item’s weight:
Weights
- Weights are whole numbers from 0 to 100 that add up to exactly 100. Any other set is refused with a
400. - An item left out weighs 0. An item that weighs 0 is still scored and shown in each document’s
scores, but it counts in nooverall. - Without
weights, 100 is split evenly: 12 forwordsand 11 for each other item. An extract eval’s one item,field_similarity, always weighs 100.
Run an eval
A run tests one parse config. Send it asconfig, exactly as on POST /parse, or send a saved config’s config_id:
cURL
202 with the run’s id. GET /eval/parse/{eval_id}/runs lists an eval’s runs, so you can find it again.
POST /eval/run/extract, tests an extract config, and the config’s input_schema must be the dataset’s. The first run on a dataset parses its documents with the dataset’s parse_config and keeps the parses. Every later run extracts from those same parses, so two extract configs are compared on the same parses.
Each parse and extraction a run starts is billed as POST /parse and POST /extract bill it (Pricing), and the run’s result names each one by its parse_id and extract_id. Creating a dataset or an eval costs nothing.
Follow a run
GET /eval/run/parse/{run_id} returns the run’s status and a summary that counts its documents by the step each has reached, so the counts overlap. An extract run’s summary counts extracted in place of ground_truth_ready.
A document that fails doesn’t fail the run. The run goes on with its other documents. The failed document has an
error in the run’s result and no scores, and it counts in summary.failed. Its error says why: for example, its file or its ground truth couldn’t be fetched, or its parse failed.
How long a run takes depends on its documents. A run still processing 48 hours after it started ends then: each document not yet scored fails, and the run completes with the documents already scored, or fails if none was.
To cancel a run that hasn’t ended, send DELETE /eval/run/parse/{run_id}. Its parses still running are canceled, and it returns the run’s status, now canceled. A canceled run has no result. Canceling an extract run cancels its extractions still running, and keeps the dataset’s parses for later runs. Anyone in your organization can cancel a run. A run that has already ended returns 409.
Read the result
GET /eval/run/parse/{run_id}/result returns a completed run’s scores: its overall, each item’s score in scores, and each document’s scores or error, with the config it tested. Scores aren’t rounded. A run still processing returns 409, a canceled run 410, and a failed run its error: 422 (NO_DOCUMENT_GRADED) when every document failed on what you sent, each document’s error saying why.
This result is from the eval above, with config cut to the one option the run was sent:
List an eval’s runs
GET /eval/parse/{eval_id}/runs returns the eval’s runs, newest first: each run’s run_id, name and status, its overall once it has completed, and when it was created and ended. A run’s other scores are in its result. An eval with no runs returns an empty list.
The rubric
Nine items score a parse, and one scores an extraction. Each score is from 0 to 1, where 1 means the output agrees with the ground truth on everything the item looks at. The ground truth is taken as right, and every item counts what the output got wrong, left out or made up. An item is not graded on a document when neither the ground truth nor the output has anything of its kind, such as a table fortables. It’s then left out of that document’s scores and of its overall. layout is not graded when the ground truth has no boxes. When only the output has something of an item’s kind, such as a table the ground truth doesn’t have, the item scores 0.
words
How many of the words in the document’s text came out right. A wrong word, a word left out and a word the ground truth doesn’t have each lower it; text in tables, words that hold a digit and tick boxes are scored by tables, numbers and checkboxes instead.
numbers
How many of the numbers came out right as printed, in text and in tables. A number is any word that holds a digit, such as 12%, $4,518.20 or INV-2025-04817. A wrong number, a number left out and a number the ground truth doesn’t have each lower it, and (1,234) is not the same number as -1,234.
checkboxes
How many tick boxes are in the right state, ticked or empty, in text and in tables. A box read the wrong way, a box left out and a box the ground truth doesn’t have each lower it.
tables
Whether each table’s cells hold the right text, in the right rows and columns. A wrong cell, a row or column left out or added, and a table left out or made up each lower it, and a cell earns little unless its text is nearly exact.
formulas
How much of each displayed formula is right, symbol by symbol, with spacing and the different spellings of one symbol, such as \le and \leq, set aside. A wrong, missing or extra symbol lowers it, and a formula left out or made up counts as 0. Math written inside a line of text is scored with that text.
structure
Whether each block is labelled as the right kind: a heading, text, a list item, a caption, a footnote, or a page header, footer or number. A wrong label, a heading under the wrong heading, and a block left out or made up each count as one block wrong; how the output splits or joins blocks doesn’t count here.
paragraphs
Whether the output’s blocks start where the ground truth’s paragraphs and other blocks start. Paragraphs run together or split apart, and blocks left out or made up, lower it; page headers and footers don’t count here.
text_styles
Whether bold, italic, underline, strikethrough and highlight fall on the right characters, in text, headings and tables. A style lost, a style added, and styled text left out or made up each lower it.
layout
How closely each block’s box on the page agrees with the ground truth’s box, for text, tables, formulas and figures. Each block earns the overlap of its box with the ground truth’s box: the area the two boxes share, divided by the area they cover together. The credit is that overlap itself, so only the ground truth’s exact box earns 1, and a block in the right place with a looser box scores below 1. A block left out, made up or returned without a box scores 0, and an output with no boxes at all scores 0.
field_similarity
The extract rubric’s one item: the share of the extraction’s values that are right. A value is a string, a number, or true or false, and it’s compared only with the value at the same place in the ground truth. A wrong value, a value left out and a value the ground truth doesn’t have each lower it, and a value empty on both sides isn’t counted. Numbers are equal by value, so 5 is 5.0. Text is equal whatever its case, extra spaces, curly quotes or kind of dash. The order of a list doesn’t count.
How scores add up
A document’soverall is the average of its item scores, weighted by the eval’s weights, over the items graded on it. An item that wasn’t graded is left out of the sum and of the total weight, so the other items keep their proportions. A document whose graded items all weigh 0 has scores and no overall, and it’s left out of the run’s overall.
In the result above, the weights are words 40, layout 30 and tables 30:
- The first document is graded on all three: (40 × 0.9 + 30 × 0.8 + 30 × 0.5) ÷ 100 = 0.750.
- The second has no table on either side, so
tablesisn’t graded: (40 × 0.9 + 30 × 0.8) ÷ 70 = 0.857. structureweighs 0. It’s scored on both documents, and counts in neitheroverall.
overall is the average of its documents’ overall, each document counting once. Each item’s score in the run’s scores is its average over the documents graded on it. A document that failed has no scores, and it’s left out of every average.
In the result above, the run’s overall is (0.750 + 0.857) ÷ 2 = 0.804, and its tables is 0.500, from the first document alone. The third document failed, so it counts in neither.
Ground truths
A parse document’sground_truth_url is optional. Left out: a PDF or an image is still scored, and a document of any other type fails with GROUND_TRUTH_INVALID.
A parse ground truth is a JSON file holding the document’s parse output in Pulse’s format: markdown, and its elements. One way to make one is to parse the document with Pulse, correct the result, and host that file. In it:
- Give each element its
page, numbered from 1 as a parse result numbers them. A ground truth whose pages are numbered differently scores as if most of its text were missing. - Give each element its
bbox, eight numbers as a parse result gives them, to havelayoutgraded. A ground truth with no boxes isn’t graded onlayout.
ground_truth_url is required. Its file holds the values the extraction should return: one JSON object that fits the dataset’s input_schema.
Either kind of file:
- Can be at most 100 MB.
- Is read the first time a run needs it, and kept for every later run. Changing the file afterwards changes nothing; to score against another, create a new dataset. If your organization’s retention deletes results, see Retention and limits.
- Fails only its own document when it can’t be fetched or is too large, or with
GROUND_TRUTH_INVALIDwhen it isn’t JSON in its format: a web page, say, or an extract file that doesn’t fit theinput_schema. The document’serrornamesground_truth_url, and the next run fetches the file again.
Retention and limits
Datasets, their ground truths, evals and run results are kept until you delete the dataset. If your organization has turned saving off, or its retention deletes results after a time or on first fetch, evals follow it:- A run’s result expires, or is deleted once fetched, as a job’s result is. The run’s status gives its
expires_at. - Ground truths aren’t kept between runs. Each run reads each
ground_truth_urlagain, so the URLs must still work. - An extract run parses the dataset’s documents itself, and is billed for it, on every run.
410 (RESULT_ALREADY_FETCHED).
Deleting a dataset, with DELETE /eval/dataset/parse/{dataset_id}, deletes its ground truths, its evals and their runs, and cancels its runs still running. No route deletes an eval or a run on its own.
A dataset holds up to your organization’s limit: 1,000 documents, unless Pulse has set a different one for you. An extract dataset holds at most 1,000, even where your limit is higher. A run parses its documents 1,000 at a time.
Next steps
Saved configs
Save each config you test, then run an eval with its
config_id.Eval API reference
Every eval route, field and error.