Skip to content

Commit

Permalink
fixed some nasty bugs
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Staar <[email protected]>
  • Loading branch information
PeterStaar-IBM committed Jan 10, 2025
1 parent 29fa042 commit da378aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docling_eval/benchmarks/annotation_formats/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ def create_true_document(basename:str, annot: dict, desc: dict):
elif label in [DocItemLabel.TABLE, DocItemLabel.DOCUMENT_INDEX]:

table_data = find_table_data(doc=orig_doc, prov=prov)

table_item = true_doc.add_table(label=DocItemLabel.TABLE, data=table_data, prov=prov)
table_item = true_doc.add_table(label=label, data=table_data, prov=prov)

true_doc, already_added = add_captions_to_item(to_captions = to_captions,
item = table_item,
Expand Down
5 changes: 2 additions & 3 deletions docling_eval/evaluators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def check_bins_and_hist_lengths(cls, values):

def to_table(self) -> Tuple[List[List[str]], List[str]]:

headers = ["x0<=TEDS", "TEDS<=x1", "prob [%]", "acc [%]", "1-acc [%]", "total"]
headers = ["[x0, x1]", "prob [%]", "acc [%]", "1-acc [%]", "total"]

# Calculate bin widths
bin_widths = [
Expand All @@ -43,8 +43,7 @@ def to_table(self) -> Tuple[List[List[str]], List[str]]:
for i in range(len(self.bins) - 1):
table.append(
[
f"{self.bins[i+0]:.3f}",
f"{self.bins[i+1]:.3f}",
f"[{self.bins[i+0]:.3f}, {self.bins[i+1]:.3f}]",
f"{100.0*float(self.hist[i])/float(self.total):.2f}",
f"{100.0*cumsum:.2f}",
f"{100.0*(1.0-cumsum):.2f}",
Expand Down

0 comments on commit da378aa

Please sign in to comment.