Download apps/client/services/identity_extraction/data_classes.py from jun2024/fc: direct link, hf CLI and curl.
- Browser
- Download file 574 Bytes
-
https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/client/services/identity_extraction/data_classes.py
- Command line
-
hf download hf://spaces/jun2024/fc/apps/client/services/identity_extraction/data_classes.py
-
curl -L -o data_classes.py https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/client/services/identity_extraction/data_classes.py
574 Bytes
| """ | |
| 证件信息提取相关数据类 | |
| """ | |
| from dataclasses import dataclass | |
| from typing import Any | |
| class ExtractionResult: | |
| """证件信息提取结果""" | |
| doc_type: str # 证件类型 | |
| raw_text: str # OCR 原始文本 | |
| extracted_data: dict[str, Any] # 提取的结构化数据 | |
| confidence: float # 置信度 (0-1) | |
| extraction_method: str # 提取方式 | |
| class OCRExtractionError(Exception): | |
| """OCR 文字提取失败异常""" | |
| pass | |
| class OllamaExtractionError(Exception): | |
| """Ollama 信息提取失败异常""" | |
| pass | |