Skip to content

Feedback: guides-transcript-citations

Original URL: https://www.assemblyai.com/docs/guides/transcript-citations
Category: guides
Generated: 05/08/2025, 4:34:19 pm


Generated: 05/08/2025, 4:34:18 pm

Technical Documentation Analysis: Transcript Citations Guide

Section titled “Technical Documentation Analysis: Transcript Citations Guide”

This documentation provides a functional code example but lacks the structure, explanations, and completeness needed for effective technical documentation. Here’s my detailed feedback:

Problem: The title “Extract Quotes with Timestamps Using LeMUR + Semantic Search” doesn’t match the URL path “transcript-citations” and creates confusion about the document’s purpose.

Solutions:

  • Align the title with the URL: “Transcript Citations: Finding Timestamped Quotes with LeMUR and Semantic Search”
  • Add a clear introduction explaining what transcript citations are and why they’re useful
  • Include a “What You’ll Learn” section

Problem: Users jump straight into code without understanding requirements.

Add:

## Prerequisites
- Python 3.8 or higher
- AssemblyAI API key ([get one here](link))
- Basic familiarity with Python and machine learning concepts
- Audio/video file or URL to transcribe (supported formats: MP3, MP4, WAV, etc.)
## System Requirements
- Minimum 4GB RAM (embeddings can be memory-intensive)
- Internet connection for API calls and model downloads

Problem: The quickstart dumps all code without explanation, making it difficult for users to understand or modify.

Solutions:

  • Break the quickstart into logical sections with explanations
  • Add inline comments explaining complex operations
  • Explain the workflow before showing code:
## How It Works
1. **Transcribe Audio**: Convert your audio to text with timestamps
2. **Create Sentence Groups**: Use sliding windows to group sentences for better context
3. **Generate Embeddings**: Convert text to numerical vectors for comparison
4. **Query LeMUR**: Ask AI to identify the best quotes
5. **Find Matches**: Use semantic search to locate exact timestamps in the transcript

Problem: No error handling or discussion of potential failures.

Add:

# Add error handling examples
try:
transcript = transcriber.transcribe("URL_OR_FILE_PATH_HERE")
if transcript.status == aai.TranscriptStatus.error:
print(f"Transcription failed: {transcript.error}")
exit(1)
except Exception as e:
print(f"Failed to transcribe: {e}")
exit(1)
# Handle empty results
if not sentences:
print("No sentences found in transcript")
exit(1)

Problem: Magic numbers (5, 2) in sliding window with minimal explanation.

Improve:

## Customizing Quote Length
The sliding window parameters control quote characteristics:
| Parameter | Value | Effect |
|-----------|--------|---------|
| `distance` | 5 | Number of sentences per quote (affects length) |
| `stride` | 2 | Sentence overlap (affects coverage) |
**Examples**:
- Short quotes (15-20s): `distance=3, stride=1`
- Medium quotes (30-45s): `distance=5, stride=2` (default)
- Long quotes (60s+): `distance=8, stride=3`

Problem: Only one generic example provided.

Add:

## Example Use Cases
### 1. Podcast Highlights
```python
questions = [
aai.LemurQuestion(
question="Find the most insightful quotes about [topic]",
context="Focus on actionable advice and unique perspectives.",
)
]
questions = [
aai.LemurQuestion(
question="What are the most important answers the interviewee gave?",
context="Prioritize substantive responses over small talk.",
)
]
questions = [
aai.LemurQuestion(
question="Extract the main teaching points from this lecture",
context="Focus on key concepts and explanations.",
)
]

Problem: Users don’t know what to expect.

Add:

## Expected Output

QUOTE #1: “The most important thing to remember about machine learning is that it’s not magic. It’s statistics, and statistics require good data to produce meaningful results.” START TIMESTAMP: 0:02:15 END TIMESTAMP: 0:02:28 CONFIDENCE: 0.94

QUOTE #2: “When you’re building embeddings, the choice of model matters tremendously. You want something that understands the semantic meaning, not just word matching.” START TIMESTAMP: 0:05:42 END TIMESTAMP: 0:05:55 CONFIDENCE: 0.87

Add:

## Troubleshooting
### Common Issues
**"No module named 'sentence_transformers'"**
- Solution: Run `pip install sentence-transformers`
**Low confidence scores (< 0.5)**
- The LeMUR query might be too specific
- Try broader questions or adjust sliding window parameters
**Empty results**
- Check if your audio file was transcribed successfully
- Verify the file format is supported
**Memory errors**
- Reduce sliding window distance
- Process shorter audio files
- Increase system RAM

Add:

## Performance Notes
- **Transcription time**: ~1/10th of audio length
- **Embedding generation**: ~1-2 seconds per sentence group
- **Memory usage**: ~100MB per hour of audio
- **Model download**: ~400MB on first run (cached afterward)
# Transcript Citations: Finding Timestamped Quotes with LeMUR and Semantic Search
## Overview
Brief explanation of what transcript citations are and benefits
## Prerequisites
System requirements, API keys, knowledge requirements
## Quick Start
Minimal working example with explanations
## How It Works
Step-by-step workflow explanation
## Detailed Implementation
Full code with comprehensive explanations
## Customization
Parameters, different use cases, advanced options
## Example Outputs
What users should expect to see
## Troubleshooting
Common issues and solutions
## Performance & Limits
What to expect in terms of speed and resource usage
## Next Steps
Links to related features, advanced guides

This restructured approach would significantly improve user experience by providing context, handling edge cases, and offering clear guidance for customization and troubleshooting.