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 BackendPolicy ordering and diagnostics.

transcribecallable

transcribe(request: ASRRequest) -> iterable[Mapping]. Every segment must provide text, timecode_start and timecode_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=False and allow_download=False without 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.

capability: str | None = None#
degrades_on_failure: bool = True#
fallback_exceptions: tuple[type[BaseException], ...] = (<class 'Exception'>,)#
may_download: bool = False#
name: str[source]#
offline_capable: bool = False#
requires_network: bool = False#
transcribe: Callable[[ASRRequest], Iterable[Mapping[str, Any]]][source]#