Spaces:
Sleeping
Sleeping
Download core/base_scanner.py from clabs/learningview: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/clabs/learningview/resolve/main/core/base_scanner.py
- Command line
-
hf download hf://spaces/clabs/learningview/core/base_scanner.py
-
curl -L -o base_scanner.py https://huggingface.co/spaces/clabs/learningview/resolve/main/core/base_scanner.py
1.23 kB
| from abc import ABC, abstractmethod | |
| from typing import Optional | |
| from pydantic import BaseModel | |
| class ScannerContext(BaseModel): | |
| adult_id: str # The Gmail SSO ID of the parent/teacher | |
| child_name: str # For multi-child identification | |
| child_class: str # Critical for school-based reporting | |
| level: str # beginner/intermediate/advanced | |
| locale: str # AU_VIC / IN_NEP | |
| video_path: str | |
| hw_path: Optional[str] = None | |
| target_text: str # Reading Prompt | |
| writing_target: str # Writing Prompt (For Levenshtein comparison) | |
| parent_email: str | |
| report_password: Optional[str] = None | |
| """Shared metadata for all clinical engines [cite: 2026-02-21, 2026-02-27]""" | |
| session_id: str | |
| locale: str | |
| has_paper: bool = False | |
| class BaseScanner(ABC): | |
| """The universal blueprint for every diagnostic scanner.""" | |
| async def analyze(self, video, paper_scan, context: ScannerContext): | |
| """Perform biometric extraction and return raw metrics.""" | |
| pass | |
| def synthesize_risk(self, metrics: dict) -> float: | |
| """Apply clinical weights (e.g., Logarithmic Dampening) to generate a score.""" | |
| pass |