Utilize LeMUR feature
input_text
parameter. The input_text
option allows you to modify the transcripts before processing it using LeMUR, and in this example, format Speaker Labels in your LeMUR request.
transcript_ids
is preferred as default. Depending on your use case, you can alternatively use the input_text
parameter to call LeMUR with custom formatted transcript data including edited transcripts, speaker-labelled transcripts and more.input_text
parameter. We will use the Custom Task endpoint to prompt LeMUR. You can use any LeMUR Endpoint and adjust the prompt parameters to suit your project’s needs.
assemblyai
and set your API key:
TranscriptionConfig
with speaker_labels
set to True
.
Transcriber
object’s transcribe
method and parse the configuration and the audio file’s path as a parameter. The transcribe
method will save the results of the transcription to the Transcriber
object’s transcript
attribute.
text
to store the output. Iterate through each utterance in the transcript to append the formatted Speaker Labels to be used as the input_text
LeMUR parameter.
Lemur's task
method on your transcript and parse the prompt
and input_text
parameters. The text
variable contains the formatted Speaker Labels and Text response
from your transcript.
The result is stored in response
as a string.