Populate ys_probs in the online NeMo transducer greedy search decoders - #3893
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughOnline NeMo greedy decoders now apply ChangesNeMo decoder probability recording
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change populates per-token log-probabilities for two online decoders without changing decoded tokens; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Warning |
csukuangfj
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
Fixes #3181
What this PR does
The online NeMo transducer greedy search decoder never fills
ys_probs, so streaming NeMo results always report"ys_probs": []and applications cannot access per-token confidence. The offline path was fixed in #3105; this applies the same approach to the online decoders:LogSoftmaxto the joiner output and push the selected token's log-probability alongside the token (only when a non-blank is emitted, soys_probs.size() == tokens.size()).LogSoftmaxruns after the token has been selected, so decoding output is unchanged.The same gap existed in the parakeet-unified online decoder; it gets the identical fix. The multilingual language-tag filter (
FilterLanguageTagsinonline-recognizer-transducer-nemo-impl.h) already filtersys_probsindex-aligned with tokens whenever the sizes match, so tag-filtered results stay aligned with no further changes.Downstream context: FreeShow, an open-source church presentation app with an AI scripture feature under review (ChurchApps/FreeShow#3579), runs streaming Nemotron via sherpa-onnx-node and uses these per-token log-probs for confidence gating on live transcripts.
Changes
sherpa-onnx/csrc/online-transducer-greedy-search-nemo-decoder.cc:LogSoftmax+r.ys_probs.push_back(log_prob)(mirrors the offline feat: Add ys_log_probs to NeMo transducer greedy search decoder #3105 fix; +1 include ofmath.h).sherpa-onnx/csrc/online-transducer-greedy-search-nemo-parakeet-unified-decoder.cc: identical fix.Verification output
Streaming Nemotron 3.5 1120 ms int8 on macOS arm64, greedy_search, exercised through the node addon:
Notes
ys_probsalready exists in the result struct and JSON — it just goes from always-empty to populated for these decoders.temperature_scale, unlike the standard online greedy decoder)../scripts/check_style_cpplint.sh 1passes. Built with thetest-nodejs-addon-api.yamlcmake flags. The related CI workflows do not run on pull requests; verification above is local.Summary by CodeRabbit