ASRBackend#
- class scikitplot.corpus.ASRBackend(name, transcribe, capability=None, fallback_exceptions=(<class 'Exception'>, ), requires_network=False, may_download=False, offline_capable=False, degrades_on_failure=True)[source]#
User-defined ASR backend adapter.
- Parameters:
- namestr
Stable name used by
BackendPolicyordering and diagnostics.- transcribecallable
transcribe(request: ASRRequest) -> iterable[Mapping]. Every segment must providetext,timecode_startandtimecode_end. Optional metadata is preserved.- capabilitystr or None, optional
Capability-registry identifier used by readiness-aware policies.
- fallback_exceptionstuple, optional
Exceptions safe to convert into fallback diagnostics.
- requires_networkbool, optional
Declare a network requirement for offline policy enforcement.
- may_downloadbool, optional
Declare that first use may download model/assets.
- offline_capablebool, optional
Whether the backend can honour
ASRRequest.allow_network=Falseandallow_download=Falsewithout attempting a download. Custom backends must opt in explicitly; the orchestrator trusts this contract.- degrades_on_failurebool, optional
Whether failure followed by another backend success is DEGRADED.
- Parameters:
Notes
User callables receive one immutable request object rather than an expanding keyword signature, so future request fields can be added compatibly.
- fallback_exceptions: tuple[type[BaseException], ...] = (<class 'Exception'>,)#