Datasets:
Tasks:
Document Question Answering
Size:
n<1K
Tags:
benchmark
document-ai
information-extraction
structured-extraction
key-information-extraction
ocr
License:
Download tests/test_cli.py from DocuPipe/DocuBench: direct link, hf CLI and curl.
- Browser
- Download file 804 Bytes
-
https://huggingface.co/datasets/DocuPipe/DocuBench/resolve/main/tests/test_cli.py
- Command line
-
hf download hf://datasets/DocuPipe/DocuBench/tests/test_cli.py
-
curl -L -o test_cli.py https://huggingface.co/datasets/DocuPipe/DocuBench/resolve/main/tests/test_cli.py
804 Bytes
| from pathlib import Path | |
| from docubench.cli import score_engines, validate_benchmark | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def test_validate_current_benchmark_files(): | |
| errors, warnings, summary = validate_benchmark(ROOT) | |
| assert errors == [] | |
| assert warnings == [] | |
| assert summary["documents"] == 50 | |
| assert summary["labels"] == 50 | |
| assert summary["schemas"] == 50 | |
| assert summary["sources"] == 50 | |
| assert set(summary["engines"]) == { | |
| "claude", | |
| "docupipe_high", | |
| "docupipe_standard", | |
| "extend", | |
| "gemini", | |
| "gpt", | |
| } | |
| def test_score_engines_reproduces_extend_aggregate(): | |
| scores = score_engines(ROOT, ["extend"]) | |
| assert round(scores["aggregates"]["extend"], 4) == 0.9111 | |
| assert len(scores["per_doc"]) == 50 | |