pdfprep 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pdfprep-0.2.0 → pdfprep-0.2.1}/PKG-INFO +1 -1
- {pdfprep-0.2.0 → pdfprep-0.2.1}/pyproject.toml +1 -1
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep/__init__.py +1 -1
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep/ocr.py +12 -2
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep/table.py +11 -1
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep.egg-info/PKG-INFO +1 -1
- {pdfprep-0.2.0 → pdfprep-0.2.1}/README.md +0 -0
- {pdfprep-0.2.0 → pdfprep-0.2.1}/setup.cfg +0 -0
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep/metadata.py +0 -0
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep/parsing.py +0 -0
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep.egg-info/SOURCES.txt +0 -0
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep.egg-info/dependency_links.txt +0 -0
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep.egg-info/entry_points.txt +0 -0
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep.egg-info/requires.txt +0 -0
- {pdfprep-0.2.0 → pdfprep-0.2.1}/src/pdfprep.egg-info/top_level.txt +0 -0
|
@@ -71,8 +71,18 @@ def ocr_with_paddleocr(pdf_path, lang="korean", dpi=200):
|
|
|
71
71
|
PaddleOCR — Baidu의 딥러닝 기반 OCR.
|
|
72
72
|
검출(detection) + 인식(recognition) 단계를 거쳐 박스 + 텍스트 + 신뢰도 반환.
|
|
73
73
|
"""
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
try:
|
|
75
|
+
import numpy as np
|
|
76
|
+
from paddleocr import PaddleOCR
|
|
77
|
+
except ImportError as e:
|
|
78
|
+
raise RuntimeError(
|
|
79
|
+
"paddleocr 엔진을 사용할 수 없습니다 — paddleocr / paddlepaddle 가 설치되어 있지 않습니다.\n"
|
|
80
|
+
f" 현재 Python {sys.version_info.major}.{sys.version_info.minor} 환경입니다. "
|
|
81
|
+
"paddleocr 2.7.3 / paddlepaddle 2.6.2 는 Python 3.12 이하 휠만 제공하므로 "
|
|
82
|
+
"3.13+ 에서는 설치 대상에서 자동 제외됩니다.\n"
|
|
83
|
+
" → Python 3.12 환경에서 `pip install \"pdfprep[ocr]\"` 로 설치하거나, "
|
|
84
|
+
"tesseract 엔진(engine='tesseract')을 사용하세요."
|
|
85
|
+
) from e
|
|
76
86
|
|
|
77
87
|
ocr = PaddleOCR(use_angle_cls=True, lang=lang, show_log=False)
|
|
78
88
|
|
|
@@ -128,7 +128,17 @@ def extract_with_layoutparser(pdf_path, dpi=200, model_name=None):
|
|
|
128
128
|
if not hasattr(Image, "CUBIC"):
|
|
129
129
|
Image.CUBIC = Image.BICUBIC
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
try:
|
|
132
|
+
import layoutparser as lp
|
|
133
|
+
except ImportError as e:
|
|
134
|
+
raise RuntimeError(
|
|
135
|
+
"layoutparser 엔진을 사용할 수 없습니다 — layoutparser 가 설치되어 있지 않습니다.\n"
|
|
136
|
+
f" 현재 Python {sys.version_info.major}.{sys.version_info.minor} 환경입니다. "
|
|
137
|
+
"layoutparser + paddlepaddle 백엔드는 Python 3.12 이하 휠만 제공하므로 "
|
|
138
|
+
"3.13+ 에서는 설치 대상에서 자동 제외됩니다.\n"
|
|
139
|
+
" → Python 3.12 환경에서 `pip install \"pdfprep[table]\"` 로 설치하거나, "
|
|
140
|
+
"camelot / tabula 엔진을 사용하세요."
|
|
141
|
+
) from e
|
|
132
142
|
|
|
133
143
|
# PaddleDetection 백엔드 + TableBank 모델 (표 전용 학습)
|
|
134
144
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|