All models
    LID-608 family · Language identification

    lid-neural-608

    Know the language of any text, even when it is three words long.

    lid-neural-608 tells you which of 608 languages a piece of text is written in. We built it African-first and trained it on the messy input real products receive: chat messages, typos, missing accents, emoji and stray URLs.

    Also in LID-608:lid-lite-608
    lid-neural-608 banner
    608
    Languages
    0.867
    Held-out accuracy
    0.906
    1-5 words, traffic mode
    140M
    Parameters
    / Why it exists

    The problem it solves

    Most language detectors were built for paragraphs of web text in a few hundred well-resourced languages. Hand them a short Yorùbá greeting or a Kinyarwanda search query and they guess, often confidently and often wrong.

    That guess decides everything downstream: which support queue a ticket lands in, which moderation model scores a message, which language your analytics think your users speak. We wanted a detector that holds up on exactly that kind of input.

    / Benchmarks

    The numbers

    Head to head on the same test rows

    Head to head on the same test rows

    Against lid-lite-608, GlotLID v3 and Meta’s fastText LID across six test sets. It leads the held-out test (0.867), conversational Tatoeba (0.930) and, in traffic mode, real-world 1-5 word input (0.906).

    Accuracy by input length

    Accuracy by input length

    Ahead of GlotLID at every length, with the biggest lead on the shortest text: 0.666 against 0.486 on 1-5 words.

    / What you get

    Highlights

    Two modes, one model

    Coverage mode treats every language as equally likely, for finding rare languages. Traffic mode leans on how often languages actually appear, for user input. You choose per call.

    Strong on short text

    In traffic mode it reads 1-5 word inputs at 0.906 web-weighted accuracy and everyday phrases at 0.943, the best of every model we compared.

    Tells language from noise

    A dedicated zxx_Zxxx class catches numbers, URLs and code, so junk never gets forced into a real language.

    Free for commercial use

    Fine-tuned from MIT-licensed mmBERT-small on commercially usable data, and released under Apache-2.0.

    / Quick start

    Run it in a few lines

    $pip install "olaverse[deeplearning]"
    quickstart.py
    from olaverse import LIDNeural608
    
    lid = LIDNeural608(device="cuda")          # "cpu", "mps" or "auto"
    lid.predict("Habari za asubuhi")           # → 'swh_Latn'
    lid.predict_batch(["Mo fẹ́ lọ sí ọjà lónìí", "Bonjour mon ami"])
    # → ['yor_Latn', 'fra_Latn']
    
    # For user input, switch to traffic mode
    chat = LIDNeural608(mode="traffic")
    chat.predict_batch(["Good morning", "Thank you very much"])
    # → ['eng_Latn', 'eng_Latn']
    / LID-608 family

    Which LID-608 model?

    Need raw speed on a CPU instead? lid-lite-608 has the same languages, labels and modes in 37 MB.

    lid-neural-608THIS PAGElid-lite-608 →
    Size140M parameters37 MB
    Speed~1,100 texts/s on an A100~6,800 texts/s on one CPU thread
    Held-out accuracy0.8670.858
    1-5 words, traffic mode0.9060.829
    Everyday phrases, traffic mode0.9430.838
    Best forUser input and short textBulk filtering, CPU and edge
    / Where it shines

    Best for

    • Routing chat messages, search queries and support tickets, where text is short and typed by real users.
    • Products for African users that need to tell Yorùbá, Hausa, Igbo, Swahili and Pidgin apart reliably.
    • Accuracy-first pipelines with a GPU, with lid-lite-608 in front as a fast first pass at scale.
    • Separating real language from numbers, URLs and code before anything downstream runs.
    / Built with
    ModernBERT (mmBERT-small) Transformers PyTorch Apache-2.0