All models
    DiacNet family · Diacritic restoration

    diacnet-2.0

    Put the accents and tone marks back, in 11 languages.

    diacnet-2.0 takes text typed without its marks and returns it written properly: Yorùbá tone marks, Vietnamese accents, Polish and Turkish letters, Arabic vowels. It is the most accurate model in the DiacNet line and our first to handle Arabic.

    diacnet-2.0 banner
    11
    Languages
    0.0117
    Mean error rate
    2.5×
    Lower Yorùbá error than 1.1
    582M
    Parameters
    / Why it exists

    The problem it solves

    Most people type without diacritics because phone keyboards make them slow. Old databases strip them and OCR drops them. In tonal and accented languages that is not cosmetic: the same unmarked spelling can be several different words.

    Fixing it by hand needs fluent proofreaders in every language. diacnet-2.0 does the first pass for you, and an alignment step makes sure it only adds marks and never rewrites your text.

    / Benchmarks

    The numbers

    diacbench, 1,000 sentences per language

    diacbench, 1,000 sentences per language

    Error rate per language for the whole DiacNet line against diacnet-1.1 (log scale, lower is better). diacnet-2.0 has the lowest error on 8 of 10 languages.

    Meaning hints

    Meaning hints

    A short hint about the intended meaning lifts accuracy on ambiguous words: Vietnamese 0.63 → 0.90, Turkish 0.75 → 0.84, Polish 0.93 → 0.98.

    / What you get

    Highlights

    Yorùbá, rebuilt

    The Yorùbá error rate falls from 0.174 to 0.070 against diacnet-1.1, and 12% of sentences now come back exactly right, up from 0.8%.

    Arabic in two styles

    Full vowelling with case endings for teaching and text-to-speech, or the lighter no-case-endings style most modern Arabic uses.

    Hints for ambiguous words

    Tell it which meaning you want ([g: word=meaning]) and Vietnamese ambiguous-word accuracy rises from 0.63 to 0.90.

    Never rewrites your text

    With alignment on (the default in the SDK), every letter you typed is kept and only the marks are taken from the model.

    / Quick start

    Run it in a few lines

    $pip install "olaverse[deeplearning]"
    quickstart.py
    from olaverse.nlp import Diacritizer
    
    d = Diacritizer(model="diacnet-2.0", lang="yor", device="cuda")
    d.restore("O so fun ara re pe oun ko ni isoro kankan.")
    # → 'Ó sọ fún ara rẹ̀ pé òun kò ní ìṣòro kankan.'
    
    # Arabic without case endings
    d.restore("وهذا قول مرغوب عنه .", lang="ara", case_endings=False)
    
    # Don't know the language? Leave it out.
    Diacritizer(model="diacnet-2.0").restore("No pude sujetarme a la cuerda mas tiempo.")
    # → 'No pude sujetarme a la cuerda más tiempo.'
    / DiacNet family

    Which DiacNet model?

    Smaller budget? diacnet-mini-2.0 does the same at half the size. Need a CPU model that can never touch your letters? Use diactag-2.0.

    diacnet-2.0THIS PAGEdiacnet-mini-2.0 →diactag-2.0 →
    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

    • Publishing-quality restoration in Yorùbá and the European languages, where accuracy matters most.
    • Text with ambiguous words, where a meaning hint settles the right marks.
    • Messy input where you also want typos corrected along the way.
    • Mixed-language batches, with the language detected for you.
    / Built with
    ByT5-base Transformers PyTorch Apache-2.0