Эх сурвалжийг харах

feat: integrate DoclingLayoutDetector into the adapter module, expanding layout detection capabilities and updating the export list for improved accessibility

zhch158_admin 6 өдөр өмнө
parent
commit
db78f28b68

+ 6 - 0
zhch/universal_doc_parser/models/adapters/__init__.py

@@ -14,6 +14,7 @@ from .base import (
 from .paddle_layout_detector import PaddleLayoutDetector
 from .paddle_vl_adapter import PaddleVLRecognizer
 
+from .docling_layout_adapter import DoclingLayoutDetector
 # 可选导入 MinerU 适配器
 try:
     from .mineru_adapter import (
@@ -37,6 +38,9 @@ __all__ = [
     # PaddleX 适配器
     'PaddleLayoutDetector',
     'PaddleVLRecognizer',
+    
+    # Docling 适配器
+    'DoclingLayoutDetector',
 ]
 
 # 如果 MinerU 可用,添加到导出列表
@@ -67,6 +71,8 @@ def get_layout_detector(config: dict):
         if not MINERU_AVAILABLE:
             raise ImportError("MinerU adapter not available")
         return MinerULayoutDetector(config)
+    elif module == 'docling':
+        return DoclingLayoutDetector(config)
     else:
         raise ValueError(f"Unknown layout detection module: {module}")