The PaddleOCR team has developed PP-DocBee2-3B, a multimodal large model that significantly enhances Chinese document understanding. Building upon the original PP-DocBee, this new iteration introduces an improved data optimization scheme that boosts data quality. PP-DocBee2 achieves superior performance in Chinese document understanding tasks by leveraging a relatively small dataset of 470,000 synthetic data points, generated through a proprietary data synthesis strategy. Internally, PP-DocBee2 demonstrates an impressive 11.4% improvement over its predecessor, PP-DocBee, in Chinese business scenario metrics. Furthermore, it outperforms other popular open-source and closed-source models of comparable scale in key accuracy metrics. The key accuracy metrics are as follow:
Model
Model Storage Size(GB)
Total Score
PP-DocBee-2B
4.2
765
PP-DocBee-7B
15.8
-
PP-DocBee2-3B
7.6
852
Note
: The total scores of the above models are test results from an internal evaluation set, where all images have a resolution (height, width) of (1680, 1204), with a total of 1196 data entries, covering scenarios such as financial reports, laws and regulations, scientific and technical papers, manuals, humanities papers, contracts, research reports, etc. There are no plans for public release at the moment.
Quick Start
Installation
PaddlePaddle
Please refer to the following commands to install PaddlePaddle using pip:
# for CUDA11.8
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
# for CUDA12.6
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
# for CPU
python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
You can also integrate the model inference of the text recognition module into your project. Before running the following code, please download the sample image to your local machine.
from paddleocr import DocVLM
model = DocVLM(model_name="PP-DocBee2-3B")
results = model.predict(
input={"image": "medal_table.png", "query": "识别这份表格的内容, 以markdown格式输出"},
batch_size=1
)
for res in results:
res.print()
res.save_to_json(f"./output/res.json")
For details about usage command and descriptions of parameters, please refer to the
Document
.
Pipeline Usage
The ability of a single model is limited. But the pipeline consists of several models can provide more capacity to resolve difficult problems in real-world scenarios.
doc_understanding
The document understanding pipeline is an advanced document processing technology based on Visual-Language Models (VLM), designed to overcome the limitations of traditional document processing. And there is only 1 module in the pipeline:
Document Visual Language Module
Run a single command to quickly experience the OCR pipeline:
If save_path is specified, the visualization results will be saved under
save_path
. The visualization output is shown below:
The command-line method is for quick experience. For project integration, also only a few codes are needed as well:
from paddleocr import DocUnderstanding
pipeline = DocUnderstanding(
doc_understanding_model_name="PP-DocBee2-3B"
)
output = pipeline.predict(
{
"image": "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/medal_table.png",
"query": "识别这份表格的内容, 以markdown格式输出"
}
)
for res in output:
res.print() ## Print the structured output of the prediction
res.save_to_json("./output/")
The default model used in pipeline is
PP-DocBee2-3B
, so it is not necessary that specifing to
PP-DocBee2-3B
by argument
doc_understanding_model_name
. But you can use the local model file by argument
doc_understanding_model_dir
. For details about usage command and descriptions of parameters, please refer to the
Document
.
PP-DocBee2-3B huggingface.co is an AI model on huggingface.co that provides PP-DocBee2-3B's model effect (), which can be used instantly with this PaddlePaddle PP-DocBee2-3B model. huggingface.co supports a free trial of the PP-DocBee2-3B model, and also provides paid use of the PP-DocBee2-3B. Support call PP-DocBee2-3B model through api, including Node.js, Python, http.
PP-DocBee2-3B huggingface.co is an online trial and call api platform, which integrates PP-DocBee2-3B's modeling effects, including api services, and provides a free online trial of PP-DocBee2-3B, you can try PP-DocBee2-3B online for free by clicking the link below.
PaddlePaddle PP-DocBee2-3B online free url in huggingface.co:
PP-DocBee2-3B is an open source model from GitHub that offers a free installation service, and any user can find PP-DocBee2-3B on GitHub to install. At the same time, huggingface.co provides the effect of PP-DocBee2-3B install, users can directly use PP-DocBee2-3B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.