Spaces:
Sleeping
Sleeping
Download core/base.py from WebAshlarWA/ImageDataExtractor2: direct link, hf CLI and curl.
- Browser
- Download file 583 Bytes
-
https://huggingface.co/spaces/WebAshlarWA/ImageDataExtractor2/resolve/main/core/base.py
- Command line
-
hf download hf://spaces/WebAshlarWA/ImageDataExtractor2/core/base.py
-
curl -L -o base.py https://huggingface.co/spaces/WebAshlarWA/ImageDataExtractor2/resolve/main/core/base.py
583 Bytes
| from abc import ABC, abstractmethod | |
| from typing import List, Dict, Any | |
| class BaseEngine(ABC): | |
| def process(self, image_path: str) -> Any: | |
| pass | |
| class BaseOCR(BaseEngine): | |
| def extract_text(self, image_path: str) -> str: | |
| pass | |
| class BaseVLM(BaseEngine): | |
| def extract_structured_data(self, image_path: str, prompt: str) -> Dict[str, Any]: | |
| pass | |
| class BaseNER(BaseEngine): | |
| def extract_entities(self, text: str, labels: List[str]) -> Dict[str, List[str]]: | |
| pass | |