Ask questions about your audio data
In this guide, you'll learn how to use LeMUR to ask questions and get answers about your audio data.
If you want a Quickstart, see Apply LLMs to audio files.
To use LeMUR, you need an with a credit card set up.
With the LeMUR Task, you can send any prompt to the LLM and apply the model to your transcribed audio files.
Basic Q&A example
To ask question about your audio data, define a prompt with your questions and call transcript.lemur.task()
. The underlying transcript
is automatically used as additional context for the model.
Example output
Based on the transcript, runner's knee is a condition characterized
by pain behind or around the kneecap. It is caused by overuse,
muscle imbalance and inadequate stretching. Symptoms include pain
under or around the kneecap and pain when walking.
Structured Q&A example
In this example, we will use an advanced prompt with a structured input question format and a structured XML response format.
First, define a list of aai.LemurQuestion
objects. For each question, you can define additional context
and specify either a answer_format
or a list of answer_options
.
Construct a formatted string to structure the questions from the LemurQuestion
object. This includes the question text, optional context, an answer format, and any answer options.
Construct the formatted question string for all the questions within the list of aai.LemurQuestion
objects.
Create a prompt with detailed instructions about how to answer the series of questions. The prompt also includes an XML template that should be used as response format.
Prompt the LeMUR model using transcript.lemur.task()
:
More Q&A prompt examples
Try any of these prompts to get started:
Question and answer Answer any questions about your audio | "Identify any patterns or trends based on the transcript" |
Closed-ended questions Answer simple yes/no questions | "Did the customer express a positive sentiment in the phone call?" |
Sentiment analysis Assess the emotional sentiment of a conversation | "What was the emotional sentiment of the phone call?" |
For more use cases and prompt examples, see LeMUR examples.
Improve the results
To improve the results, see the following resources:
- Optimize your prompt with the prompt engineering guide.
- To alter the outcome, see Customize LeMUR parameters.
- To get more deterministic and structured outputs for predefined tasks, see Specialized endpoints.