Repository navigation
fix(auto): preserve Paraformer token alignment across VAD segments - #3793
phoenixray2000 wants to merge 1 commit into
Conversation
|
Thank you @phoenixray2000 for the VAD-boundary investigation and focused regression. This overlaps the fix now integrated by #3804 and shipped in v1.4.18. I ran your exact regression from The current implementation retains VAD boundary spaces for timestamp units, removes rich tags only for alignment, and preserves the top-level punctuation result. The existing main regressions also cover reordered segments, Chinese/mixed/English boundaries and speaker assignment. The AutoModel file is unchanged since that accepted test in the current integration tip. Closing this PR as superseded to avoid applying the same production change twice. Your branch and original commit are untouched; this closure does not claim that commit was merged or that your private recording was independently reproduced. Thank you for the earlier contribution. Original-recording feedback on #3801 remains open. |
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.