Files
docling-eval/tests/test_doc_structure_evaluator.py
Christoph Auer 9c1a2be221 refactor: factor out cvat_tools cleanly and update with optional dependency to new package (#195)
* Surgery: factor out cvat_tools cleanly and update with optional dependency

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>

* Updates to codes and documentation that needs docling-cvat-tools

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>

* Fix instances of external_predictions_path passed to some evaluators

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>

---------

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
2026-01-08 12:12:53 +01:00

29 lines
845 B
Python

from pathlib import Path
import pytest
from docling_eval.evaluators.doc_structure_evaluator import DocStructureEvaluator
@pytest.mark.dependency(
depends=["tests/test_dataset_builder.py::test_run_dpbench_e2e"],
scope="session",
)
def test_doc_structure_evaluator_external_predictions():
r"""Testing the evaluator with external predictions"""
from docling_eval.utils.external_docling_document_loader import (
ExternalDoclingDocumentLoader,
)
eval = DocStructureEvaluator()
gt_path = Path("scratch/DPBench/gt_dataset")
preds_path = Path("scratch/DPBench/predicted_documents/json")
loader = ExternalDoclingDocumentLoader(preds_path)
v = eval(gt_path, external_document_loader=loader)
assert v is not None
if __name__ == "__main__":
test_doc_structure_evaluator_external_predictions()