File size: 1,416 Bytes
8c838e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
tags:
  - pyannote
  - pyannote-audio
  - pyannote-audio-pipeline
  - audio
  - voice
  - speech
  - speaker
  - speaker-diarization
  - speaker-change-detection
  - voice-activity-detection
  - overlapped-speech-detection
---

# `Precision-2` speaker diarization

This pipeline runs `Precision-2` speaker diarization on [pyannoteAI](https://www.pyannote.ai) cloud.  
Read the announcement [blog post](https://www.pyannote.ai/blog/precision-2).

This pipeline is a stripped down version of pyannoteAI SDK that provides [much more features](https://docs.pyannote.ai):
* speaker diarization optimized for speech-to-text
* speaker voiceprinting and identification
* confidence scores
* and more...

A self-hosted version of `Precision-2` is also available for enterprise customers.

## Setup

1. `pip install pyannote.audio`
2. Create an API key on [`pyannoteAI` dashboard](https://dashboard.pyannote.ai) (free credits included)

## Usage

```python
# initialize speaker diarization pipeline
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained(
    'pyannote/speaker-diarization-precision-2', 
    token="{pyannoteAI-api-key}")

# run speaker diarization on pyannoteAI cloud
output = pipeline("/path/to/audio.wav")

# enjoy state-of-the-art speaker diarization
for turn, speaker in output.speaker_diarization:
    print(f"start={turn.start:.1f}s stop={turn.end:.1f}s speaker_{speaker}")
```