lingua-rs and whichlang
These are competitors offering alternative approaches to the same problem: lingua-rs prioritizes accuracy across mixed and short text scenarios, while whichlang optimizes for speed and minimal resource overhead, forcing users to choose based on their accuracy-versus-performance requirements.
About lingua-rs
pemistahl/lingua-rs
The most accurate natural language detection library for Rust, suitable for short text and mixed-language text
Based on the README, here's a technical summary: Combines rule-based and statistical Naive Bayes classification without neural networks or external dictionaries, enabling offline language detection from single words to full sentences across 75 languages. Trained on Leipzig University corpora with separate train/test splits from news data, delivering measurably higher accuracy on short text than competing libraries like CLD2 and Whatlang. Includes minimal configuration requirements and ships with bundled language models for immediate use without API dependencies.
About whichlang
quickwit-oss/whichlang
A blazingly fast and lightweight language detection library for Rust
Related comparisons
Scores updated daily from GitHub, PyPI, and npm data. How scores work