cdp_backend.sr_models package#

Submodules#

cdp_backend.sr_models.sr_model module#

class cdp_backend.sr_models.sr_model.SRModel[source]#

Bases: ABC

abstract transcribe(file_uri: str | Path, **kwargs: Any) Transcript[source]#

Transcribe audio from file and return a Transcript model.

Parameters:
file_uri: Union[str, Path]

The uri to the audio file or caption file to transcribe.

kwargs: Any

Any extra kwargs to use in this model’s transcribe function.

Returns:
outputs: transcript_model.Transcript

The transcript model for the supplied media file.

cdp_backend.sr_models.whisper module#

class cdp_backend.sr_models.whisper.WhisperModel(model_name: str = 'medium', confidence: float | None = None, **kwargs: Any)[source]#

Bases: SRModel

Initialize an OpenAI Whisper Model Transcription processor.

Parameters:
model_name: str

The model version to use. Default: “medium” See: https://github.com/openai/whisper/tree/0b5dcfdef7ec04250b76e13f1630e32b0935ce76#available-models-and-languages

confidence: Optional[float]

A confidence value to set for all transcripts produced by this SR Model. See source code for issues related to this. Default: None (lookup a fake confidence to use depending on model selected)

kwargs: Any

Any extra arguments to catch.

transcribe(file_uri: str | Path, **kwargs: Any) Transcript[source]#

Transcribe audio from file and return a Transcript model.

Parameters:
file_uri: Union[str, Path]

The uri to the audio file or caption file to transcribe.

kwargs: Any

Any extra arguments to catch.

Returns:
outputs: transcript_model.Transcript

The transcript model for the supplied media file.

Module contents#

Speech recognition models package for cdp_backend.