video-accessibility/backend/app
michael 3588d3fa14 refactor: rewrite pause point refinement algorithm with ordered logic
Completely rewrites the Whisper-based pause point refinement to use
a two-phase approach with explicit ordering:

Phase 1 - Individual refinement:
1. Check if pause point is "during speaking" (words within ±2s)
   - If NOT during speaking → use Gemini's exact point, no overlap
2. If during speaking, find nearest sentence boundary
3. Apply appropriate buffering based on context:
   - Case A: First sentence → pause 500ms before sentence starts
   - Case B: Last sentence → pause 500ms after sentence ends
   - Case C: Between sentences → full double buffer (overlap)

Phase 2 - Consolidation (after all refinements):
- Consolidate cues within 5s of each other to play back-to-back

Key changes:
- Add SentenceBoundary dataclass for tracking boundaries with context
- Add _is_during_speaking() helper to detect speech proximity
- Add _find_sentence_boundaries() with longest-gap fallback
- Rewrite snap_pause_point() with new ordered algorithm
- Update refine_all_pause_points() to pass words and use two phases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 08:19:03 -06:00
..
__pycache__ fixed middleware silent swallowing of exceptions FINALLY 2025-10-08 18:19:59 -05:00
api/v1 refactor: simplify GCS job deletion to use prefix-based cleanup 2025-12-28 10:07:43 -06:00
core feat: switch Whisper model from large-v3 to medium 2025-12-28 22:35:47 -06:00
lib initial commit 2025-08-24 16:28:33 -05:00
middleware fixed overly aggressive security algorithm 2025-10-08 17:49:20 -05:00
migrations fix: add rendering_video status to MongoDB schema validator 2025-12-27 08:40:23 -06:00
models feat: add rendering_video status for accessible video processing 2025-12-27 06:49:46 -06:00
prompts feat: improve pause point precision with sentence boundary detection 2025-12-28 14:41:12 -06:00
schemas feat: implement full-gap-overlap algorithm for AD pause insertion 2025-12-28 22:51:49 -06:00
services refactor: rewrite pause point refinement algorithm with ordered logic 2025-12-29 08:19:03 -06:00
tasks refactor: rewrite pause point refinement algorithm with ordered logic 2025-12-29 08:19:03 -06:00
telemetry initial commit 2025-08-24 16:28:33 -05:00
main.py feat: add video review with timestamped notes to Final Review 2025-12-26 15:30:00 -06:00