$ show nl8590687/ASRT_SpeechRecognition
ASRT (Automatic Speech Recognition Toolkit) is a Chinese speech recognition system that provides both training and inference capabilities. It uses a deep CNN acoustic model with Connectionist Temporal Classification (CTC) and an N-gram language model based on a maximum entropy hidden Markov model. The system supports multiple backends (TensorFlow/Keras and experimental PyTorch) and can be trained on several Chinese speech corpora (THCHS30, ST-CMDS, etc.). It includes HTTP and gRPC servers for real-time inference, a speech recorder utility, and client libraries. The architecture is monolithic with separate scripts for training, evaluation, and serving. The codebase is functional but shows signs of technical drift, such as using deprecated Keras APIs (fit_generator) and hardcoded paths. The language model implementation is a notable highlight, offering a non-trivial statistical decoding approach. The repository is popular but has a single maintainer and a high number of open issues.
The LLM identified 2 files worth highlighting for reuse:
Implements an N-gram language model with maximum entropy and hidden Markov model for decoding. It is relatively self-contained (only imports from utils.config and utils.ops), uses a custom beam search, and provides a frequency-based and smoothed probability estimation. This component can be extracted and reused in other ASR systems that require a statistical language model for Mandarin Chinese, with minimal adaptation.
Provides a `threadsafe_generator` decorator that wraps a generator to be thread-safe using a threading lock. This is a clean, reusable utility for Keras data loading pipelines where multiple workers may access the same generator. It is a small but effective pattern that can be easily extracted and applied to any Keras training workflow.