feat(data_process): 显式关闭 docling OCR 并拒绝无文本层 PDF
- docling 转换器通过 PdfPipelineOptions 显式设置 do_ocr=False, 混合 PDF 的图片页不再产出 OCR 文字;不提供重新开启 OCR 的参数。 - 无文本层 PDF 的错误文案改为"扫描版或图片型 PDF 不支持", 上传阶段整批拒绝,保留混合 PDF 的可处理判定。 - 新增 test_layout_converter_disables_ocr 守护开关状态, 同步设计文档与 disable-ocr 实施计划/设计说明。
This commit is contained in:
@@ -104,7 +104,9 @@ def extract_pdf_page_texts(raw: bytes) -> tuple[PdfPageText, ...]:
|
||||
)
|
||||
has_text = True
|
||||
if not has_text:
|
||||
raise ValueError("PDF contains no extractable text; scanned PDF requires OCR")
|
||||
raise ValueError(
|
||||
"PDF contains no extractable text; scanned or image-only PDF files are not supported"
|
||||
)
|
||||
return tuple(pages)
|
||||
|
||||
def _pdf_page_lines(page: PdfPageText) -> tuple[_PdfLine, ...]:
|
||||
|
||||
Reference in New Issue
Block a user