Skip to content

关于 ERNIE-KIT 微调 PaddleOCR-VL 模型时自定义 prompt 和多印章处理的咨询 #1357

@hurun

Description

@hurun

问题描述
在使用 ERNIE-KIT 工具微调 PaddleOCR-VL 模型时,是否支持自定义 prompt,而不仅限于论文中提到的以下四种固定 prompt?
TASKS = {
"ocr": "OCR:",
"table": "Table Recognition:",
"formula": "Formula Recognition:",
"chart": "Chart Recognition:",
}

业务场景说明
从图片中提取印章信息,并输出为结构化的数据格式(例如 JSON 结构体)。希望了解是否可以通过微调 PaddleOCR-VL 模型来实现这一目标。

如果可以微调实现,想了解关于数据方面的输入格式,例如

  1. 多印章的场景:同一张图片中可能包含多个印章,需要如何组织数据格式
    2.如何表示多印章的标注信息,输出结构体的字段定义示例

自己通过网络、开源代码和paddle文档,已完成以下工作

  1. 已经阅读PaddleOCR-VL-0.9B的训练文档,有ERNIE-4.5-0.3B-Paddle的训练经验
    https://github.com/PaddlePaddle/FastDeploy/blob/develop/docs/zh/best_practices/ERNIE-4.5-0.3B-Paddle.md
    https://github.com/PaddlePaddle/FastDeploy/blob/develop/docs/zh/best_practices/PaddleOCR-VL-0.9B.md

  2. 阅读paddleocr-vl进行推理的部份源码

        if not model_settings["use_layout_detection"]:
            prompt_label = prompt_label if prompt_label else "ocr"
            if prompt_label.lower() == "chart":
                model_settings["use_chart_recognition"] = True
            assert prompt_label.lower() in [
                "ocr",
                "formula",
                "table",
                "chart",
            ], f"Layout detection is disabled (use_layout_detection=False). 'prompt_label' must be one of ['ocr', 'formula', 'table', 'chart'], but got '{prompt_label}'."
  1. 阅读论文

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions