Skip to main content

Get speaker-attributed transcripts with our diarize endpoint

Use our hosted open-source STT models with specialized reconciliation to obtain speaker-attributed transcripts.

Prerequisites

Use this tutorial only if you have your own transcripts from another STT service (like OpenAI Whisper, Google Speech-to-Text, etc.) that you want to combine with diarization results.
  • Diarization results from pyannoteAI
  • Transcript segments from your chosen ASR service

Step 1: Get diarization segments

First, get diarization segments from a diarization job (see how to diarize and Get job).
Set the exclusive parameter to true when requesting diarization for speaker-attributed transcripts.
  • This removes overlapping speech, ensuring each segment contains exactly one speaker, which makes it easier to align with STT/ASR results that don’t normally work well with overlapping speech.
  • Note: Exclusive diarization results are provided in the exclusiveDiarization field of the job output, alongside the regular diarization results.
Here is an example of some diarization segments:
Example diarization segments
Note that the segments contain start and end timestamps in seconds along with speaker labels.

Step 2: Get transcript segments with timestamps

Get the transcript segments with timestamps based on the same audio with your chosen ASR service. Here is an example of OpenAI gpt-4o-transcribe and whisper-1 API transcript output, with segment timestamps:
Example OpenAI transcript segments
Here, the segments array contains start and end timestamps in seconds along with the transcribed text.

Step 3: Merge results

Combine the diarization segments with the ASR transcript segments by aligning them based on their timestamps. You can use the following segment-level adaptation of WhisperX’s current assign_word_speakers logic in diarize.py:
merge_diarization_asr.py
Resulting merged segments will look something like this:
Merged diarization + ASR segments
Learn more about WhisperX on GitHub and OpenAI Whisper