Skip to main content

JevAPI

Should this field be filled automatically, or should a person check it?

Apps that pull data out of documents (invoices, resumes, IDs, insurance forms) get a value and a confidence for every field. The confidence is a claim, and models are often wrong about it. On JevScope's real public-repo study, one classifier claimed about 98% confidence and was right 68.5% of the time.

JevAPI measures the claim on your own labelled examples and turns it into a decision you can defend:

import { calibrate, decide } from "jevapi";

const profile = calibrate(labelledExamples, {
  costError: 20,                          // a wrong fill costs as much as 20 human checks
  fields: { total_amount: { costError: 100 }, due_date: { maxRisk: 0.05 } },
});

decide(profile, { field: "total_amount", value: "₹48,200", confidence: 0.97 });
// { action: "review", confidence: 0.78, lower: 0.73, threshold: 0.99,
//   reason: "Stated 97%; measured on this field's 200 examples, values like this
//            are right about 78% of the time (at least 73%). Below the 99% bar,
//            so a person should check it." }
from jevapi import calibrate, decide

profile = calibrate(labelled_examples, {"costError": 20})
decide(profile, {"field": "invoice_number", "value": "INV-2231", "confidence": 0.99})

Same maths, same JSON profile format, same answers in JavaScript and Python (both are tested against one shared spec file). Zero dependencies. Runs on your machine or in the browser; nothing is sent anywhere.

How it decides

  1. Calibrate. For each field, isotonic regression maps "the extractor said 0.97" to "on your examples, values like this were right X% of the time". Fields with fewer than 30 examples borrow the pooled calibration, and say so.
  2. Be careful with small samples. By default it decides on a 90% lower bound (Wilson), not the point estimate, so 10 lucky examples cannot unlock auto-fill.
  3. Apply your costs. Fill when the expected cost of a wrong fill is lower than a human check: p > reviewAccuracy - costReview / costError. Add maxRisk to set a hard ceiling on the chance of a wrong fill.
  4. Explain. Every decision carries a plain-English reason.

Empty values, missing or broken confidences, and values that fail your own validate function always go to review.

Check it before you trust it

import { evaluate } from "jevapi";
evaluate(labelledExamples, options, 5);
// held-out (5-fold) coverage, auto-fill error rate, ECE before/after, savings vs checking everything

Labelled examples

One row per extracted field you have checked by hand:

{ "field": "total_amount", "confidence": 0.97, "correct": false }

A few hundred rows per important field is a good start. The numbers only mean something for documents like the ones you labelled.

Honest limits

  • The sample data in spec/examples.json is synthetic. It exists to test the maths. It says nothing about any real model.
  • Calibration fitted on one kind of document does not transfer to another.
  • Not on PyPI yet. Install from GitHub: pip install "git+https://github.com/imranrkhan13/jevscope.git#subdirectory=jevapi/python". The JavaScript version is on npm: npm i jevapi.

MIT licensed. Part of JevScope.

Release files for jevapi 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jevapi 0.1.0
File Size Uploaded
jevapi-0.1.0.tar.gz 27.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jevapi 0.1.0
File Interpreter ABI Platform
jevapi-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.5 kB

Release files / jevapi-0.1.0.tar.gz

Download URL jevapi-0.1.0.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0202f3c67ade98230638db7cd6d3c4b76d1ac5be2c651048680240f1c4caf563
BLAKE2b-256 checksum
How to use checksums
0880b7fe0abcac2aab97c6fa28bd89e892084ebab0cb051ea4cc384a3182e2e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release files / jevapi-0.1.0-py3-none-any.whl

Download URL jevapi-0.1.0-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d897a561e632e3c705379e724b9592a59ef53e029fe98c23508e05c8400f27bd
BLAKE2b-256 checksum
How to use checksums
1f6262739d7cddbe37c9a46b806abdaf266ca80add8a1034700c707be5b77e04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page