$ show biodatlab/thonburian-whisper
Thonburian Whisper is a Thai Automatic Speech Recognition (ASR) model fine-tuned from OpenAI's Whisper, provided as a reusable application with associated tools. The repository offers the pre-trained model hosted on Hugging Face, along with utilities for transcription, long-form audio processing, TensorRT conversion, and evaluation. Key components include a CLI tool for long-form transcription using VAD and syllable segmentation, scripts for converting the model to TensorRT format for efficient inference, and evaluation metrics calculation. The architecture consists of modular Python scripts and notebooks that demonstrate usage rather than a monolithic application, with clear separation between model usage, audio preprocessing, and post-processing.
The LLM identified 4 files worth highlighting for reuse:
Provides audio loading, preprocessing, and Mel spectrogram computation specifically for Whisper models. Includes functions for loading audio from various formats, padding/trimming to expected lengths, and computing log-Mel spectrograms. Demonstrates clean separation of concerns with well-documented, type-hinted functions that could be reused in any Whisper-based ASR project without modification.
A reusable tokenizer wrapper for Whisper models that handles multilingual language and task tokens. Encapsulates the complexity of Whisper's special token structure (<|startoftranscript|>, language codes, task codes, etc.) into a clean interface with properties for commonly used tokens. Zero internal dependencies, making it easily extractable for use in other projects working with Whisper or similar encoder-decoder models.
Collection of audio processing utilities including Voice Activity Detection using silero-vad, audio format conversion (MP4 to WAV), SRT subtitle generation, and video subtitle burning. Well-structured with clear function boundaries, proper error handling, and minimal dependencies. The VAD implementation is particularly robust with configurable parameters, and the SRT generation handles edge cases like empty text segments.
Implements Thai-specific syllable-based segmentation for improving transcription readability in long-form audio. Handles both Thai and English text differently, using appropriate syllable counting methods for each language. The component avoids cutting words mid-syllable through intelligent range updating and provides configurable segment duration. Shows deep linguistic understanding of Thai language processing challenges.