Long figure caption labelled text instead of caption on 2.152.0 (caption on 2.111.0)
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
The report identifies the PDF conversion pipeline and provides a reproduction using DocumentConverter, PdfFormatOption, and PdfPipelineOptions; it does not name implementation files or tests. Start by reproducing the caption labeling difference on the supplied page with OCR disabled, then trace how the default layout model labels and links figure captions. Done means the block is labeled caption and remains linked to the picture; an open pull request already addresses this issue.
Written by the indexing model from the issue text.
Description
Bug
Split out of #5569. A long figure caption that 2.111.0 labels caption (and links to its picture) is labelled text on 2.152.0, so the picture ends up with no caption. This is a labelling change, not a matching one: #5571 does not affect it.
Layout (PDF points, bottom-left origin), one page with a single wide figure:
- Picture: l=89, t=624, r=524, b=295.
- Caption: one block of about 2,100 characters starting at l=82, below the picture. It begins with a short production code and then "Figure 15-35 The stepwise activation of …".
| Label of that block | picture.captions |
|
|---|---|---|
| 2.111.0 | caption |
linked |
| 2.152.0 | text |
empty |
The picture box is the same in both versions. Default layout model in both runs (no layout_options set).
Expected: the block keeps the caption label and stays linked.
Steps to reproduce
from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.document_converter import DocumentConverter, PdfFormatOption
opts = PdfPipelineOptions()
opts.do_ocr = False
conv = DocumentConverter(format_options={InputFormat.PDF: PdfFormatOption(pipeline_options=opts)})
doc = conv.convert("page.pdf").document
for pic in doc.pictures:
print(pic.prov[0].bbox, [c.resolve(doc).text[:40] for c in pic.captions])
The page is from a copyrighted textbook, so I cannot attach it here; I can share it privately with a maintainer, and I am happy to test a patch.
Docling version
docling 2.152.0, docling-core 2.108.0, docling-ibm-models 4.0.4, docling-parse 7.27.1 (also 2.152.0 with the hunk of #5571 applied: same result).
Compared with docling 2.111.0, docling-core 2.92.0, docling-ibm-models 3.13.3, docling-parse 7.16.0.
Python version
Python 3.12, Linux x86_64, CPU only.
- Dominant language
- Python
- Stars
- 71k
- Forks
- 5.4k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 161
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docling-project/docling
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
docling-project/docling#5592 ·
Maintainers usually reply within 2 days
-
`api_image_request` logs and propagates the raw error response body, leaking the request's API key on 401Possibly taken @prassu017 claimed this 7 days ago. Openbug priority:critical
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
docling-project/docling#5486 · 1 comment · 1 reaction ·
Maintainers usually reply within 2 days
-
AFP: export_to_doctags() raises ZeroDivisionError because every page has size 0x0Possibly taken @Krushil-Dhankecha claimed this 12 days ago. Openbug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
docling-project/docling#5355 · 1 comment ·
Maintainers usually reply within 2 days
-
AsciiDoc: thematic breaks and page breaks are kept as text or turned into list itemsPossibly taken @sohailshk claimed this 12 days ago. Openasciidoc bug priority:low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
docling-project/docling#5331 · 1 comment ·
Maintainers usually reply within 2 days
-
Merged paragraph across pages of different heights: continuation bbox uses the first page's heightPossibly taken @galer1us claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
docling-project/docling#5286 ·
Maintainers usually reply within 2 days
All issues in docling-project/docling
Similar issues
-
Task select patterns with uppercase letters never matchPossibly taken @manobhisriram claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
app: scripts status: backlog type: housekeeping
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
netbox-community/netbox-scripts#239 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
developmentseed/titiler-cmr#341 ·
Maintainers usually reply within 1 day
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 charactersPossibly taken @omkarbandikatte claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day