add CTC batched beam search
What does this PR do ?
Batched beam search for CTC with NGPU-LM (n-gram LM on GPU).
Results for nvidia/parakeet-ctc-1.1b on SLURP (out-of-domain):
| Decoding Method | Beam Size | Beam Beta | LM Weight* | SLURP Test WER (%) ↓ | RTFx ↑ |
|---|---|---|---|---|---|
| greedy | – | – | – | 19.93 | 491 |
| beam_batch | 12 | 1.0 | 0.7 | 16.15 | 456 |
*LM weight - optimal on SLURP dev set with step 0.1
Batch size 32, high fp32 matmul precision, sorted manifest, A5000 GPU. 6-gram LM is built on SLURP train texts.
Collection: [ASR]
Changelog
- Add specific line by line info of high level changes in this PR.
Usage
Usage without LM
python examples/asr/speech_to_text_eval.py \
pretrained_name="nvidia/parakeet-ctc-1.1b" \
dataset_manifest=<dataset_manifest> \
batch_size=32 \
output_filename=decoded.jsonl \
ctc_decoding.strategy="beam_batch" \
ctc_decoding.beam.beam_size=12 \
ctc_decoding.beam.beam_beta=0.3
Usage with LM
Step 1: Build LM for ASR Model (tokenizer-dependent) on domain texts
python nemo/scripts/asr_language_modeling/ngram_lm/train_kenlm.py \
nemo_model_file="nvidia/parakeet-ctc-1.1b" \
train_paths=["<train_manifest>"] \
kenlm_bin_path=$KENLM_BIN_PATH \
kenlm_model_file=parakeet-ctc-1.1b_lm-o6.arpa \
ngram_length=6 \
preserve_arpa=true \
save_nemo=true
Step 2: Run Decoding with LM
python examples/asr/speech_to_text_eval.py \
pretrained_name="nvidia/parakeet-ctc-1.1b" \
dataset_manifest=<dataset_manifest> \
batch_size=32 \
output_filename=decoded.jsonl \
ctc_decoding.strategy="beam_batch" \
ctc_decoding.beam.ngram_lm_model="parakeet-ctc-1.1b_lm-o6.arpa.nemo" \
ctc_decoding.beam.ngram_lm_alpha=0.4 \
ctc_decoding.beam.beam_beta=0.4 \
ctc_decoding.beam.beam_size=12
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:
- [x] Make sure you read and followed Contributor guidelines
- [x] 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:
- [x] New Feature
- [ ] Bugfix
- [ ] Documentation
If you haven't finished some of the above items you can still open "Draft" PR.
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.
Additional Information
- Related to # (issue)
There’s a known error, let me know if you want to proceed with merging this PR
[🤖]: Hi @lilithgrigoryan 👋,
We wanted to let you know that a CICD pipeline for this PR just finished successfully.
So it might be time to merge this PR or get some approvals.
//cc @chtruong814 @ko3n1g @pablo-garay @thomasdhc
[🤖]: Hi @lilithgrigoryan 👋,
We wanted to let you know that a CICD pipeline for this PR just finished successfully.
So it might be time to merge this PR or get some approvals.
//cc @chtruong814 @ko3n1g @pablo-garay @thomasdhc
[🤖]: Hi @lilithgrigoryan 👋,
We wanted to let you know that a CICD pipeline for this PR just finished successfully.
So it might be time to merge this PR or get some approvals.
//cc @chtruong814 @ko3n1g @pablo-garay @thomasdhc
[🤖]: Hi @lilithgrigoryan 👋,
We wanted to let you know that a CICD pipeline for this PR just finished successfully.
So it might be time to merge this PR or get some approvals.
//cc @chtruong814 @ko3n1g @pablo-garay @thomasdhc
[🤖]: Hi @lilithgrigoryan 👋,
We wanted to let you know that a CICD pipeline for this PR just finished successfully.
So it might be time to merge this PR or get some approvals.
//cc @chtruong814 @ko3n1g @pablo-garay @thomasdhc