add ImagePreprocessor, compute_image_hash, and OutputMetadata
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import datetime
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
@@ -12,6 +13,22 @@ from ocr_pipeline.utils.logging import get_logger
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
@dataclass
|
||||
class OutputMetadata:
|
||||
source_path: str
|
||||
source_hash: str
|
||||
timestamp: str
|
||||
ocr_engine: str
|
||||
ocr_confidence_mean: float
|
||||
language: str
|
||||
detected_entities: list[str]
|
||||
has_figures: bool
|
||||
has_tables: bool
|
||||
citations_found: list[str]
|
||||
chunk_index: int
|
||||
total_chunks: int
|
||||
|
||||
|
||||
class MarkdownWriter:
|
||||
def __init__(self):
|
||||
self.base_dir = Path(settings.output.base_directory).expanduser().resolve()
|
||||
|
||||
Reference in New Issue
Block a user