feat: add mineru model

This commit is contained in:
2026-01-05 17:30:54 +08:00
parent 3870c108b2
commit 6ea37c9380
5 changed files with 142 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
from app.services.image_processor import ImageProcessor
from app.services.layout_detector import LayoutDetector
from app.services.ocr_service import OCRService
from app.services.ocr_service import OCRService, MineruOCRService
from app.services.converter import Converter
from app.core.config import get_settings
@@ -45,3 +45,13 @@ def get_converter() -> Converter:
"""Get a DOCX converter instance."""
return Converter()
def get_mineru_ocr_service() -> MineruOCRService:
"""Get a MinerOCR service instance."""
settings = get_settings()
api_url = getattr(settings, 'miner_ocr_api_url', 'http://127.0.0.1:8000/file_parse')
return MineruOCRService(
api_url=api_url,
converter=get_converter(),
)