Skip to main content

docling-tableformer-batched

A docling table structure plugin: docling's own TableFormer v1 model with all tables of a page batch in one TableFormer call.

GitHub  |  PyPI

What it changes

docling's TableStructureModel calls TableFormer once per table, prepares the page image for every table and collects a table's PDF words by deep-copying every word cell of the page. The engine kind tableformer-v1-batched keeps docling's model, options and output and changes only how a page batch is run:

  • all tables of the page batch go to TableFormer in one multi_page_predict call, so each page is prepared once and the tag decoder runs several tables at once;
  • a table's PDF words are found with the same filter and coordinate conversion as docling's get_cells_in_bbox, without copying the page's word cells.

The tables are the same as with docling's docling_tableformer kind.

multi_page_predict exists in DCC's docling-ibm-models build (DCC-BS/docling-ibm-models, release v4.0.4+dcc.1), which also carries the faster TableFormer v1 decoder of docling-project/docling-ibm-models#210. The batched path reproduces docling 2.142's table loop (docling 2.146 collects table words differently); with other docling or docling-ibm-models releases the engine runs docling's own per-table loop.

Installation

pip install docling-tableformer-batched
# DCC's docling-ibm-models build, for the batched call
pip install --no-deps "https://github.com/DCC-BS/docling-ibm-models/releases/download/v4.0.4%2Bdcc.1/docling_ibm_models-4.0.4+dcc.1-py3-none-any.whl"

Usage

from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.document_converter import DocumentConverter, PdfFormatOption

from docling_tableformer_batched import TableFormerBatchedOptions

pipeline_options = PdfPipelineOptions(allow_external_plugins=True)
pipeline_options.table_structure_options = TableFormerBatchedOptions(mode="accurate")
converter = DocumentConverter(format_options={InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)})

With docling-serve (DOCLING_SERVE_ALLOW_EXTERNAL_PLUGINS=true), as a table structure preset:

DOCLING_SERVE_CUSTOM_TABLE_STRUCTURE_PRESETS='{"tableformer_v1_batched": {"kind": "tableformer-v1-batched", "mode": "accurate"}}'
DOCLING_SERVE_DEFAULT_TABLE_STRUCTURE_PRESET=tableformer_v1_batched

It takes every option of docling's TableFormer v1 (mode, do_cell_matching).

Development

make install   # uv sync (with DCC's docling-ibm-models build) + pre-commit hooks
make check     # ruff, ty
make test      # pytest; TABLEFORMER_E2E=1 also runs TableFormer itself (downloads the models)

License

MIT

Metadata

Release files for docling-tableformer-batched 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docling-tableformer-batched 0.1.0
File Size Uploaded Provenance Actions
docling_tableformer_batched-0.1.0.tar.gz 187.9 kB Without provenance Details for docling_tableformer_batched-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for docling-tableformer-batched 0.1.0
File Interpreter ABI Platform Actions
docling_tableformer_batched-0.1.0-py3-none-any.whl Python 3 none any Details for docling_tableformer_batched-0.1.0-py3-none-any.whl

Total release size: 196.5 kB

Release files / docling_tableformer_batched-0.1.0.tar.gz

Download URL docling_tableformer_batched-0.1.0.tar.gz
Size 187.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8cbd68dce7f1b22cef9a0ee9c1b80606f4d7102d5c35f8f207565153d382c501
BLAKE2b-256 checksum
How to use checksums
636ca593b8dd5d554083985790d563c53bd567f3a4675812f635ef49e449f906
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / docling_tableformer_batched-0.1.0-py3-none-any.whl

Download URL docling_tableformer_batched-0.1.0-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65bcb9c499c78063c68d3f58879bf4c02d25fd8098650865ef4764083607c853
BLAKE2b-256 checksum
How to use checksums
b3c1a832df0bf431f6fe343d8bfecde00ff1840218ba04eaa8e530b3d48b2b4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for docling-tableformer-batched 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page