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
3 changes: 1 addition & 2 deletions docling_eval/evaluators/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,5 @@ def _doctags_to_doc(self, doc_id, doctags: str) -> DoclingDocument:
"""
doctags_page = DocTagsPage(tokens=doctags)
doctags_doc = DocTagsDocument(pages=[doctags_page])
doc = DoclingDocument(name=doc_id)
doc.load_from_doctags(doctags_doc)
doc = DoclingDocument.load_from_doctags(doctags_doc, document_name=doc_id)
return doc
3 changes: 1 addition & 2 deletions docling_eval/evaluators/base_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ def docling_document_from_doctags(

doctags_page = DocTagsPage(tokens=doctags, image=page_image)
doctags_doc = DocTagsDocument(pages=[doctags_page])
pred_doc = DoclingDocument(name=doc_id)
pred_doc.load_from_doctags(doctags_doc)
pred_doc = DoclingDocument.load_from_doctags(doctags_doc, document_name=doc_id)

return pred_doc

Expand Down
5 changes: 3 additions & 2 deletions docling_eval/prediction_providers/file_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ def _load_doctags_doc(self, record: DatasetRecord) -> Optional[DoclingDocument]:
# Build DoclingDocument
doctags_page = DocTagsPage(tokens=doctags, image=page_image)
doctags_doc = DocTagsDocument(pages=[doctags_page])
doc = DoclingDocument(name=record.doc_id)
doc.load_from_doctags(doctags_doc)
doc = DoclingDocument.load_from_doctags(
doctags_doc, document_name=record.doc_id
)

return doc
except Exception as e:
Expand Down