Skip to main content

Neural building blocks for speaker diarization

Project description

Using open-source toolkit in production? Make the most of it thanks to our consulting services. speaker diarization toolkit is an open-source toolkit written in Python for speaker diarization. Based on PyTorch machine learning framework, it comes with state-of-the-art pretrained models and pipelines, that can be further finetuned to your own data for even better performance.


  1. Install with pip install
  2. Accept pyannote/segmentation-3.0 user conditions
  3. Accept pyannote/speaker-diarization-3.1 user conditions
  4. Create access token at
from import Pipeline
pipeline = Pipeline.from_pretrained(

# send pipeline to GPU (when available)
import torch"cuda"))

# apply pretrained pipeline
diarization = pipeline("audio.wav")

# print the result
for turn, _, speaker in diarization.itertracks(yield_label=True):
    print(f"start={turn.start:.1f}s stop={turn.end:.1f}s speaker_{speaker}")
# start=0.2s stop=1.5s speaker_0
# start=1.8s stop=3.9s speaker_1
# start=4.2s stop=5.7s speaker_0
# ...




Out of the box, speaker diarization pipeline v3.1 is expected to be much better (and faster) than v2.x. Those numbers are diarization error rates (in %):

Benchmark v2.1 v3.1 Premium
AISHELL-4 14.1 12.3 11.9
AliMeeting (channel 1) 27.4 24.5 22.5
AMI (IHM) 18.9 18.8 16.6
AMI (SDM) 27.1 22.6 20.9
AVA-AVD 66.3 50.0 39.8
CALLHOME (part 2) 31.6 28.4 22.2
DIHARD 3 (full) 26.9 21.4 17.2
Ego4D (dev.) 61.5 51.2 43.8
MSDWild 32.8 25.4 19.8
REPERE (phase2) 8.2 7.8 7.6
VoxConverse (v0.3) 11.2 11.2 9.4

Diarization error rate (in %)


If you use please use the following citations:

  author={Alexis Plaquet and Hervé Bredin},
  title={{Powerset multi-class cross entropy loss for neural speaker diarization}},
  booktitle={Proc. INTERSPEECH 2023},
  author={Hervé Bredin},
  title={{ 2.1 speaker diarization pipeline: principle, benchmark, and recipe}},
  booktitle={Proc. INTERSPEECH 2023},


The commands below will setup pre-commit hooks and packages needed for developing the library.

pip install -e .[dev,testing]
pre-commit install



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (14.8 MB view hashes)

Uploaded Source

Built Distribution (208.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page