ek.tools#
Small, CLI-friendly functions over the ek core (the dispatch surface).
These are thin, string-in/value-out wrappers designed for triple dispatch (CLI
today, HTTP/UI later). The single _dispatch_funcs list is the SSOT of what
ek.__main__ exposes, so there is no duplicated command registration, and
each function’s signature is its command-line interface.
Run them from the shell:
python -m ek cer "hello wrld" "hello world"
python -m ek where
python -m ek check tesseract
Functions
|
Character Error Rate between a prediction and a gold string (lower is better). |
|
Report what an OCR engine needs to run (delegates to ocracy when installed). |
|
Cost-of-Pass: dollars per successfully completed task ( |
|
List installed OCR backends (requires the |
|
pass@k (capability) and pass^k (reliability) from |
|
ROVER-fuse 2+ transcriptions into a consensus + mean agreement (reference-free). |
|
Print the installed |
|
Word Error Rate between a prediction and a gold string (lower is better). |
|
Print the local data folder where |
- ek.tools.cer(prediction, gold, *, normalize=None)[source]#
Character Error Rate between a prediction and a gold string (lower is better).
- Return type:
- ek.tools.check(engine)[source]#
Report what an OCR engine needs to run (delegates to ocracy when installed).
- Return type:
- ek.tools.cost_per_success(total_dollars, successes, *, attempts=None)[source]#
Cost-of-Pass: dollars per successfully completed task (
infif none succeeded).The unit that matters for an agent – tokens spent on a failed episode are pure waste.
Example:
python -m ek cost-per-success 12.50 5 --attempts 20
- Return type:
- ek.tools.pass_k(n, c, k=1)[source]#
pass@k (capability) and pass^k (reliability) from
csuccesses inntrials.pass@kasks “can it ever do this?”;pass^kasks “does it do this every time?” – and only the second is a production number.Example:
python -m ek pass-k 10 9 --k 8 # a 90%-reliable agent, judged over 8 trials
- Return type:
- ek.tools.rover(*hypotheses, confidence=True)[source]#
ROVER-fuse 2+ transcriptions into a consensus + mean agreement (reference-free).
Example:
python -m ek rover "the cat sat" "the cat sit" "the bat sat"
- Return type: