tool

pyannote speaker diarization tool.

Classes

PyannoteDiarizationTool

pyannote diarization tool.

class PyannoteDiarizationTool(model_name='pyannote/speaker-diarization-3.1', api_token=None, device='cpu', overwrite=False, verbose=True)[source]

Bases: DiarizationTool

pyannote diarization tool.

Parameters:
  • model_name (str) – The name of the model to use.

  • api_token (Optional[str]) – The HuggingFace API token to use.

  • device (str) – The device where the computation should be executed.

  • overwrite (bool) – Whether to overwrite existing files, otherwise raise an error.

  • verbose (Union[bool, int]) – Whether to execute the computation verbosely.

inference(audio_path, diarization_path, num_speakers=None)[source]

Implementation of pyannote’s diarization inference method.

Parameters:
  • audio_path (Union[str, Path]) – Path to the audio track.

  • diarization_path (Union[str, Path]) – Path to the diarization file.

  • num_speakers (Optional[int]) – Number of speaking participants, if ignored the model will try to guess it, it is advised to specify it.

Returns: