Skip to content

[ASR] Wordboosting by phrase#15923

Open
AadamHaq wants to merge 5 commits into
NVIDIA-NeMo:mainfrom
AadamHaq:wordboosting_by_phrase
Open

[ASR] Wordboosting by phrase#15923
AadamHaq wants to merge 5 commits into
NVIDIA-NeMo:mainfrom
AadamHaq:wordboosting_by_phrase

Conversation

@AadamHaq

@AadamHaq AadamHaq commented Jul 19, 2026

Copy link
Copy Markdown

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

Adds support for per-phrase context_score and boosting_tree_alpha in GPU Phrase Boosting, so individual phrases can be boosted by different amounts instead of all sharing the global values.

Collection: ASR

Changelog

  • PhraseItem gains optional context_score and boosting_tree_alpha fields (lang is now also optional, falling back to source_lang), usable via the existing key_phrase_items_list config - fully backwards compatible.
  • Per-phrase boosting_tree_alpha is baked into the graph weights at build time as a relative multiplier (effective boost = decode-time boosting_tree_alpha × per-phrase alpha). No decoder changes: backoff weights are node-score differences and inherit the scaling automatically; final_eos_score scales by the ending phrase's alpha. Baked weights survive .nemo save/load.
  • ContextGraph.build() accepts per-phrase alphas; the per-phrase scores sentinel changed from 0.0 to None so an explicit zero score is expressible.
  • GPUBoostingTreeModel.from_config resolves per-phrase params (per-phrase context_score takes precedence over score_per_phrase), validates them (negative alpha raises, zero warns), and applies them to all BPE-dropout tokenizations of a phrase.
  • New unit tests (TestPerPhraseBoostingParams, 9 tests) and a "Per-phrase boosting parameters" section in word_boosting.rst.

Usage

boosting_tree.key_phrase_items_list='[{phrase:"nvlink",boosting_tree_alpha:2.0},{phrase:"omniverse cloud",context_score:1.5},{phrase:"gtc"}]'

Omitted fields fall back to the global values. Also works with scripts/asr_context_biasing/build_gpu_boosting_tree.py (parameters are baked into the saved tree).

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

cc @nithinraok

AadamHaq added 4 commits July 19, 2026 20:15
Signed-off-by: Aadam Haq <aadamhaq@sky.com>
Signed-off-by: Aadam Haq <aadamhaq@sky.com>
Signed-off-by: Aadam Haq <aadamhaq@sky.com>
Signed-off-by: Aadam Haq <aadamhaq@sky.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nithinraok
nithinraok requested a review from andrusenkoau July 21, 2026 14:21
@nithinraok

Copy link
Copy Markdown
Member

@andrusenkoau could you have a look at this PR

@artbataev artbataev 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.

@AadamHaq Thanks for the contribution.
Please wait while ongoing work #15800 is merged into main - I will let you know.
That PR introduces additional function for building the graph, so we need to make sure that both approaches are supported with your enhancements.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-customer Waiting on the original author to respond label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ASR community-request waiting-on-customer Waiting on the original author to respond

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants