Pixel-Native RAG: A Practical Guide to Visual Document Indexing
@dataclass class Tile: tile_id: str doc_id: str source: str kind: str page: int seq: int y0: int y1: int path: str ocr_text: str = “” title: str = “” def _doc_id_from_source(src: str) -> str: tail = src.rstrip(“/”).split(“/”)[-1] or src tail = re.sub(r”\.(html?|pdf|png|jpg)$”, “”, tail, flags=re.I) return re.sub(r”[^A-Za-z0-9_.\-()]+”, “_”, tail)[:80] or hashlib.md5(src.encode()).hexdigest()[:10] def _ahash(img, size: int…
