Separate language detection into a standalone method & Convert test framework into unittest from pytest. #906
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.