docling-project / docling-project/docling-core

Review the serialization of tables in triplet format

Open
#528 4 comments 0 reactions 1 assignee Claimed by @wanadzhar913 View on GitHub
bug good first issue
Dominant language
HTML
Stars
282
Forks
214
Avg merge
2d 15h
Merged PRs (30d)
21

Description

The `TripletTableSerializer` aims at serializing tables to a text format that could be understood by LLMs for downstream applications like RAG.
The implementation connects a column, a row, and the content of the cell in the given column and row to create _sentences_ of the style `A, B = C.`
The implementation needs to be reviewed, since it takes assumptions on the role of the first column and the first row to build the triplet representation of the table cells.

For instance, the inner table in `test/data/doc/rich_table.gt.html`:

Image

will be serialized as follows (refer to the ground truth file [`0c_out_chunks.json`](https://github.com/docling-project/docling-core/blob/main/test/data/chunker/0c_out_chunks.json):

```text
cell 0,0, 1 = cell 0,1. cell 1,0, 1 =

text in italic

.
    \n
  • list item 1
  • \n
  • list item 2
  • \n
, 1 = cell 2,1. cell 3,0, 1 = inner cell 0,0, 1 = inner cell 0,1. inner cell 0,0, 2 = inner cell 0,2. inner cell 1,0, 1 = inner cell 1,1. inner cell 1,0, 2 = inner cell 1,2.

Some text in a generic group.

\n

More text in the group.

, 1 = cell 4,1
```

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.