# Lingua

The most accurate natural language detection library for Rust, suitable for short text and mixed-language text

Repository: https://github.com/pemistahl/lingua-rs
Canonical: https://ross.abutalabs.com/products/lingua
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: rust, rust-library, rust-crate, language-detection, language-classification, language-recognition, natural-language-processing, nlp, language-identification, nlp-machine-learning, language-processing
Last push: 2026-09-02T20:23:18+00:00

## Health v2 (maintenance only)
Score: 87/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 62, longevity 100
- inputs: {"age_days": 2268, "days_push": 0, "days_rel": 177, "gap_med": 67, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1129, forks 63 (observed 2026-09-03T02:15:16.767387+00:00)

## What it is
Lingua is a language detection library for Python (with a Rust core) that identifies which of 75 languages a text is written in. It is designed for high accuracy on short and mixed-language text, using rule-based and statistical Naive Bayes methods entirely offline.

## Use cases
- detect the language of a short text snippet like a tweet
- identify language of single words or phrases
- preprocess text for language-specific NLP pipelines
- route customer emails by language
- detect language in mixed-language text
- run language detection offline without external APIs

## When to choose
- you need accurate detection on very short text where CLD3 or langid fail
- you need offline detection without network calls
- you need support for many languages with mixed-language input

## When to avoid
- you need neural-network-based detection or embeddings
- you work with Python < 3.12
- you need extremely lightweight detection of only a few major languages

## Facets
- artifact type: library
- maturity: active
- function: nlp, parser
- domain: machine-learning
- platform: python, rust, cross-platform
- tags: language-detection, language-identification, offline, naive-bayes, short-text, natural-language-processing

## Member repositories
- pemistahl/lingua-rs (main) score 87
- pemistahl/lingua-py (sdk) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-09-03T02:15:16.767387+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:24:08.933600+00:00, confidence not recorded.
  - readme: https://github.com/pemistahl/lingua-rs (fetched 2026-09-03T02:15:16.767387+00:00, sha 796557c1e674)
- Data as of 2026-08-30T08:39:29.467469+00:00.
