Spaces:
Configuration error
Configuration error
Download axis_numeric/contracts.py from serety95/axis-numeric: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/spaces/serety95/axis-numeric/resolve/main/axis_numeric/contracts.py
- Command line
-
hf download hf://spaces/serety95/axis-numeric/axis_numeric/contracts.py
-
curl -L -o contracts.py https://huggingface.co/spaces/serety95/axis-numeric/resolve/main/axis_numeric/contracts.py
1.41 kB
| """Pure domain contracts used before transport/model binding.""" | |
| from dataclasses import dataclass | |
| from typing import Literal | |
| SemanticClass = Literal[ | |
| "nid", "registration_number", "tax_id", "account_number", "pan", | |
| "date", "amount", "percentage", "generic_numeric", | |
| ] | |
| SourceScript = Literal["western", "arabic_indic", "extended_arabic_indic", "mixed"] | |
| class NumericPolicy: | |
| semantic_class: SemanticClass | |
| expected_length: int | None = None | |
| class BeamCandidate: | |
| text: str | |
| probability: float | |
| min_character_probability: float | |
| beam_margin: float = 1.0 | |
| character_confidences: tuple[float, ...] = () | |
| character_confidence_sources: tuple[str, ...] = () | |
| preprocessing_variant: str = "model_default" | |
| character_alternatives: tuple[tuple[tuple[str, float], ...], ...] = () | |
| class RankedCandidate: | |
| normalized_text: str | |
| source_script: SourceScript | |
| probability: float | |
| calibrated_confidence: float | |
| min_character_confidence: float | |
| beam_margin: float | |
| schema_valid: bool | |
| checksum_valid: bool | None | |
| character_confidences: tuple[float, ...] = () | |
| character_confidence_sources: tuple[str, ...] = () | |
| preprocessing_variant: str = "model_default" | |
| character_alternatives: tuple[tuple[tuple[str, float], ...], ...] = () | |