fix(crispasr): filter garbage words from parakeet word-level timestamps#10421
Merged
mudler merged 1 commit intoJun 21, 2026
Merged
Conversation
The parakeet-specific word accessors can return stale initialisation data (model name, binary blobs) for segments with no real speech. Add isValidWord() to filter out words that have: - empty or whitespace-only text - U+FFFD replacement characters (from binary data scrubbing) - negative timestamps - zero duration (end <= start) Also skip empty segments entirely when they have no recognisable content (empty text AND no valid words), preventing spurious subtitle entries like '00:45:33,592 --> 00:45:33,592 parakeet@rH\u000b\ufffdI'. Applies to both AudioTranscription and AudioTranscriptionStream. Signed-off-by: fqscfqj <fqscfqj@outlook.com>
39eb6ba to
fa578bc
Compare
mudler
approved these changes
Jun 21, 2026
Owner
|
Thanks @fqscfqj ! |
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.
Problem
When using parakeet models with word-level timestamps enabled, spurious subtitle entries appear with garbage content:
This happens because the parakeet-specific word accessors (
crispasr_parakeet_result_*) return stale initialisation data — the model name and binary blobs — for segments with no real speech (e.g. trailing silence, pure noise).Root Cause
The
AudioTranscriptioncode falls back to parakeet-specific word functions whenCppGetWordCount(i) == 0 && i == 0. These functions return a global word list that may contain initialisation artifacts when no speech was detected. The data was passed through without validation.Fix
Added
isValidWord()filter that rejects words with:end <= start) — the garbage "parakeet" word hasstart == end == 0Also skip empty segments entirely when they have no recognisable content (empty text AND no valid words), preventing them from appearing in SRT/VTT output.
Applied to both
AudioTranscriptionandAudioTranscriptionStream.Testing
Verified on a live deployment (RTX 3090,
parakeet-tdt-0.6b-v3-q8_0.gguf):parakeet@rH\u000b\ufffdIsegment