Repository navigation
fix(auto): preserve Paraformer token alignment across VAD segments - #3793
Open
phoenixray2000 wants to merge 1 commit into
Open
phoenixray2000 wants to merge 1 commit into
phoenixray2000 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
Paraformer returns space-delimited ASR tokens with matching timestamps. When adjacent Chinese VAD chunks are joined for punctuation, their boundary separator is removed:
客 户+需 求becomes客 户需 求. Sentence segmentation then pairs three text units with four unchanged timestamps and punctuation labels. On long recordings this shifts words into earlier sentence timestamps and speaker turns, and can leave punctuation-only sentences at the end.Use the original ASR token text as the default input to timestamp segmentation. Keep the existing cleaned punctuation input and explicit
wordsalignment paths for SenseVoice and other surface-text backends. The regression exercises both sentence timestamps and speaker punctuation segmentation, checking text, raw token text, timestamp intervals, and speaker labels.Type of change
Validation
python -m compileall -q funasr examples testspython -m pytest -q tests/test_punc_model_none.py tests/test_timestamp_tools.py tests/test_sensevoice_word_timestamps.py: 41 passed, 10 subtests passed, including the existing SenseVoice tag, word-alignment, English surface-text, and malformed-metadata cases.git diff --check.User impact
Restores the correspondence between recognized tokens, sentence timestamps, and speaker turns in multi-segment Paraformer transcription. Recognition accuracy and automatic speaker-count estimation remain unchanged.
Notes for reviewers
The local Windows run deselects
TestLoadAudioBytes::test_decodes_no_id3_mp3_consistently_with_file_path: its still-openNamedTemporaryFilecannot be reopened by the audio decoder on Windows (Permission denied). The same failure was reproduced in a clean checkout of upstreamfbbfe018; the test remains selected by the upstream Linux workflow. Optional CI dependencies were installed in a separate test environment, leaving the production environment intact.The real recording is private. The checked-in reproduction is synthetic and requires no model weights. This PR contains only the alignment change and its regression test.