rc-parsing-dataset
收藏资源简介:
该数据集旨在为微调OCR模型以解析运价确认书类文档提供训练数据,以解决现有解析方案的延迟高、依赖外部服务和成本高昂问题,目标是训练快速、可本地部署的替代模型。数据集由结构化JSON文件组成,每个JSON对应一个原始PDF文档,涵盖物流文档的关键字段,如起运地、目的地、提货日期、送达日期、文件日期、总费用、货物重量、货物类型、提货单号、特殊说明和包含多个停靠点信息的列表(每个停靠点细分为原始类型、类型、地址、日期和时间)。初始源PDF文档共46个,专门用于文档信息抽取或OCR后处理模型的微调任务,以自动化从非结构化文档图像或PDF中提取结构化业务数据。
This dataset is designed to provide training data for fine-tuning OCR models to parse rate confirmation documents, addressing issues with existing parsing solutions such as high latency (2-5 seconds per document), reliance on external services (with uncertainties), and high costs when processing large volumes of documents, with the goal of training a fast, locally deployable alternative model. The dataset consists of structured JSON files, each corresponding to an original PDF rate confirmation document, covering key fields of such logistics documents, including origin, destination, pickup date, delivery date, document date, total rate, weight, commodity, pickup number, instructions, and a list of stops (each stop further subdivided into original type, type such as PICKUP, address, date, and time). There are 46 initial source PDF documents. It is specifically used for document information extraction or fine-tuning OCR post-processing models to automatically extract structured business data from unstructured document images or PDFs.
数据集概述
该数据集用于微调OCR模型,以解析货运费率确认文件(Rate Confirmation文档)。其目标是训练一个快速、本地的模型,替代当前使用的NVIDIA API(速度慢、依赖外部服务、成本高)。
数据集结构与格式
- 目录结构:项目包含
rate_confirmations/目录(存放待处理的PDF文件,共46份)和dataset/目录(保存处理后的JSON输出)。 - 数据集格式:每个PDF文件对应一个JSON文件,JSON结构如下:
source_file: 源PDF文件名。parsed: 解析后的结构化数据,包含以下字段:origin: 出发地。dest: 目的地。pu_date: 提货日期。del_date: 交货日期。document_date: 文档日期。total_rate: 总费率。weight: 货物重量。commodity: 货物类型。pickup_num: 提货编号。instructions: 特殊指令。stops: 停靠点数组,每个元素包含raw_type(原始类型)、type(类型)、address(地址)、date(日期)、time(时间)。
数据处理与工具
- 主要脚本:
gather_dataset.py,负责读取PDF文件,调用本地OCR模型进行解析,并将结果保存为JSON。 - OCR引擎:主引擎为本地
llama-server(Tailscale地址:100.75.222.32:8081或本地localhost:8080),备用引擎为Tesseract(通过fairy_vision.py实现)。 - 使用方式:
- 安装依赖:
pip install -r requirements.txt - 列出可用模型:
python gather_dataset.py --list-models - 处理所有新文件:
python gather_dataset.py - 处理特定文件:
python gather_dataset.py --file "RateConfirmation.pdf" - 重新处理所有文件:
python gather_dataset.py --reprocess - 指定模型:
python gather_dataset.py --model "qwen/qwen3.5-122b-a10b"
- 安装依赖:
- 运行环境要求:Python 3.11+,PyMuPDF、httpx、Pillow、pytesseract等依赖。
数据来源与用途
- 数据来源:PDF文件从
newbot/test_rcs目录复制而来,共46份,均为费率确认文档(Rate Confirmations)。 - 用途:用于微调本地OCR模型,实现快速、离线、低成本的文档结构化解析,降低对NVIDIA API的依赖。




