Process speaker labels with LeMUR
In this guide, you’ll learn how to use AssemblyAI’s API to transcribe audio, identify speakers, and infer their names using LeMUR. We’ll walk through the process of configuring the transcriber, submitting a transcript to LeMUR with speaker labels, and generating a mapping of speaker names from the transcript.
This workflow will enable you to have speaker labels with the speaker’s name in your transcripts:
Before you begin
To complete this tutorial, you need:
- Python installed.
- An upgraded AssemblyAI account.
For the entire source code of this guide, see Speaker Identification.
Step-by-step instructions
Install the Python SDK:
Define a Transcriber
, a TranscriptionConfig
with speaker_labels
set to True
. Then, create a transcript.
Process the transcript with speaker labels:
Count the unique speakers, then create a LemurQuestion
for each speaker. Lastly, ask LeMUR the questions, specifying text_with_speaker_labels
as the input_text
.
Map the speaker alphabets to their names from LeMUR:
Print the transcript with Speaker names:
Output: