Skip to content

fix(sensevoice): stop rendering the Cough event as the Sneeze emoji - #3747

Merged
LauraGPT merged 1 commit into
modelscope:mainfrom
MohammadHijjawi97:fix/sensevoice-cough-emoji
Oct 1, 2026
Merged

LauraGPT merged 1 commit into
modelscope:mainfrom
MohammadHijjawi97:fix/sensevoice-cough-emoji

Conversation

@MohammadHijjawi97

Copy link
Copy Markdown
Contributor

Summary

rich_transcription_postprocess() maps SenseVoice event tags via event_dict, which had "<|Cough|>": "🤧" — the same emoji as <|Sneeze|> — so coughs were displayed as sneezes. emoji_dict and event_set in the same module already use 😷 for coughs (so format_str_v2 even strips 😷 spacing), which shows the intended mapping. This sets event_dict["<|Cough|>"] to 😷 in funasr/utils/postprocess_utils.py and in the identical copies shipped by funasr_onnx and funasr_torch.

Reproduction (before):

from funasr.utils.postprocess_utils import rich_transcription_postprocess
rich_transcription_postprocess("<|en|><|NEUTRAL|><|Cough|><|woitn|>hello")   # '🤧hello' (same as Sneeze)
# after: '😷hello'

Type of change

  • Bug fix
  • Documentation
  • Example or demo
  • Runtime or deployment
  • Benchmark or evaluation
  • Model/training change

Validation

  • New tests/test_rich_transcription_postprocess.py (checks all three copies): 3 Cough cases fail on main, 6 passed with the fix.

  • pytest tests/test_speaker_emotion_docs.py still passes.

  • python -m compileall on the changed files; black (line-length 100) on the new test.

  • python -m compileall funasr examples tests

  • Docs or links checked

  • Runtime/deployment command tested

User impact

SenseVoice users displaying rich transcriptions (demo scripts, ONNX/libtorch runtimes, apps built on rich_transcription_postprocess) can now tell coughs from sneezes.

Notes for reviewers

One-line mapping change per copy; no other tags affected.

rich_transcription_postprocess() maps SenseVoice event tags through
event_dict, which used 🤧 for both <|Sneeze|> and <|Cough|>, so coughs
were displayed as sneezes. emoji_dict and event_set already use 😷 for
coughs; use it in event_dict too, in funasr and in the funasr_onnx and
funasr_torch runtime copies.

@LauraGPT LauraGPT left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified exact head 78c9301580c977945649549f545b980e8ae2d370 against current main. The prior mapping renders Cough and Sneeze identically; the patch aligns all three shipped postprocessors with the existing cough emoji convention. Exact head and clean synthetic merge pass 6/6 new regressions and the adjacent speaker/emotion coverage. No blocking finding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants