Cannot detect the regional variations/ dialects of language using Whisper Speech Recognition model #1721
Unanswered
PriyankaKB
asked this question in
Q&A
Replies: 1 comment 6 replies
-
u cannot, there's no model to do that |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to detect the regional variations in language using Whisper Speech Recognition Model. Below is the code that I have tried...
import whisper
model = whisper.load_model("base")
Load audio and pad/trim it to fit 30 seconds
audio = whisper.load_audio("output.wav")
audio = whisper.pad_or_trim(audio)
Make log-Mel spectrogram and move to the same device as the model
mel = whisper.log_mel_spectrogram(audio).float().to(model.device) # Convert to float32
Detect the spoken language
_, probs = model.detect_language(mel)
print(f"Detected language: {max(probs, key=probs.get)}")
Decode the audio
options = whisper.DecodingOptions(fp16 = False)
result = whisper.decode(model, mel, options)
Print the recognized text
print(result.text)
Output:
Detected language: en
$28,000. $28,000. $28,000. Good luck. John, you ready? I'm ready. Hope you like it. Let's go ahead, George. John. This is sugar.
I want to detect regional variations/ dialects like "en-US", "en-GB", "en-AU" etc. as per country/region.
Is it possible to detect such dialects with Whisper Speech Recognition Model?
Please, help. Also, suggest if there is any way we can integrate such functionality along with Whisper model...
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions