scan, split, OCR, prepare for LLM
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

models.py 420B

1234567891011121314151617181920
  1. from __future__ import annotations
  2. from dataclasses import dataclass, field
  3. from typing import Any
  4. @dataclass
  5. class ParsedBlock:
  6. label: str
  7. content: str
  8. bbox: tuple[int, int, int, int]
  9. confidence: float = 0.9
  10. @dataclass
  11. class OcrPageResult:
  12. blocks: list[ParsedBlock] = field(default_factory=list)
  13. raw_json: dict[str, Any] = field(default_factory=dict)
  14. width: int = 0
  15. height: int = 0