docling-project / docling-project/docling

Titles of PPT slides is not included in any chunk

Open
#2,551 4 comments 0 reactions 0 assignees View on GitHub
chunker pptx question
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
3d 4h
Merged PRs (30d)
98

Description

### Question
When chunking a parsed PPT file the titles of the slides is not included in any chunk.

Given the attached simple PPT, the title "A topic" is not found in chunks:
```
In [1]: from docling.document_converter import DocumentConverter
In [2]: res = DocumentConverter().convert('/tmp/sample-ppt.pptx')
In [3]: chunks = list(chunker.chunk(dl_doc=res.document))
In [4]: for c in chunks:
...: print(c.text)
...: print('====')
...:
An elaboration:
====
- Point 1
- Point 2
====
Second elaboration:
====
- Point A
- Point B
====
```

I understand the title is considered metadata and not content, and as such it is only included in contextualized text.

But for a lot of use cases having the title in the raw chunk text is useful.

For example, full text search across all chunk texts will fail to find the title, while full text search across contextualized text will find the title in too many chunks.

```
In [108]: for c in chunks:
...: print(chunker.contextualize(chunk=c))
...: print('====')
...:
A topic
An elaboration:
====
A topic
- Point 1
- Point 2
====
A topic
Second elaboration:
====
A topic
- Point A
- Point B
====
```

[sample-ppt.pptx](https://github.com/user-attachments/files/23263342/sample-ppt.pptx)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.