All models
    DiacNet family · Diacritic restoration

    diactag-2.0

    Diacritics that can never change your letters.

    diactag-2.0 restores marks in the same 11 languages as the rest of the DiacNet line, but it works differently. Instead of rewriting the sentence, it looks at each character and decides which marks belong on it, so the letters you typed always come back untouched.

    diactag-2.0 banner
    11
    Languages
    1.0000
    Letter safety, by design
    ~8 ms
    Per sentence on a laptop CPU
    37.9M
    Parameters
    / Why it exists

    The problem it solves

    Generative models are powerful but they write the sentence out again, and anything that rewrites can reword. For records, legal text or an archive of record, "usually only adds accents" is not good enough.

    diactag-2.0 removes that risk by design. It only ever predicts marks, and it is small enough to run on an ordinary CPU, so you can put it straight into a product without a GPU bill.

    / Benchmarks

    The numbers

    Arabic against open diacritizers

    Arabic against open diacritizers

    Second-lowest error on Modern Standard Arabic news (0.086), with 0.0% of sentences altered, where the generative systems change letters in 14–24% of sentences.

    Same accuracy, plus Arabic

    Same accuracy, plus Arabic

    Scored side by side, diactag-2.0 holds diactag-1.0’s accuracy on the original ten languages while adding Arabic to the same model.

    / What you get

    Highlights

    Cannot corrupt text

    Base characters are copied, never predicted, so the output is always your input with marks added.

    Best for Modern Standard Arabic

    Ranks second of five open Arabic diacritizers on Modern Standard Arabic benchmarks, and unlike the generative ones it never alters the input.

    Runs on a CPU

    A 38.6 MB int8 ONNX export restores a typical sentence in about 8 ms on a laptop.

    Detects the language itself

    Leave the language out and its built-in detector picks it. Per-character confidence lets you send unsure marks for review.

    / Quick start

    Run it in a few lines

    $pip install "olaverse[deeplearning,onnx]"
    quickstart.py
    from olaverse.nlp import Diacritizer
    
    d = Diacritizer(model="diactag-2.0", lang="yor", onnx=True)   # int8 on CPU
    d.restore("se eranko naa si gbo o?")          # → 'ṣé ẹranko náà sì gbọ́ ọ?'
    
    ar = Diacritizer(model="diactag-2.0", lang="ar")
    ar.restore("ذهب الطالب إلى المدرسة في الصباح", case_endings=False)
    
    # No language? It detects one.
    Diacritizer(model="diactag-2.0").restore("Toi khong biet tieng Viet")
    # → 'Tôi không biết tiếng Việt'
    
    # Per-character confidence for a review queue
    text, details = d.restore("se eranko naa si gbo o?", return_details=True)
    / DiacNet family

    Which DiacNet model?

    Want the highest accuracy and typo correction? Use diacnet-2.0, or diacnet-mini-2.0 at half the size.

    diacnet-2.0 →diacnet-mini-2.0 →diactag-2.0THIS PAGE
    Parameters582M300M37.9M
    How it worksRewrites the textRewrites the textTags each character
    Mean error rate, 10 languages0.01170.01410.0130
    Yorùbá error rate0.06980.08150.0787
    Strongest onYorùbá and European languagesClose to 2.0 at half the sizeIgbo, Vietnamese, Modern Standard Arabic
    ExtrasMeaning hints, typo correctionMeaning hints, typo correctionCPU-ready ONNX, never alters letters
    / Where it shines

    Best for

    • Records, legal text and archives, where letters must never change.
    • CPU-only and on-device serving through the int8 ONNX export.
    • Modern Standard Arabic, Igbo and Vietnamese, its strongest languages.
    • Review workflows that use per-character confidence to flag unsure marks.
    / Built with
    Character transformer PyTorch ONNX Runtime Apache-2.0