Posts

Pairing WhisperX with LLM's

Pairing WhisperX with LLM's I've found some time to continue my project. In my last article, I mentioned that I was using faster-whisper for both transcription and translation, as well as dealing with the annoying issue of overlapping or misaligned subtitles that needed manual correction. This is a common problem for users of the library (you can read more about it in this guide on fixing Whisper timestamp alignment ). To fix this, I decided to switch to the WhisperX library. While it is a much heavier tool, it uses faster-whisper under the hood and layers forced phoneme alignment on top. This resulted in fantastic transcriptions, but the built-in translations were still poor for less popular languages. To solve this, I bypassed Whisper's native translation entirely and routed the transcriptions through Google's Gemini LLMs to translate them into my preferred language. Technical Details Next, I had to figure out how to structure the data for translation. In my...

A translation exploration

Image
  A translation exploration Being a speaker of more than one language—English, Serbo-Croatian, and beginner-level Italian—some months ago I gained an interest in video translation and subtitling. I discovered many online apps that aid with this; with a plethora of online AI tools and a slightly lighter wallet, you can quickly find yourself with a subtitled video in the language of your choice. You may just have to make a few corrections to capture local idioms that get lost in translation. Given that I simply wanted to spit out some subtitles without paying to call a third-party LLM or as above paying to use a web application, I turned to Hugging Face’s open-source models. Soon enough, I had a script running locally that output my subtitles in .srt format. I downloaded Kdenlive, an open-source video editor available for my Ubuntu machine, and overlaid the subtitles. VoilĂ ! I had my first subtitled video, allowing me to share Serbo-Croatian videos with my wife (who doesn’t speak the...