Identify Speaker Names From the Transcript Using 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 instead of Speaker A/B
.
Before you begin
To complete this tutorial, you need:
- Python installed.
- An upgraded AssemblyAI account.
Import the assemblyai
and re
packages and set your API key:
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: