Deprecation Notice: This document covers the PP-StructureV2 table recognition pipeline, located under
ppstructure/. This directory and its associated models are no longer actively maintained and will be removed in a future release. For current table recognition capabilities, see the PP-StructureV3 document parsing system (2.3) and the specialized recognition modules overview (2.7).
This page documents the table recognition sub-pipeline inside the ppstructure/table/ directory. It covers:
For the broader PP-StructureV2 system (layout analysis, KIE, etc.), see 8.1.
The table recognition pipeline combines three independent models that run sequentially. No single end-to-end model handles the full task; instead, OCR and table structure prediction results are merged programmatically.
Table Recognition Pipeline — Model Flow
Step-by-step description:
Sources: ppstructure/table/README.md15-28
Three distinct model types are required. Each is loaded from a separate inference model directory.
| Role | Model Type | Example Model Name | Dictionary File |
|---|---|---|---|
| Text Detection | DB | PP-OCRv3_mobile_det_infer | — |
| Text Recognition | CRNN | ch_PP-OCRv3_rec_infer | ppocr_keys_v1.txt |
| Table Structure | SLANet | ch_ppstructure_mobile_v2.0_SLANet_infer | table_structure_dict_ch.txt |
English variants use en_ppocr_mobile_v2.0_table_det_infer, en_ppocr_mobile_v2.0_table_rec_infer, and en_ppstructure_mobile_v2.0_SLANet_infer with table_structure_dict.txt.
The table structure dictionary files live at:
ppocr/utils/dict/table_structure_dict_ch.txt (Chinese/SLANet)ppocr/utils/dict/table_structure_dict.txt (English/SLANet or TableRec-RARE)ppocr/utils/dict/table_dict.txt (used during TEDS evaluation)Sources: ppstructure/table/README.md54-88
Code entity map — scripts and their roles
Sources: ppstructure/table/README.md52-155
predict_table.pyMain inference script. Accepts all three model directories as arguments and produces per-image Excel files plus an HTML visualization.
| Argument | Description |
|---|---|
--det_model_dir | Path to the text detection (DB) inference model |
--rec_model_dir | Path to the text recognition (CRNN) inference model |
--table_model_dir | Path to the SLANet table structure inference model |
--rec_char_dict_path | Character dictionary for the recognition model |
--table_char_dict_path | Structure token dictionary for SLANet |
--image_dir | Input image or directory |
--output | Output directory for Excel and HTML files |
--merge_no_span_structure | Set to False when using TableRec-RARE model |
Sources: ppstructure/table/README.md60-88
eval_table.pyEvaluates the full pipeline against a ground-truth file using the TEDS metric. Requires all three model directories and a prepared GT file.
Additional arguments beyond those shared with predict_table.py:
| Argument | Description |
|---|---|
--det_limit_side_len | Detection image side limit (e.g., 736) |
--det_limit_type | Limit type: min or max |
--rec_image_shape | Recognition input shape, e.g., 3,32,320 |
--gt_path | Path to the GT label file |
Sources: ppstructure/table/README.md98-155
convert_label2html.pyUtility that converts an annotation label file into the HTML-based GT format required by eval_table.py.
python3 ppstructure/table/convert_label2html.py \
--ori_gt_path /path/to/your_label_file \
--save_path /path/to/save_file
The GT file format is one entry per line: <filename>\t<html_table_string>.
Sources: ppstructure/table/README.md100-112
Evaluated on the PubTabNet validation dataset. All speeds measured on CPU with MKL enabled.
| Method | Acc | TEDS | Speed (CPU) |
|---|---|---|---|
| EDD | — | 88.30% | — |
| TableRec-RARE | 71.73% | 93.88% | 779 ms/image |
| SLANet | 76.31% | 95.89% | 766 ms/image |
Sources: ppstructure/table/README.md31-43
Sources: ppstructure/table/README.md98-155
The ppstructure/ directory is pending removal. Key replacements:
| PP-StructureV2 Capability | Recommended Replacement |
|---|---|
| Table recognition via SLANet | Table recognition module in PP-StructureV3 (2.3) |
| KIE (Key Information Extraction) | PP-ChatOCRv4 (2.4) |
ppstructure/table/predict_table.py | PP-StructureV3 integrated wheel package |
Sources: ppstructure/README.md1-16
Refresh this wiki
This wiki was recently refreshed. Please wait 2 days to refresh again.