LlmKira/fast-langdetect
⚡️ 80x faster Fasttext language detection out of the box | Split text by language
What it solves
This library provides a high-performance, easy-to-use tool for identifying the language of a given text string. It is designed to be significantly faster than traditional language detection methods while maintaining high accuracy, making it suitable for processing large volumes of text in production environments.
How it works
It is a wrapper around Facebook's FastText library, specifically utilizing their pre-trained language identification models. The project simplifies the integration by handling model downloading, caching, and memory management. It offers two primary model sizes: a 'lite' version for memory-constrained environments and a 'full' version for higher accuracy. It also includes an 'auto' mode that attempts to load the full model but gracefully falls back to the lite version if memory limits are exceeded.
Who it’s for
Developers building applications that need to automatically detect the language of user input, such as content moderation systems, multilingual chatbots, or data processing pipelines, who require a lightweight and fast solution.
Highlights
- Extremely fast inference performance compared to conventional detection libraries.
- Supports both 'lite' and 'full' models to balance memory usage and accuracy.
- Includes an 'auto' fallback mechanism to ensure stability under memory pressure.
- Designed for offline usage with no external dependencies like NumPy.
- Provides simple configuration for custom cache paths and input truncation settings.
Related
- Project
- Project
- Project
- Project