Fix alignment between the segments and the list of words#1087
Merged
jongwook merged 2 commits intoopenai:mainfrom Mar 13, 2023
guillaumekln:fix-words-list-alignment
Merged
Fix alignment between the segments and the list of words#1087jongwook merged 2 commits intoopenai:mainfrom guillaumekln:fix-words-list-alignment
jongwook merged 2 commits intoopenai:mainfrom
guillaumekln:fix-words-list-alignment
Conversation
Contributor
|
I'm testing this PR in relation to the SRT flashing in #1072 (reply in thread) and it looks like it fixes that issue: Using the test case: The SRT flashing would normally appear on punctuation such as block 27 below, where the underline momentarily disappears and it switches from the words to the segment text, but here they match: Before this PR, there was a flash in block 27 shown below: |
zackees
pushed a commit
to zackees/whisper
that referenced
this pull request
May 5, 2023
* Fix alignment between the segments and the list of words * Ensure the word index does not overflow
ilanit1997
pushed a commit
to ilanit1997/whisper
that referenced
this pull request
May 16, 2023
* Fix alignment between the segments and the list of words * Ensure the word index does not overflow
abyesilyurt
pushed a commit
to abyesilyurt/whisper
that referenced
this pull request
Nov 13, 2023
* Fix alignment between the segments and the list of words * Ensure the word index does not overflow
heejipark23
pushed a commit
to heejipark23/whisper
that referenced
this pull request
Sep 21, 2025
* Fix alignment between the segments and the list of words * Ensure the word index does not overflow
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.
This PR fixes the issue described in #1082.
I propose to use a simpler Python loop that iterates over each segment and aggregates the words based on the number of tokens.