Know what language every message is in, before you act on it

    Detect the language of support tickets, chat messages, queries, and documents across 25 languages — including the African languages most detectors get wrong.

    Customer supportTrust & safetyFintech & KYCAnalytics
    98.2%
    ACCURACY ON SHORT TEXT (25.2)
    99.9%
    ACCURACY ON PASSAGES (25.1)
    125M
    PARAMETERS, CPU-FINE
    / The problem

    Why this breaks today

    Every multilingual pipeline starts with the same question: what language is this? Route on the wrong answer and the ticket lands with an agent who cannot read it, the moderation classifier scores gibberish, and the analytics dashboard reports a language mix that never existed.

    Off-the-shelf detectors are trained on web-scale text where Yorùbá, Igbo, and Hausa barely register. They are also tuned for paragraphs, so they degrade exactly where real products live: a six-word chat message or a three-word search query.

    / How it works

    The pipeline, step by step

    01

    Pick the checkpoint that matches your input length

    lid-neural-25.2 is trained on short text — queries, chat messages, form fields. lid-neural-25.1 is trained on paragraph-length text — documents, articles, support emails. Same architecture, different training distribution, one variant= argument apart.

    lid-neural-25.2
    02

    Classify in one call

    Both checkpoints are XLM-RoBERTa sequence classifiers at 125M parameters. They load through one SDK class (or the plain transformers text-classification pipeline) and run on CPU in production.

    lid-neural-25.1
    03

    Route on the label, gate on the score

    Send the ISO 639-3 label downstream to your queue, translation layer, or language-specific model — and hold low-confidence predictions for review rather than routing them wrong.

    / The code

    Running in about ten lines

    The Olaverse SDK wraps the models with sane defaults. If you would rather not add a dependency, the second tab is the same pipeline in plain transformers.

    $pip install olaverse[deeplearning]
    route.py
    from olaverse.nlp import LIDNeural25
    
    lid = LIDNeural25(variant="questions")   # "passages" for long-form text
    lid.load()
    
    lid.predict("Kedu ka i mere?")           # → 'ibo'
    lid.predict_proba("Kedu ka i mere?")     # → {'ibo': 0.998, 'yor': 0.001, ...}
    
    # Route on the label, gate on the confidence
    def route(message):
        scores = lid.predict_proba(message)
        lang, score = max(scores.items(), key=lambda kv: kv[1])
        return LANGUAGE_QUEUES.get(lang, "human-review") if score > 0.9 else "human-review"

    Language coverage

    / 25 LANGUAGES

    Every language the models in this pipeline were trained on, with the codes you pass and the codes you get back.

    Afrikaans
    af · afr
    Amharic
    am · amh
    German
    de · deu
    English
    en · eng
    French
    fr · fra
    Hausa
    ha · hau
    Hindi
    hi · hin
    Igbo
    ig · ibo
    Indonesian
    id · ind
    Italian
    it · ita
    Japanese
    ja · jpn
    Korean
    ko · kor
    Dutch
    nl · nld
    Polish
    pl · pol
    Portuguese
    pt · por
    Russian
    ru · rus
    Shona
    sn · sna
    Somali
    so · som
    Spanish
    es · spa
    Swahili
    sw · swh
    Turkish
    tr · tur
    Vietnamese
    vi · vie
    Xhosa*
    xh · xho
    Yorùbá
    yo · yor
    Zulu*
    zu · zul

    *The models return ISO 639-3. Xhosa and Zulu are marked because they are confused with each other on short text (F1 ~0.79 each, against ≥0.98 everywhere else) — see the limitations below.

    / This is you if
    • You run a support inbox, chat product, or marketplace where users write in more than one language.
    • Your existing detector handles English and French fine but guesses on Yorùbá, Igbo, or Hausa.
    • Your text is short: queries, messages, form fields, product titles.
    / What it can't do
    • Zulu and Xhosa get confused with each other on short text (F1 ~0.79 for both, against ≥0.98 for every other language). Two closely related Nguni languages, and the same failure shows up in a completely different architecture — treat that specific pair with reduced confidence.
    • Coverage is 25 languages. Anything outside the list gets forced into one of them, so add an out-of-scope confidence threshold if your traffic is genuinely open-world.
    • Accuracy drops on text typed without its diacritics, because the marks are part of what the model reads. In our own spot-check, six Yorùbá sentences scored 6/6 with the marks and 4/6 without — with confident wrong answers, so a confidence gate will not catch them. Restore the marks first if your input is stripped.
    • Trained on machine- and teacher-generated text, which is cleaner than what real users type.

    Every figure on this page comes from the published model cards, and every limitation is one the cards state themselves. Download the weights and check us.

    Want this on your data?

    The weights are open, so you can build it yourself this afternoon. If you would rather we tuned it to your domain, evaluated it properly, and handed it over, tell us what you are working on.