Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
feat: enhance table classification logic and add OCR detection flag
myhloli865b44a5171c
diff --git a/mineru/backend/pipeline/pipeline_analyze.py b/mineru/backend/pipeline/pipeline_analyze.pyindex 1e58b1d8..ea005721 100644--- a/mineru/backend/pipeline/pipeline_analyze.py+++ b/mineru/backend/pipeline/pipeline_analyze.py@@ -190,7 +190,11 @@ def batch_image_analyze(batch_ratio = 1logger.info(f'Could not determine GPU memory, using default batch_ratio: {batch_ratio}')- batch_model = BatchAnalyze(model_manager, batch_ratio, formula_enable, table_enable)+ if str(device).startswith('mps'):+ enable_ocr_det_batch = False+ else:+ enable_ocr_det_batch = True+ batch_model = BatchAnalyze(model_manager, batch_ratio, formula_enable, table_enable, enable_ocr_det_batch)results = batch_model(images_with_extra_info)clean_memory(get_device())diff --git a/mineru/model/table/cls/paddle_table_cls.py b/mineru/model/table/cls/paddle_table_cls.pyindex f3181d65..4be971b5 100644--- a/mineru/model/table/cls/paddle_table_cls.py+++ b/mineru/model/table/cls/paddle_table_cls.py@@ -3,6 +3,7 @@ import osimport cv2import numpy as npimport onnxruntime+from loguru import loggerfrom mineru.backend.pipeline.model_list import AtomicModelfrom mineru.utils.enum_class import ModelPath@@ -63,6 +64,10 @@ class PaddleTableClsModel:def predict(self, img):x = self.preprocess(img)- (result,) = self.sess.run(None, {"x": x})- label = self.labels[np.argmax(result)]- return label+ result = self.sess.run(None, {"x": x})+ idx = np.argmax(result)+ conf = float(np.max(result))+ # logger.debug(f"Table classification result: {self.labels[idx]} with confidence {conf:.4f}")+ if idx == 0 and conf < 0.8:+ idx = 1+ return self.labels[idx]