2️⃣Speech Recognition: Whisper
Automatic Speech Recognition
!wget https://www.voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav -O ./dataset/speech.wav--2024-05-19 12:58:31-- https://www.voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav
Resolving www.voiptroubleshooter.com (www.voiptroubleshooter.com)... 162.241.218.124
Connecting to www.voiptroubleshooter.com (www.voiptroubleshooter.com)|162.241.218.124|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 538014 (525K) [audio/x-wav]
Saving to: ‘./dataset/speech.wav’
./dataset/speech.wa 100%[===================>] 525.40K 689KB/s in 0.8s
2024-05-19 12:58:33 (689 KB/s) - ‘./dataset/speech.wav’ saved [538014/538014]wav2vec2-large-xlsr
from transformers import pipeline
pipe = pipeline(
"automatic-speech-recognition",
model="jonatasgrosman/wav2vec2-large-xlsr-53-english"
)
result = pipe(
["dataset/speech.wav"],
generate_kwargs={"language": "english"}
)
resultWhisper
Last updated