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.
Calling LeMUR using
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.Get Started
Before we begin, make sure you have an AssemblyAI account and an API key. You can sign up for an account and get your API key from your dashboard. LeMUR features are currently only available to paid users, at two pricing tiers: LeMUR and LeMUR Basic. Refer to pricing for more details.Step-by-Step Instructions
In this guide, we will include Speaker Labels to the conversation by using theinput_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.
- Install the SDK.
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.