繁体   English   中英

当行数据分为两个单独的页面时,如何正确地从 pdf 中提取表格数据?

[英]how to extract tabular data from pdf properly when a row data is divided in two separate pages?

我的任务是解析来自 pdf 的表格数据。 我在 python 中使用“tika”库,这很好,但有一个问题如下:

Pdf 具有表格格式的文本,行的一半在第二页结束,这将表的键和值数据划分为两个不同的页面,我认为 tika 将这一行视为两个单独的行。

在此处输入图像描述

output 将在不正确的键之间添加值。

例如:

str = "这是长键数据xxxxxxxxxxxxxxxx剩余键数据"

有什么建议么?

您可以尝试使用 tesseract psm: Pytesseract OCR multiple config options

To set the different psm in tika (1 is default value) you can either: use the header: X-Tika-OCRPageSegMode: xx or use the tesseract config: https://tika.apache.org/1.24/api/org/ apache/tika/parser/ocr/TesseractOCRConfig.html#setPageSegMode-java.lang.String-

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM