Repository navigation
Translate captions as whole sentences - #174
Merged
Merged
Conversation
Each caption went to the translator alone, and a caption often ends mid-sentence: a Polish talk's "chociaż będziemy rozmawiać o" came back as "Although we will talk about", and its next line as "Technological, why her". Consecutive captions are now joined up to a sentence's end (at most six), translated together, and the translation is shared back over them by length, broken between words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Found while translating the captions of a 75 s Polish talk into English on the emulator (Whisper Base, then the offline Polish → English model, #47).
Before: each caption went to Marian alone. Captions often end mid-sentence, so the fragments came back as fragments, capitalised as if each were a sentence:
After:
CaptionSentences.groupjoins consecutive captions up to a sentence's end (.,?,!,…; at most six captions, so run-on speech stays a reasonable input), and the view model translates those.CaptionSentences.splitshares each translation back over its captions in proportion to their length, breaking between words, with a word for every caption while there are enough.TranslateCaptionsis unchanged: each copy keeps its caption's time, and its words share it by length.Test plan
CaptionTranslationTest: grouping on the Polish captions, and splitting by length.:core:model:test,:feature:captions:testDebugUnitTestandspotlessCheckpass.🤖 Generated with Claude Code