> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pyannote.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up output scores

> Understand confidence and frame-level probability scores, and use them for quality assessment and human-in-the-loop correction.

Every score the API returns is a number between `0` and `100`, where higher means the model is more certain. There are two families:

* **Frame-level probability scores** — well-calibrated probabilities sampled on a regular time axis, describing what is happening in the audio at each instant.
* **Confidence scores** — how certain the model is about a speaker assignment, per turn.

## Which scores are available

| Score                     | Request parameter      | Shape                   |
| ------------------------- | ---------------------- | ----------------------- |
| Speech probability        | `speechProbability`    | One curve               |
| Cross-talk probability    | `crosstalkProbability` | One curve               |
| Speaker probability       | `speakerProbability`   | One curve per speaker   |
| Turn-level confidence     | `turnLevelConfidence`  | Per diarization segment |
| Identification confidence | *(always on)*          | Per voiceprint match    |

All of these work the same way on [diarize](/api-reference/diarize) and [identify](/api-reference/identify).

## Frame-level probability scores

The three probability scores answer three different questions about the same moment in time:

* **`speechProbability`** — is *anyone* speaking?
* **`crosstalkProbability`** — is *more than one person* speaking?
* **`speakerProbability`** — is *this particular speaker* speaking?

Each is a boolean request parameter, defaulting to `false`. Each returns an object with a `score` and a `resolution`:

```json Example output theme={null}
{
  "speechProbability": {
    "resolution": 0.02,
    "score": [95, 89, 78, 67, 56, 45, 34, 23, 12, 1]
  },
  "crosstalkProbability": {
    "resolution": 0.02,
    "score": [3, 8, 61, 74, 12, 4, 2, 1, 0, 0]
  },
  "speakerProbability": {
    "resolution": 0.02,
    "score": {
      "SPEAKER_00": [95, 89, 12, 4, 8, 2, 1, 0, 0, 0],
      "SPEAKER_01": [5, 11, 88, 91, 85, 44, 33, 23, 12, 1]
    }
  }
}
```

* `score` — for `speechProbability` and `crosstalkProbability`, an array of values between `0` and `100`. For `speakerProbability`, an object keyed by speaker label, each holding such an array.
* `resolution` — seconds per sample. Fixed at `0.02` (20ms).

All three share the same frame axis, so index `i` refers to the same 20ms window in every score. To convert an index to a timestamp, multiply by the resolution: sample `i` starts at `i * resolution` seconds.

<Warning>
  On identification jobs, `speakerProbability` is always keyed by diarization labels (`SPEAKER_00`, `SPEAKER_01`, ...) — never by the voiceprint or target name. Use the `identification` array to map a diarization label to a matched name.
</Warning>

### Example request

<CodeGroup dropdown>
  ```python output_scores.py theme={null}
  import requests

  data = {
      "url": "https://files.pyannote.ai/marklex1min.wav",
      "model": "precision-3",
      "speechProbability": True,
      "crosstalkProbability": True,
      "speakerProbability": True,
  }

  response = requests.post(
      "https://api.pyannote.ai/v1/diarize",
      headers={"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"},
      json=data,
  )
  print(response.json())
  ```

  ```bash theme={null}
  curl -X POST "https://api.pyannote.ai/v1/diarize" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://files.pyannote.ai/marklex1min.wav",
      "model": "precision-3",
      "speechProbability": true,
      "crosstalkProbability": true,
      "speakerProbability": true
    }'
  ```

  ```typescript output_scores.ts theme={null}
  const data = {
    url: "https://files.pyannote.ai/marklex1min.wav",
    model: "precision-3",
    speechProbability: true,
    crosstalkProbability: true,
    speakerProbability: true,
  };

  const response = await fetch("https://api.pyannote.ai/v1/diarize", {
    method: "POST",
    headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
    body: JSON.stringify(data),
  });
  console.log(await response.json());
  ```
</CodeGroup>

## What to use the scores for

The scores exist so the decision can belong to your product logic rather than to the model.

* **Building high-quality voiceprints** — keep only segments above a `speakerProbability` or `turnLevelConfidence` threshold, trading recall for precision.
* **Routing to human review** — flag segments below a threshold instead of reviewing a whole transcript.
* **Monitoring quality over time** — track probability distributions per audio source to catch drift before it reaches your users.
* **Resolving overlap for speech-to-text** — most STT engines transcribe one speaker at a time. Use `speakerProbability` to decide which speaker is most likely being transcribed, or let [exclusive diarization](/features) do it for you.
* **Extracting clean training data** — raise `crosstalkSensitivity` to over-detect overlap (or filter on `crosstalkProbability`) to remove every contaminated section.

## Confidence scores

Confidence scores measure how certain the model is about a *speaker assignment*, rather than about acoustic activity. There are two kinds.

### Turn-level confidence

Add `"turnLevelConfidence": true` to your request. Each diarization segment gains a `confidence` object, keyed by speaker, giving the confidence of that speaker assignment:

```json theme={null}
{
  "start": 10.0,
  "end": 15.0,
  "speaker": "SPEAKER_00",
  "confidence": { "SPEAKER_00": 85, "SPEAKER_01": 15 }
}
```

### Identification confidence

Identification confidence is specific to speaker identification and shows how well each voiceprint matches each speaker. It is included automatically when using the [identify endpoint](/api-reference/identify) — no parameter required.

```json theme={null}
{
  "voiceprints": [
    {
      "speaker": "SPEAKER_00",
      "match": "John Doe",
      "confidence": {
        "John Doe": 86,
        "Jane Smith": 12
      }
    }
  ]
}
```

<Note>
  Identification confidence scores are different from diarization confidence scores. They measure how well a voiceprint matches a speaker, not how certain the diarization model is about the speaker assignment.
</Note>
