fix: group transcript captions into readable sentences - #2259
Open
pavzagor wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Transcript tab currently renders every subtitle cue as a separate row, splitting speech at commas, short pauses, and every eight words. This groups adjacent cues into sentence rows while preserving speaker boundaries and exact outer timestamps. Existing transcripts, translated captions, and provisional live transcripts benefit without retranscription.
Subtitle files retain their original timing. Owners can select Edit transcript to expose the original cues for precise corrections; edits never save a merged sentence under a single cue ID. Timestamped copying uses the readable sentence rows. Grouping also stops at long silence, overlaps, and bounded length/duration when punctuation is missing.
Depends on #2243 (AssemblyAI diarization). This branch is based on that PR's head,
2766dc0; merge that PR first. Until then, GitHub's cumulative diff includes the prerequisite. Review only this follow-up's four files.English before/after proof
A fresh AssemblyAI transcription of NASA's public JFK archival clip produces 12 caption fragments before → 3 sentence rows after, preserving all 72 words. Selecting the matching row on either side seeks the embedded source video to 12.850 seconds.
Watch/download the before/after MP4 · GitHub video page · Source clip · All proof files and methodology
The proof uses the actual old/new React components and real ASR output, with storage/auth hooks mocked. It is not production footage or proof of a persisted backend edit. Full local share-page verification was blocked by unavailable MySQL at
127.0.0.1:3306. NASA's clip splices two speeches; A/B are the unmodified ASR labels.Validation
git diff --checkpassed.tsc --noEmitpassed in the existing development checkout; the isolated checkout reused dependencies and was unsuitable for the workspace reference type check.The PR should not merge until sentence-boundary detection handles punctuation used by every supported transcript language, particularly Arabic questions.
Findings
Prompt To Fix All With AI
Summary
Review fix: multilingual sentence endings
Addressed the Arabic question-mark finding in
decfd40with UnicodeSentence_Terminal. Regression tests cover Arabic, quoted Arabic and Hindi, plus original/translated Arabic rendering and exact seeking. All 91 focused tests, TypeScript, scoped Biome and whitespace checks pass. The approved English output remains byte-for-byte equivalent as parsed sentence entries (12 fragments → 3 sentences).Review-fix walkthrough · Validation log · English parity check
This additional proof uses the actual component with a synthetic multilingual fixture and mocked storage/auth.