Readit News logoReadit News
bnmoch3 commented on Show HN: Python Audio Transcription: Convert Speech to Text Locally   pavlinbg.com/posts/python... · Posted by u/Pavlinbg
nvdnadj92 · 6 months ago
I'm working on the same project myself and was planning to write a blog post similar to the author's. However, I'll share some additional tips and tricks that really made a difference for me.

For preprocessing, I found it best to convert files to a 16kHz WAV format for optimal processing. I also add low-pass and high-pass filters to remove non-speech sounds. To avoid hallucinations, I run Silero VAD on the entire audio file to find timestamps where there's a speaker. A side note on this: Silero requires careful tuning to prevent audio segments from being chopped up and clipped. I also use a post-processing step to merge adjacent VAD chunks, which helps ensure cohesive Whisper recordings.

For the Whisper task, I run Whisper in small audio chunks that correspond to the VAD timestamps. Otherwise, it will hallucinate during silences and regurgitate the passed-in prompt. If you're on a Mac, use the whisper-mlx models from Hugging Face to speed up transcription. I ran a performance benchmark, and it made a 22x difference to use a model designed for the Apple Neural Engine.

For post-processing, I've found that running the generated SRT files through ChatGPT to identify and remove hallucination chunks has a better yield.

bnmoch3 · 6 months ago
Please can you share the prompt you use in ChatGPT to remove hallucination chunks

u/bnmoch3

KarmaCake day2January 16, 2025
About
bnmoch3.org
View Original