Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added benchmark/datasets/pdfs/ics_201.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_202.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_203.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_204.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_205.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_205a.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_206.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_207.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_208.pdf
Binary file not shown.
Binary file added benchmark/datasets/pdfs/ics_213.pdf
Binary file not shown.
172 changes: 0 additions & 172 deletions benchmark/datasets/reference_candidates/ics201_1.json

This file was deleted.

47 changes: 0 additions & 47 deletions benchmark/datasets/reference_candidates/ics202_1.json

This file was deleted.

2 changes: 1 addition & 1 deletion benchmark/pipelines/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ class BasePipeline(ABC):
"""Base class for all extraction pipelines."""

@abstractmethod
def run(self, narrative: str, template_schema: dict) -> PipelineExtractionOutput:
def run(self, narrative: str, template_schema: dict, pdf_path: str) -> PipelineExtractionOutput:
pass
2 changes: 1 addition & 1 deletion benchmark/pipelines/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class Pipeline(BasePipeline):
def run(self, narrative: str, template_schema: dict) -> PipelineExtractionOutput:
def run(self, narrative: str, template_schema: dict, pdf_path: str) -> PipelineExtractionOutput:
'''
You guys should here implement the whole pipeline implementation depending on approach B or C.

Expand Down
6 changes: 4 additions & 2 deletions benchmark/runners/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def run_benchmark(self) -> dict[str, any]:
narratives_dir = os.path.join(datasets_dir, "narratives")
ground_truth_dir = os.path.join(datasets_dir, "ground_truth")
templates_dir = os.path.join(datasets_dir, "templates")
pdfs_dir = os.path.join(templates_dir, "pdfs")

results = []
total_latency = 0.0
Expand Down Expand Up @@ -45,8 +46,9 @@ def run_benchmark(self) -> dict[str, any]:
narrative_path = os.path.join(narratives_dir, narrative_file)
gt_path = os.path.join(ground_truth_dir, gt_file) if gt_file else ""
template_path = os.path.join(templates_dir, template_file)
pdf_path = os.path.join(pdfs_dir, template_file.replace(".json", ".pdf"))

if not os.path.exists(gt_path) or not os.path.exists(template_path):
if not os.path.exists(gt_path) or not os.path.exists(template_path) or not os.path.exists(pdf_path):
continue

with open(narrative_path, "r") as f:
Expand All @@ -62,7 +64,7 @@ def run_benchmark(self) -> dict[str, any]:
template_schema = json.load(f)

start_time = time.time()
output = self.pipeline.run(narrative_text, template_schema)
output = self.pipeline.run(narrative_text, template_schema, pdf_path)
latency = time.time() - start_time
total_latency += latency

Expand Down
Loading