Commit
•
8540d43
1
Parent(s):
e77e5ab
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,166 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
library_name: nemo
|
5 |
+
datasets:
|
6 |
+
- librispeech_asr
|
7 |
+
thumbnail: null
|
8 |
+
tags:
|
9 |
+
- automatic-speech-recognition
|
10 |
+
- speech
|
11 |
+
- audio
|
12 |
+
- CTC
|
13 |
+
- Citrinet
|
14 |
+
- Transformer
|
15 |
+
- pytorch
|
16 |
+
- NeMo
|
17 |
+
- hf-asr-leaderboard
|
18 |
+
license: cc-by-4.0
|
19 |
+
widget:
|
20 |
+
- example_title: Librispeech sample 1
|
21 |
+
src: https://cdn-media.huggingface.co/speech_samples/sample1.flac
|
22 |
+
- example_title: Librispeech sample 2
|
23 |
+
src: https://cdn-media.huggingface.co/speech_samples/sample2.flac
|
24 |
+
model-index:
|
25 |
+
- name: stt_en_citrinet_768_ls
|
26 |
+
results:
|
27 |
+
- task:
|
28 |
+
name: Automatic Speech Recognition
|
29 |
+
type: automatic-speech-recognition
|
30 |
+
dataset:
|
31 |
+
name: LibriSpeech (clean)
|
32 |
+
type: librispeech_asr
|
33 |
+
config: clean
|
34 |
+
split: test
|
35 |
+
args:
|
36 |
+
language: en
|
37 |
+
metrics:
|
38 |
+
- name: Test WER
|
39 |
+
type: wer
|
40 |
+
value: 2.6
|
41 |
+
- task:
|
42 |
+
type: Automatic Speech Recognition
|
43 |
+
name: automatic-speech-recognition
|
44 |
+
dataset:
|
45 |
+
name: LibriSpeech (other)
|
46 |
+
type: librispeech_asr
|
47 |
+
config: other
|
48 |
+
split: test
|
49 |
+
args:
|
50 |
+
language: en
|
51 |
+
metrics:
|
52 |
+
- name: Test WER
|
53 |
+
type: wer
|
54 |
+
value: 6.4
|
55 |
---
|
56 |
+
|
57 |
+
# NVIDIA Citrinet CTC 768 Librispeech (en-US)
|
58 |
+
|
59 |
+
<style>
|
60 |
+
img {
|
61 |
+
display: inline;
|
62 |
+
}
|
63 |
+
</style>
|
64 |
+
|
65 |
+
| [![Model architecture](https://img.shields.io/badge/Model_Arch-Citrinet--CTC-lightgrey#model-badge)](#model-architecture)
|
66 |
+
| [![Model size](https://img.shields.io/badge/Params-81M-lightgrey#model-badge)](#model-architecture)
|
67 |
+
| [![Language](https://img.shields.io/badge/Language-en--US-lightgrey#model-badge)](#datasets)
|
68 |
+
| [![Riva Compatible](https://img.shields.io/badge/NVIDIA%20Riva-compatible-brightgreen#model-badge)](#deployment-with-nvidia-riva) |
|
69 |
+
|
70 |
+
|
71 |
+
This model transcribes speech in lower case English alphabet along with spaces and apostrophes.
|
72 |
+
It is an "medium-large" versions of Citrinet-CTC (around 81M parameters) model.
|
73 |
+
See the [model architecture](#model-architecture) section and [NeMo documentation](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/asr/models.html#citrinet) for complete architecture details.
|
74 |
+
It is also compatible with NVIDIA Riva for [production-grade server deployments](#deployment-with-nvidia-riva).
|
75 |
+
|
76 |
+
## NVIDIA NeMo: Training
|
77 |
+
|
78 |
+
To train, fine-tune or play with the model you will need to install [NVIDIA NeMo](https://github.com/NVIDIA/NeMo). We recommend you install it after you've installed latest Pytorch version.
|
79 |
+
```
|
80 |
+
pip install nemo_toolkit['all']
|
81 |
+
```
|
82 |
+
|
83 |
+
## How to Use this Model
|
84 |
+
|
85 |
+
The model is available for use in the NeMo toolkit [3], and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.
|
86 |
+
|
87 |
+
### Automatically instantiate the model
|
88 |
+
|
89 |
+
```python
|
90 |
+
import nemo.collections.asr as nemo_asr
|
91 |
+
asr_model = nemo_asr.models.EncDecCTCModelBPE.from_pretrained("nvidia/stt_en_citrinet_768_ls")
|
92 |
+
```
|
93 |
+
|
94 |
+
### Transcribing using Python
|
95 |
+
First, let's get a sample
|
96 |
+
```
|
97 |
+
wget https://dldata-public.s3.us-east-2.amazonaws.com/2086-149220-0033.wav
|
98 |
+
```
|
99 |
+
Then simply do:
|
100 |
+
```
|
101 |
+
asr_model.transcribe(['2086-149220-0033.wav'])
|
102 |
+
```
|
103 |
+
|
104 |
+
### Transcribing many audio files
|
105 |
+
|
106 |
+
```shell
|
107 |
+
python [NEMO_GIT_FOLDER]/examples/asr/transcribe_speech.py
|
108 |
+
pretrained_name="nvidia/stt_en_citrinet_768_ls"
|
109 |
+
audio_dir="<DIRECTORY CONTAINING AUDIO FILES>"
|
110 |
+
```
|
111 |
+
|
112 |
+
### Input
|
113 |
+
|
114 |
+
This model accepts 16000 KHz Mono-channel Audio (wav files) as input.
|
115 |
+
|
116 |
+
### Output
|
117 |
+
|
118 |
+
This model provides transcribed speech as a string for a given audio sample.
|
119 |
+
|
120 |
+
## Model Architecture
|
121 |
+
|
122 |
+
Citrinet-CTC model is an autoregressive variant of Citrinet model [1] for Automatic Speech Recognition which uses CTC loss/decoding instead of Transducer Loss. You may find more info on the detail of this model here: [Citrinet Model](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/asr/models.html).
|
123 |
+
|
124 |
+
## Training
|
125 |
+
|
126 |
+
The NeMo toolkit [3] was used for training the models for over several hundred epochs. These model are trained with this [example script](https://github.com/NVIDIA/NeMo/blob/main/examples/asr/asr_ctc/speech_to_text_ctc_bpe.py) and this [base config](https://github.com/NVIDIA/NeMo/blob/main/examples/asr/conf/citrinet/citrinet_1024.yaml) (Note: Change the `model.model_defaults.filters` to match the model size).
|
127 |
+
|
128 |
+
The tokenizers for these models were built using the text transcripts of the train set with this [script](https://github.com/NVIDIA/NeMo/blob/main/scripts/tokenizers/process_asr_text_tokenizer.py).
|
129 |
+
|
130 |
+
### Datasets
|
131 |
+
|
132 |
+
All the models in this collection are trained on a just the Librispeech Dataset:
|
133 |
+
|
134 |
+
- Librispeech 960 hours of English speech
|
135 |
+
|
136 |
+
|
137 |
+
## Performance
|
138 |
+
|
139 |
+
The list of the available models in this collection is shown in the following table. Performances of the ASR models are reported in terms of Word Error Rate (WER%) with greedy decoding.
|
140 |
+
|
141 |
+
| Version | Tokenizer | Vocabulary Size | LS test-other | LS test-clean |
|
142 |
+
|---------|---------------------------|-----------------|---------------|---------------|
|
143 |
+
| 1.0.0 | SentencePiece Unigram [2] | 256 | 6.4 | 2.6 |
|
144 |
+
|
145 |
+
## Limitations
|
146 |
+
Since this model was trained on publicly available speech datasets, the performance of this model might degrade for speech which includes technical terms, or vernacular that the model has not been trained on. The model might also perform worse for accented speech.
|
147 |
+
|
148 |
+
## Deployment with NVIDIA Riva
|
149 |
+
|
150 |
+
For the best real-time accuracy, latency, and throughput, deploy the model with [NVIDIA Riva](https://developer.nvidia.com/riva), an accelerated speech AI SDK deployable on-prem, in all clouds, multi-cloud, hybrid, at the edge, and embedded.
|
151 |
+
Additionally, Riva provides:
|
152 |
+
|
153 |
+
* 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
|
154 |
+
* 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
|
155 |
+
* Streaming speech recognition, Kubernetes compatible scaling, and Enterprise-grade support
|
156 |
+
|
157 |
+
Check out [Riva live demo](https://developer.nvidia.com/riva#demos).
|
158 |
+
|
159 |
+
## References
|
160 |
+
[1] [ Citrinet: Closing the Gap between Non-Autoregressive and Autoregressive End-to-End Models for Automatic Speech Recognition](https://arxiv.org/abs/2104.01721)
|
161 |
+
[2] [Google Sentencepiece Tokenizer](https://github.com/google/sentencepiece)
|
162 |
+
[3] [NVIDIA NeMo Toolkit](https://github.com/NVIDIA/NeMo)
|
163 |
+
|
164 |
+
## Licence
|
165 |
+
|
166 |
+
License to use this model is covered by the [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/). By downloading the public and release version of the model, you accept the terms and conditions of the [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) license.
|