簡體   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