NVIDIA NeMo Canary is a family of multi-lingual multi-tasking models that achieves state-of-the art performance on multiple benchmarks. With 1 billion parameters, Canary-1B supports automatic speech-to-text recognition (ASR) in 4 languages (English, German, French, Spanish) and translation from English to German/French/Spanish and from German/French/Spanish to English with or without punctuation and capitalization (PnC).
🚨Note: Checkout our latest Canary-1B-Flash model, a faster and more accurate variant of Canary-1B!
Discover more from NVIDIA:
For documentation, deployment guides, enterprise-ready APIs, and the latest open models—including Nemotron and other cutting-edge speech, translation, and generative AI—visit the NVIDIA Developer Portal at developer.nvidia.com.
Join the community to access tools, support, and resources to accelerate your development with NVIDIA’s NeMo, Riva, NIM, and foundation models.
Canary is an encoder-decoder model with FastConformer [1] encoder and Transformer Decoder [2].
With audio features extracted from the encoder, task tokens such as <source language>, <target language>, <task> and <toggle PnC>
are fed into the Transformer Decoder to trigger the text generation process. Canary uses a concatenated tokenizer [5] from individual
SentencePiece [3] tokenizers of each language, which makes it easy to scale up to more languages.
The Canay-1B model has 24 encoder layers and 24 layers of decoder layers in total.
NVIDIA NeMo
To train, fine-tune or Transcribe with Canary, you will need to install NVIDIA NeMo. We recommend you install it after you've installed Cython and latest PyTorch version.
The model is available for use in the NeMo toolkit [4], and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.
Input to Canary can be either a list of paths to audio files or a jsonl manifest file.
If the input is a list of paths, Canary assumes that the audio is English and Transcribes it. I.e., Canary default behaviour is English ASR.
python
1predicted_text = canary_model.transcribe(2 paths2audio_files=['path1.wav','path2.wav'],3 batch_size=16,# batch size to run the inference with4)[0].text
To use Canary for transcribing other supported languages or perform Speech-to-Text translation, specify the input as jsonl manifest file, where each line in the file is a dictionary containing the following fields:
yaml
1# Example of a line in input_manifest.json2{3"audio_filepath":"/path/to/audio.wav",# path to the audio file4"duration":1000,# duration of the audio, can be set to `None` if using NeMo main branch5"taskname":"asr",# use "s2t_translation" for speech-to-text translation with r1.23, or "ast" if using the NeMo main branch6"source_lang":"en",# language of the audio input, set `source_lang`==`target_lang` for ASR, choices=['en','de','es','fr']7"target_lang":"en",# language of the text output, choices=['en','de','es','fr']8"pnc":"yes",# whether to have PnC output, choices=['yes', 'no']9"answer":"na",10}
and then use:
python
1predicted_text = canary_model.transcribe(2"<path to input manifest file>",3 batch_size=16,# batch size to run the inference with4)[0].text
Automatic Speech-to-text Recognition (ASR)
An example manifest for transcribing English audios can be:
yaml
1# Example of a line in input_manifest.json2{3"audio_filepath":"/path/to/audio.wav",# path to the audio file4"duration":1000,# duration of the audio, can be set to `None` if using NeMo main branch5"taskname":"asr",6"source_lang":"en",# language of the audio input, set `source_lang`==`target_lang` for ASR, choices=['en','de','es','fr']7"target_lang":"en",# language of the text output, choices=['en','de','es','fr']8"pnc":"yes",# whether to have PnC output, choices=['yes', 'no']9"answer":"na",10}
Automatic Speech-to-text Translation (AST)
An example manifest for transcribing English audios into German text can be:
yaml
1# Example of a line in input_manifest.json2{3"audio_filepath":"/path/to/audio.wav",# path to the audio file4"duration":1000,# duration of the audio, can be set to `None` if using NeMo main branch5"taskname":"s2t_translation",# r1.23 only recognizes "s2t_translation", but "ast" is supported if using the NeMo main branch6"source_lang":"en",# language of the audio input, choices=['en','de','es','fr']7"target_lang":"de",# language of the text output, choices=['en','de','es','fr']8"pnc":"yes",# whether to have PnC output, choices=['yes', 'no']9"answer":"na"10}
Alternatively, one can use transcribe_speech.py script to do the same.
bash
1python [NEMO_GIT_FOLDER]/examples/asr/transcribe_speech.py
2pretrained_name="nvidia/canary-1b"3audio_dir="<path to audio_directory>"# transcribes all the wav files in audio_directory
bash
1python [NEMO_GIT_FOLDER]/examples/asr/transcribe_speech.py
2pretrained_name="nvidia/canary-1b"3dataset_manifest="<path to manifest file>"
Input
This model accepts single channel (mono) audio sampled at 16000 Hz, along with the task/languages/PnC tags as input.
Output
The model outputs the transcribed/translated text corresponding to the input audio, in the specified target language and with or without punctuation and capitalization.
Training
Canary-1B is trained using the NVIDIA NeMo toolkit [4] for 150k steps with dynamic bucketing and a batch duration of 360s per GPU on 128 NVIDIA A100 80GB GPUs.
The model can be trained using this example script and base config.
The tokenizers for these models were built using the text transcripts of the train set with this script.
Datasets
The Canary-1B model is trained on a total of 85k hrs of speech data. It consists of 31k hrs of public data, 20k hrs collected by Suno, and 34k hrs of in-house data.
As outlined in the paper "Towards Measuring Fairness in AI: the Casual Conversations Dataset", we assessed the Canary-1B model for fairness. The model was evaluated on the CausalConversations-v1 dataset, and the results are reported as follows:
Gender Bias:
Gender
Male
Female
N/A
Other
Num utterances
19325
24532
926
33
% WER
14.64
12.92
17.88
126.92
Age Bias:
Age Group
(18-30)
(31-45)
(46-85)
(1-100)
Num utterances
15956
14585
13349
43890
% WER
14.64
13.07
13.47
13.76
(Error rates for fairness evaluation are determined by normalizing both the reference and predicted text, similar to the methods used in the evaluations found at https://github.com/huggingface/open_asr_leaderboard.)
NVIDIA Riva: Deployment
NVIDIA Riva, is an accelerated speech AI SDK deployable on-prem, in all clouds, multi-cloud, hybrid, on edge, and embedded.
Additionally, Riva provides:
World-class out-of-the-box accuracy for the most common languages with model checkpoints trained on proprietary data with hundreds of thousands of GPU-compute hours
Best in class accuracy with run-time word boosting (e.g., brand and product names) and customization of acoustic model, language model, and inverse text normalization
Streaming speech recognition, Kubernetes compatible scaling, and enterprise-grade support
License to use this model is covered by the CC-BY-NC-4.0. By downloading the public and release version of the model, you accept the terms and conditions of the CC-BY-NC-4.0 license.