sw005320 commited on
Commit
d32318a
·
verified ·
1 Parent(s): 359d778

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 @@ tags:
8
  - audio
9
  - automatic-speech-recognition
10
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  # KoSP2E ASR Recipe
12
 
13
  This is the ESPnet2 recipe for the **KoSP2E (Korean Speech Perception and Production Experiment)** dataset.
 
8
  - audio
9
  - automatic-speech-recognition
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/kosp2e-asr-ko")
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
  # KoSP2E ASR Recipe
28
 
29
  This is the ESPnet2 recipe for the **KoSP2E (Korean Speech Perception and Production Experiment)** dataset.