Feature request: the document without table structure from the same conversion (one layout pass)
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Read the PageAssembleModel and ReadingOrderModel behavior described in the issue, then inspect Page.assembled and StandardPdfPipeline._assemble_document to find a suitable public API. Compare the proposed result with a separate conversion using do_table_structure=False, including Markdown output, page count, tables, pictures, and page numbering; done means the public path matches that conversion without running another model pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Requested feature
A public way to get, from one PDF conversion, the document with table structure (TableFormer) and the same document without it (what do_table_structure=False produces). Today the only public way to get both is to convert twice, which runs the layout model over every page twice.
Use case
A scientific-paper ingestion pipeline keeps two Markdown exports per paper:
- the table-structured one, for tables;
- the unstructured one, whose text is the stored, hashed source for downstream steps (sections, page-1 metadata).
Changing the unstructured export would invalidate everything stored from it, so it must stay byte-identical. Converting twice per paper costs roughly a quarter of the conversion time on our CPU-only hosts: the layout pass runs twice.
What we found (Docling 2.143.1, docling-core 2.105.0)
Without a table-structure prediction, PageAssembleModel falls back to Table(otsl_seq=[], table_cells=[], cluster=cluster, ...). ReadingOrderModel then adds the cluster's children under the table as a group. So after a conversion with do_table_structure=True, the unstructured document can be rebuilt without running any model:
result = converter.convert(source) # do_table_structure=True
structured = result.document
for page in result.pages:
if page.assembled is None:
continue
swap = {id(e): Table(label=e.cluster.label, id=e.cluster.id, text="", otsl_seq=[], table_cells=[],
cluster=e.cluster, page_no=page.page_no)
for e in page.assembled.elements if isinstance(e, Table)}
for name in ("elements", "body", "headers"):
setattr(page.assembled, name, [swap.get(id(e), e) for e in getattr(page.assembled, name)])
pipeline = converter._get_pipeline(InputFormat.PDF)
unstructured = pipeline._assemble_document(result).document
On the papers we checked (19 and 46 pages, 12 and 29 tables), the export_to_markdown() of unstructured is identical to a separate do_table_structure=False conversion, including page_no=1. So are num_pages(), the table items (1×1 data plus the child group) and the picture items. The re-assembly takes 1–3 s.
It relies on two internals, Page.assembled and StandardPdfPipeline._assemble_document, so it can break on any release.
Proposal
One of these as public API, whichever fits the design better:
- a
PdfPipelineOptionsflag (for examplealso_produce_unstructured_tables: bool) that adds a second document to theConversionResult; or - a public method, for example
StandardPdfPipeline.reassemble(conv_res, table_structure=False) -> DoclingDocument(or onConversionResult), documented as running no model.
We are happy to open a PR for either, with a test that compares against a do_table_structure=False conversion.
Alternatives considered
- Two conversions: what we do today, at the cost of a second layout pass.
- A custom Markdown table serializer over the structured document: public API, but the output is not identical to the unstructured conversion. The cell order and tokenization differ.
- Lingua principale
- Python
- Stelle
- 71k
- Fork
- 5.4k
- Merge medio
- 2g 22h
- PR unite (30g)
- 161
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di docling-project/docling
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
docling-project/docling#5592 ·
I maintainer di solito rispondono entro 2 giorni
-
`api_image_request` logs and propagates the raw error response body, leaking the request's API key on 401Forse già presa @prassu017 l’ha presa 7 giorni fa. Apertabug priority:critical
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
docling-project/docling#5486 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
AFP: export_to_doctags() raises ZeroDivisionError because every page has size 0x0Forse già presa @Krushil-Dhankecha l’ha presa 12 giorni fa. Apertabug priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
docling-project/docling#5355 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
AsciiDoc: thematic breaks and page breaks are kept as text or turned into list itemsForse già presa @sohailshk l’ha presa 12 giorni fa. Apertaasciidoc bug priority:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
docling-project/docling#5331 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Merged paragraph across pages of different heights: continuation bbox uses the first page's heightForse già presa @galer1us l’ha presa 15 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
docling-project/docling#5286 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di docling-project/docling
Issue simili
-
Task select patterns with uppercase letters never matchForse già presa @manobhisriram l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
app: scripts status: backlog type: housekeeping
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
netbox-community/netbox-scripts#239 ·
I maintainer di solito rispondono entro 1 giorno
-
Lambda deploys fail once the bundle grows by about 254 KBForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
developmentseed/titiler-cmr#341 ·
I maintainer di solito rispondono entro 1 giorno
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 charactersForse già presa @omkarbandikatte l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno