mirror of
https://github.com/DS4SD/docling.git
synced 2025-12-11 06:08:09 +00:00
feat: Add content_layer property to items to address body, furniture and other roles (#735)
* feat: Pass predicted page-headers and page-footers through to DoclingDocument furniture Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * chore: Update all test GT Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * fix: update all test cases Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * fix: update all test cases again Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * Update lock Signed-off-by: Christoph Auer <cau@zurich.ibm.com> * Update lock to final docling-core Signed-off-by: Christoph Auer <cau@zurich.ibm.com> --------- Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
@@ -15,6 +15,7 @@ from docling_core.types.doc import (
|
||||
TableCell,
|
||||
TableData,
|
||||
)
|
||||
from docling_core.types.doc.document import ContentLayer
|
||||
|
||||
|
||||
def resolve_item(paths, obj):
|
||||
@@ -311,6 +312,15 @@ def to_docling_document(doc_glm, update_name_label=False) -> DoclingDocument:
|
||||
current_list = None
|
||||
|
||||
doc.add_text(label=DocItemLabel.FORMULA, text="", orig=text, prov=prov)
|
||||
elif label in [DocItemLabel.PAGE_HEADER, DocItemLabel.PAGE_FOOTER]:
|
||||
current_list = None
|
||||
|
||||
doc.add_text(
|
||||
label=DocItemLabel(name_label),
|
||||
text=text,
|
||||
prov=prov,
|
||||
content_layer=ContentLayer.FURNITURE,
|
||||
)
|
||||
else:
|
||||
current_list = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user