129 lines
6.2 KiB
Plaintext
129 lines
6.2 KiB
Plaintext
Metadata-Version: 2.4
|
|
Name: docling-ibm-models
|
|
Version: 4.0.4
|
|
Summary: This package contains the AI models used by the Docling PDF conversion package
|
|
Author-email: Nikos Livathinos <nli@zurich.ibm.com>, Maxim Lysak <mly@zurich.ibm.com>, Ahmed Nassar <ahn@zurich.ibm.com>, Christoph Auer <cau@zurich.ibm.com>, Michele Dolfi <dol@zurich.ibm.com>, Peter Staar <taa@zurich.ibm.com>
|
|
License-Expression: MIT
|
|
Project-URL: homepage, https://github.com/docling-project/docling-ibm-models
|
|
Project-URL: repository, https://github.com/docling-project/docling-ibm-models
|
|
Project-URL: issues, https://github.com/docling-project/docling-ibm-models/issues
|
|
Project-URL: changelog, https://github.com/docling-project/docling-ibm-models/blob/main/CHANGELOG.md
|
|
Keywords: docling,convert,document,pdf,table structure,table former
|
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
Classifier: Operating System :: POSIX :: Linux
|
|
Classifier: Operating System :: Microsoft :: Windows
|
|
Classifier: Development Status :: 5 - Production/Stable
|
|
Classifier: Intended Audience :: Developers
|
|
Classifier: Intended Audience :: Science/Research
|
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
Classifier: Programming Language :: Python :: 3
|
|
Classifier: Programming Language :: Python :: 3.10
|
|
Classifier: Programming Language :: Python :: 3.11
|
|
Classifier: Programming Language :: Python :: 3.12
|
|
Classifier: Programming Language :: Python :: 3.13
|
|
Classifier: Programming Language :: Python :: 3.14
|
|
Requires-Python: <4.0,>=3.10
|
|
Description-Content-Type: text/markdown
|
|
License-File: LICENSE
|
|
Requires-Dist: torch<3.0.0,>=2.2.2
|
|
Requires-Dist: torchvision<1,>=0
|
|
Requires-Dist: Pillow<14.0.0,>=10.0.0
|
|
Requires-Dist: huggingface_hub<2,>=0.23
|
|
Requires-Dist: safetensors[torch]<1,>=0.4.3
|
|
Requires-Dist: transformers<6.0.0,>=4.42.0
|
|
Requires-Dist: numpy<3.0.0,>=1.24.4
|
|
Provides-Extra: opencv-python-headless
|
|
Requires-Dist: opencv-python-headless<5.0.0.0,>=4.6.0.66; extra == "opencv-python-headless"
|
|
Provides-Extra: opencv-python
|
|
Requires-Dist: opencv-python<5.0.0.0,>=4.6.0.66; extra == "opencv-python"
|
|
Dynamic: license-file
|
|
|
|
[](https://pypi.org/project/docling-ibm-models/)
|
|
[](https://pypi.org/project/docling-ibm-models/)
|
|
[](https://github.com/astral-sh/uv)
|
|
[](https://github.com/psf/black)
|
|
[](https://pycqa.github.io/isort/)
|
|
[](https://github.com/pre-commit/pre-commit)
|
|
[](https://huggingface.co/ds4sd/docling-models/)
|
|
[](https://opensource.org/licenses/MIT)
|
|
|
|
# Docling IBM models
|
|
|
|
AI modules to support the Docling PDF document conversion project.
|
|
|
|
- TableFormer is an AI module that recognizes the structure of a table and the bounding boxes of the table content.
|
|
|
|
|
|
## Install
|
|
|
|
The package provides two variants which allow to seemlessly switch between `opencv-python` and `opencv-python-headless`.
|
|
|
|
```sh
|
|
# Option 1: with opencv-python-headless
|
|
pip install "docling-ibm-models[opencv-python-headless]"
|
|
|
|
# Option 2: with opencv-python
|
|
pip install "docling-ibm-models[opencv-python]"
|
|
```
|
|
|
|
## Pipeline Overview
|
|

|
|
|
|
## Datasets
|
|
Below we list datasets used with their description, source, and ***"TableFormer Format"***. The TableFormer Format is our processed version of the version of the original format to work with the dataloader out of the box, and to augment the dataset when necassary to add missing groundtruth (bounding boxes for empty cells).
|
|
|
|
|
|
| Name | Description | URL |
|
|
| ------------- |:-------------:|----|
|
|
| PubTabNet | PubTabNet contains heterogeneous tables in both image and HTML format, 516k+ tables in the PubMed Central Open Access Subset | [PubTabNet](https://developer.ibm.com/exchanges/data/all/pubtabnet/) |
|
|
| FinTabNet| A dataset for Financial Report Tables with corresponding ground truth location and structure. 112k+ tables included.| [FinTabNet](https://developer.ibm.com/exchanges/data/all/fintabnet/) |
|
|
| TableBank| TableBank is a new image-based table detection and recognition dataset built with novel weak supervision from Word and Latex documents on the internet, contains 417K high-quality labeled tables. | [TableBank](https://github.com/doc-analysis/TableBank) |
|
|
|
|
## Models
|
|
|
|
### TableModel04:
|
|

|
|
**TableModel04rs (OTSL)** is our SOTA method that using transformers in order to predict table structure and bounding box.
|
|
|
|
|
|
## Configuration file
|
|
|
|
Example configuration can be found inside test `tests/test_tf_predictor.py`
|
|
These are the main sections of the configuration file:
|
|
|
|
- `dataset`: The directory for prepared data and the parameters used during the data loading.
|
|
- `model`: The type, name and hyperparameters of the model. Also the directory to save/load the
|
|
trained checkpoint files.
|
|
- `train`: Parameters for the training of the model.
|
|
- `predict`: Parameters for the evaluation of the model.
|
|
- `dataset_wordmap`: Very important part that contains token maps.
|
|
|
|
|
|
## Model weights
|
|
|
|
You can download the model weights and config files from the links:
|
|
|
|
- [TableFormer Checkpoint](https://huggingface.co/ds4sd/docling-models/tree/main/model_artifacts/tableformer)
|
|
|
|
|
|
## Inference Tests
|
|
|
|
You can run the inference tests for the models with:
|
|
|
|
```
|
|
python -m pytest tests/
|
|
```
|
|
|
|
This will also generate prediction and matching visualizations that can be found here:
|
|
`tests\test_data\viz\`
|
|
|
|
Visualization outlines:
|
|
- `Light Pink`: border of recognized table
|
|
- `Grey`: OCR cells
|
|
- `Green`: prediction bboxes
|
|
- `Red`: OCR cells matched with prediction
|
|
- `Blue`: Post processed, match
|
|
- `Bold Blue`: column header
|
|
- `Bold Magenta`: row header
|
|
- `Bold Brown`: section row (if table have one)
|