Automatic Speech Recognition
ESPnet
audio
sw005320 commited on
Commit
f5fa69f
·
verified ·
1 Parent(s): 12bf3ac

Add a usage example to the model card

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