Separate language detection into a standalone method
After the latest update (v1.0.3) to Silero-Vad V5, I noticed that the VAD threshold value is highly dependent on the language. For English, the default threshold=0.5 works well. However, for Asian languages like Chinese and Japanese, a threshold<0.2 should be set; otherwise, VAD may filter out 90% of the audio content.
Thus, I plan to add language detection before transcription, such as:
whisper_model = WhisperModel(model_name, device, compute_type=compute_type)
# Set VAD threshold here according to the detected language
language = ...
vad_options = get_vad_options(language)
seg_gen, info = whisper_model.transcribe(str(audio_path), language=language,
vad_filter=True, vad_parameters=vad_options)
I found that faster-whisper can already detect languages during the whisper_model.transcribe process. However, this feature is embedded and not directly accessible to users. So, I submitted a PR to separate it from the transcribe method, which also reduces its complexity (from 176 to 120 lines of code).
Now we can perform the language detection before transcription by:
While adding related tests, I noticed we are using the pytest framework, which introduces extra dependencies. Thus, I converted all test suites to unittest and updated the dependency requirements.
Separate language detection into a standalone method
After the latest update (v1.0.3) to Silero-Vad V5, I noticed that the VAD threshold value is highly dependent on the language. For English, the default
threshold=0.5
works well. However, for Asian languages like Chinese and Japanese, athreshold<0.2
should be set; otherwise, VAD may filter out 90% of the audio content.Thus, I plan to add language detection before transcription, such as:
I found that faster-whisper can already detect languages during the
whisper_model.transcribe
process. However, this feature is embedded and not directly accessible to users. So, I submitted a PR to separate it from thetranscribe
method, which also reduces its complexity (from 176 to 120 lines of code).Now we can perform the language detection before transcription by:
Convert test framework into unittest from pytest
While adding related tests, I noticed we are using the pytest framework, which introduces extra dependencies. Thus, I converted all test suites to unittest and updated the dependency requirements.