krishnacpuvvada commited on
Commit
b010a2d
1 Parent(s): 5113160

Update README.md

Browse files

updating transcribe fn signature in examples.

Files changed (1) hide show
  1. README.md +20 -18
README.md CHANGED
@@ -284,7 +284,7 @@ The Canay-1B model has 24 encoder layers and 24 layers of decoder layers in tota
284
 
285
  ## NVIDIA NeMo
286
 
287
- 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 Cython and latest PyTorch version.
288
  ```
289
  pip install git+https://github.com/NVIDIA/NeMo.git@r1.23.0#egg=nemo_toolkit[asr]
290
  ```
@@ -309,24 +309,18 @@ canary_model.change_decoding_strategy(decode_cfg)
309
  ```
310
 
311
  ### Input Format
312
- The input to the model can be a directory containing audio files, in which case the model will perform ASR on English and produces text with punctuation and capitalization:
313
 
 
314
  ```python
315
  predicted_text = canary_model.transcribe(
316
- audio_dir="<path to directory containing audios>",
317
  batch_size=16, # batch size to run the inference with
318
  )
319
  ```
320
 
321
- or use:
322
 
323
- ```bash
324
- python [NEMO_GIT_FOLDER]/examples/asr/transcribe_speech.py
325
- pretrained_name="nvidia/canary-1b"
326
- audio_dir="<path to audio directory>"
327
- ```
328
-
329
- Another recommended option is to use a json manifest as input, where each line in the file is a dictionary containing the following fields:
330
  ```yaml
331
  # Example of a line in input_manifest.json
332
  {
@@ -348,13 +342,6 @@ predicted_text = canary_model.transcribe(
348
  )
349
  ```
350
 
351
- or use:
352
-
353
- ```bash
354
- python [NEMO_GIT_FOLDER]/examples/asr/transcribe_speech.py
355
- pretrained_name="nvidia/canary-1b"
356
- dataset_manifest="<path to manifest file>"
357
- ```
358
 
359
  ### Automatic Speech-to-text Recognition (ASR)
360
 
@@ -391,6 +378,21 @@ An example manifest for transcribing English audios into German text can be:
391
  }
392
  ```
393
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
394
 
395
  ### Input
396
 
 
284
 
285
  ## NVIDIA NeMo
286
 
287
+ To train, fine-tune or Transcribe with Canary, you will need to install [NVIDIA NeMo](https://github.com/NVIDIA/NeMo). We recommend you install it after you've installed Cython and latest PyTorch version.
288
  ```
289
  pip install git+https://github.com/NVIDIA/NeMo.git@r1.23.0#egg=nemo_toolkit[asr]
290
  ```
 
309
  ```
310
 
311
  ### Input Format
312
+ Input to Canary can be either a list of paths to audio files or a jsonl manifest file.
313
 
314
+ 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.
315
  ```python
316
  predicted_text = canary_model.transcribe(
317
+ paths2audio_files=['path1.wav', 'path2.wav'],
318
  batch_size=16, # batch size to run the inference with
319
  )
320
  ```
321
 
322
+ 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:
323
 
 
 
 
 
 
 
 
324
  ```yaml
325
  # Example of a line in input_manifest.json
326
  {
 
342
  )
343
  ```
344
 
 
 
 
 
 
 
 
345
 
346
  ### Automatic Speech-to-text Recognition (ASR)
347
 
 
378
  }
379
  ```
380
 
381
+ Alternatively, one can use `transcribe_speech.py` script to do the same.
382
+
383
+ ```bash
384
+ python [NEMO_GIT_FOLDER]/examples/asr/transcribe_speech.py
385
+ pretrained_name="nvidia/canary-1b"
386
+ audio_dir="<path to audio_directory>" # transcribes all the wav files in audio_directory
387
+ ```
388
+
389
+
390
+ ```bash
391
+ python [NEMO_GIT_FOLDER]/examples/asr/transcribe_speech.py
392
+ pretrained_name="nvidia/canary-1b"
393
+ dataset_manifest="<path to manifest file>"
394
+ ```
395
+
396
 
397
  ### Input
398