Automatic Speech Recognition
ESPnet
Sundanese
audio
sw005320 commited on
Commit
5f93e80
·
verified ·
1 Parent(s): cf1ad95

Add a usage example to the model card

Browse files
Files changed (1) hide show
  1. README.md +16 -0
README.md CHANGED
@@ -8,6 +8,22 @@ datasets:
8
  - su_openslr36
9
  license: cc-by-4.0
10
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ## ESPnet2 ASR pretrained model
12
  ### `su_openslr36`
13
  ♻️ Imported from https://zenodo.org/record/5090135/
 
8
  - su_openslr36
9
  license: cc-by-4.0
10
  ---
11
+
12
+ ## Usage
13
+
14
+ ```python
15
+ import librosa
16
+ from espnet2.bin.asr_inference import Speech2Text
17
+
18
+ speech2text = Speech2Text.from_pretrained(model_tag="espnet/su_openslr36")
19
+ # librosa resamples and mixes to one channel, so any file works; 16000 is
20
+ # what nearly every espnet recogniser is trained on - check this model's
21
+ # config if its audio is not 16 kHz
22
+ speech, rate = librosa.load("audio.wav", sr=16000, mono=True)
23
+ text, *_ = speech2text(speech)[0]
24
+ print(text)
25
+ ```
26
+
27
  ## ESPnet2 ASR pretrained model
28
  ### `su_openslr36`
29
  ♻️ Imported from https://zenodo.org/record/5090135/