This document defines predefined cleanup configuration profiles for common use cases. These profiles can be referenced by name in API calls or used as starting points for custom configurations.
Description: Minimal cleanup - only essential normalization, no content changes
Use Case: When you want to preserve the original transcript as closely as possible, but fix basic formatting issues
Configuration:
{
"normalize_unicode": true,
"normalize_whitespace": true,
"remove_special_tokens": false,
"preserve_sound_events": true,
"add_punctuation": false,
"punctuation_mode": "none",
"capitalize": false,
"remove_fillers": false,
"filler_level": 0,
"segment_sentences": false,
"merge_short_segments": false
}Example Transformation:
Input: " um hello world "
Output: "um hello world"
Description: Balanced cleanup with conservative filler removal and basic punctuation
Use Case: General-purpose cleanup suitable for most transcripts. Good default for YouTube and Whisper content.
Configuration:
{
"normalize_unicode": true,
"normalize_whitespace": true,
"remove_special_tokens": true,
"preserve_sound_events": false,
"add_punctuation": true,
"punctuation_mode": "rule-based",
"add_internal_punctuation": false,
"capitalize": true,
"fix_all_caps": true,
"remove_fillers": true,
"filler_level": 1,
"segment_sentences": true,
"merge_short_segments": true,
"min_segment_length_ms": 1000,
"max_gap_for_merge_ms": 500,
"speaker_format": "structured",
"detect_hallucinations": true,
"language_specific_rules": true
}Example Transformation:
Input: "[MUSIC] um hello everyone uh welcome to the show"
Output: "Hello everyone, welcome to the show."
Description: Maximum cleanup with aggressive filler removal and formatting
Use Case: When you want the cleanest possible output and don't mind some semantic changes (e.g., removing "like", "you know")
Configuration:
{
"normalize_unicode": true,
"normalize_whitespace": true,
"remove_special_tokens": true,
"preserve_sound_events": false,
"add_punctuation": true,
"punctuation_mode": "rule-based",
"add_internal_punctuation": true,
"capitalize": true,
"fix_all_caps": true,
"remove_fillers": true,
"filler_level": 3,
"segment_sentences": true,
"merge_short_segments": true,
"min_segment_length_ms": 500,
"max_gap_for_merge_ms": 1000,
"speaker_format": "dialogue",
"detect_hallucinations": true,
"language_specific_rules": true
}Example Transformation:
Input: "so like I think you know it's kind of really good"
Output: "I think it's really good."
Description: Optimized for cleaning YouTube auto-generated captions
Use Case: Processing YouTube auto-captions which often have specific formatting issues
Configuration:
{
"normalize_unicode": true,
"normalize_whitespace": true,
"remove_special_tokens": true,
"preserve_sound_events": false,
"add_punctuation": true,
"punctuation_mode": "rule-based",
"add_internal_punctuation": false,
"capitalize": true,
"fix_all_caps": true,
"remove_fillers": true,
"filler_level": 2,
"segment_sentences": true,
"merge_short_segments": true,
"min_segment_length_ms": 800,
"max_gap_for_merge_ms": 600,
"speaker_format": "structured",
"detect_hallucinations": false,
"language_specific_rules": true
}Notes:
- YouTube captions typically don't have hallucinations (unlike Whisper)
- Often have run-on segments that benefit from sentence splitting
- May have moderate fillers that benefit from level 2 removal
Description: Optimized for Whisper transcription output
Use Case: Post-processing Whisper-generated transcripts
Configuration:
{
"normalize_unicode": true,
"normalize_whitespace": true,
"remove_special_tokens": true,
"preserve_sound_events": false,
"add_punctuation": true,
"punctuation_mode": "rule-based",
"add_internal_punctuation": false,
"capitalize": true,
"fix_all_caps": false,
"remove_fillers": true,
"filler_level": 1,
"segment_sentences": false,
"merge_short_segments": true,
"min_segment_length_ms": 1000,
"max_gap_for_merge_ms": 500,
"speaker_format": "structured",
"detect_hallucinations": true,
"language_specific_rules": true
}Notes:
- Whisper already segments well, so less aggressive sentence splitting
- Hallucination detection is important for Whisper output
- Whisper typically has good capitalization, less aggressive fixing
Description: Cleanup for presentation-style content (talks, lectures)
Use Case: Conference talks, lectures, educational content where speaker changes and pauses are important
Configuration:
{
"normalize_unicode": true,
"normalize_whitespace": true,
"remove_special_tokens": false,
"preserve_sound_events": true,
"add_punctuation": true,
"punctuation_mode": "rule-based",
"add_internal_punctuation": true,
"capitalize": true,
"fix_all_caps": true,
"remove_fillers": false,
"filler_level": 0,
"segment_sentences": true,
"merge_short_segments": false,
"speaker_format": "dialogue",
"detect_hallucinations": true,
"language_specific_rules": true
}Notes:
- Preserves natural speech patterns including fillers
- Keeps sound events like [APPLAUSE] for context
- Uses dialogue format for clear speaker attribution
- Doesn't merge segments to preserve natural pauses
Description: Minimal cleanup for technical content with code, URLs, or specialized terminology
Use Case: Technical tutorials, coding streams, developer content
Configuration:
{
"normalize_unicode": false,
"normalize_whitespace": true,
"remove_special_tokens": false,
"preserve_sound_events": true,
"add_punctuation": true,
"punctuation_mode": "rule-based",
"add_internal_punctuation": false,
"capitalize": false,
"fix_all_caps": false,
"remove_fillers": true,
"filler_level": 1,
"segment_sentences": false,
"merge_short_segments": true,
"speaker_format": "structured",
"detect_hallucinations": true,
"language_specific_rules": false
}Notes:
- Preserves Unicode characters (for code snippets, symbols)
- Minimal capitalization changes (preserves case-sensitive terms)
- Doesn't fix all-caps (may be intentional acronyms)
- Conservative language rules to avoid breaking technical terms
Description: Optimized for accessibility and screen reader compatibility
Use Case: Transcripts intended for users with disabilities using assistive technology
Configuration:
{
"normalize_unicode": true,
"normalize_whitespace": true,
"remove_special_tokens": false,
"preserve_sound_events": true,
"add_punctuation": true,
"punctuation_mode": "rule-based",
"add_internal_punctuation": true,
"capitalize": true,
"fix_all_caps": true,
"remove_fillers": true,
"filler_level": 2,
"segment_sentences": true,
"merge_short_segments": false,
"speaker_format": "inline",
"detect_hallucinations": true,
"language_specific_rules": true
}Notes:
- Keeps sound events for context (important for screen readers)
- More internal punctuation for better screen reader pacing
- Inline speaker format for clear attribution
- Doesn't merge to preserve natural speech rhythm
# Get cleaned transcript using standard profile
curl -X GET "http://localhost:8000/videos/{video_id}/transcript?format=cleaned&profile=standard"# Use standard profile but override filler level
curl -X POST "http://localhost:8000/transcripts/{transcript_id}/cleanup" \
-H "Content-Type: application/json" \
-d '{
"profile": "standard",
"overrides": {
"filler_level": 3,
"speaker_format": "dialogue"
}
}'# Fully custom configuration
curl -X POST "http://localhost:8000/transcripts/{transcript_id}/cleanup" \
-H "Content-Type: application/json" \
-d '{
"config": {
"normalize_unicode": true,
"remove_fillers": true,
"filler_level": 2,
"add_punctuation": true,
"capitalize": true
}
}'from transcript_create_client import TranscriptCreateClient
from transcript_create_client.models import CleanupConfig
client = TranscriptCreateClient(api_key="your_api_key")
# Use predefined profile
transcript = await client.get_transcript(
video_id="123e4567-e89b-12d3-a456-426614174000",
format="cleaned",
profile="standard"
)
# Use profile with overrides
transcript = await client.cleanup_transcript(
transcript_id="123e4567-e89b-12d3-a456-426614174000",
profile="aggressive",
overrides={"filler_level": 2}
)
# Custom configuration
config = CleanupConfig(
remove_fillers=True,
filler_level=3,
add_punctuation=True,
capitalize=True
)
transcript = await client.cleanup_transcript(
transcript_id="123e4567-e89b-12d3-a456-426614174000",
config=config
)Use this decision tree to choose the right profile:
-
Is the content technical (code, URLs, commands)?
- Yes → Use
technicalprofile - No → Continue
- Yes → Use
-
Is this for accessibility/screen readers?
- Yes → Use
accessibilityprofile - No → Continue
- Yes → Use
-
Is the source YouTube auto-captions?
- Yes → Use
youtube_captionsprofile - No → Continue
- Yes → Use
-
Is the source Whisper transcription?
- Yes → Use
whisper_outputprofile - No → Continue
- Yes → Use
-
Is this a presentation/lecture?
- Yes → Use
presentationprofile - No → Continue
- Yes → Use
-
Do you want maximum cleanup?
- Yes → Use
aggressiveprofile - No → Use
standardprofile (default)
- Yes → Use
-
Need minimal changes?
- Yes → Use
minimalprofile
- Yes → Use
You can define custom profiles in your application configuration:
# app/cleanup_profiles.py
CUSTOM_PROFILES = {
"my_custom_profile": CleanupConfig(
normalize_unicode=True,
remove_fillers=True,
filler_level=2,
add_punctuation=True,
# ... other settings
)
}Then register them in your API:
# app/routes/transcripts.py
from app.cleanup_profiles import CUSTOM_PROFILES
@router.get("/cleanup/profiles")
async def list_cleanup_profiles():
"""List all available cleanup profiles."""
return {
"profiles": list(CLEANUP_PROFILES.keys()) + list(CUSTOM_PROFILES.keys())
}
@router.get("/cleanup/profiles/{profile_name}")
async def get_cleanup_profile(profile_name: str):
"""Get details of a specific cleanup profile."""
if profile_name in CLEANUP_PROFILES:
return CLEANUP_PROFILES[profile_name]
elif profile_name in CUSTOM_PROFILES:
return CUSTOM_PROFILES[profile_name]
else:
raise HTTPException(status_code=404, detail="Profile not found")To test a profile on sample data, you can use the development/debugging test endpoint (note: this endpoint is for testing purposes and may not be available in production):
# Use the test endpoint (development/debugging only)
curl -X POST "http://localhost:8000/cleanup/test" \
-H "Content-Type: application/json" \
-d '{
"text": "um hello everyone [MUSIC] welcome to the show",
"profile": "standard"
}'Expected response format (for development/debugging):
{
"input": "um hello everyone [MUSIC] welcome to the show",
"output": "Hello everyone, welcome to the show.",
"profile": "standard",
"transformations": [
"removed_filler: um",
"removed_special_token: [MUSIC]",
"added_capitalization",
"added_punctuation: ."
]
}Note: The /cleanup/test endpoint shown above is a proposed development/debugging endpoint and is not part of the core API specification. It should be implemented as a convenience tool for testing cleanup transformations during development.
Profile complexity affects processing time:
| Profile | Relative Speed | Memory Usage |
|---|---|---|
| minimal | Fastest (1x) | Lowest |
| standard | Fast (1.2x) | Low |
| youtube_captions | Medium (1.5x) | Medium |
| whisper_output | Fast (1.1x) | Low |
| aggressive | Slower (2x) | Medium |
| technical | Fast (1.1x) | Low |
| presentation | Medium (1.3x) | Medium |
| accessibility | Medium (1.4x) | Medium |
Note: Model-based punctuation (if enabled) adds significant overhead (~5-10x) but provides better quality.
| Version | Date | Changes |
|---|---|---|
| 1.0 | 2025-11-02 | Initial profiles defined |