YellowMIST-Punct-1.0-OA

YellowMIST Punct puts back the punctuation and capitals in text that has none, such as speech-to-text output or quick chat messages. It writes each language's own marks: the danda (।) for Hindi, ። and ፣ for Amharic, ، and ؟ for Arabic script, and so on. It is a tiny on-device model, one per script or region group. This one covers Greek, Hebrew, Georgian, Armenian and Thaana: 14 languages tested.

  • Built on olaverse/YellowMIST-Encoder-15M-OA, a 15M-parameter character encoder, with two small heads: the punctuation mark after each character (none, full stop, comma, question mark, exclamation mark), and whether the character is a capital.
  • It reads characters, so unusual spellings and missing tone marks do not break a tokenizer.

Results

Held-out web documents from the YellowMIST corpus, never used in training. The input is the text lowercased with its punctuation removed; the model has to put both back. Punctuation F1 counts a mark as right only if it is the right mark in the right place.

  • Mean punctuation F1: 53.2%
  • Mean capitals F1: 79.4%

Against a large multilingual model

The same held-out text, on the languages both models cover, against 1-800-BAD-CODE/xlm-roberta_punctuation_fullstop_truecase, an XLM-RoBERTa model about 18 times larger.

Language this model, punctuation XLM-R, punctuation this model, capitals XLM-R, capitals
ell_Grek 68.0% 61.2% 84.7% 81.8%
Every language tested
Language punctuation F1 capitals F1 marks in test
kat_Geor 66.2% – 2339
hyw_Armn 57.1% 74.4% 1553
ydd_Hebr 55.0% – 1304
grc_Grek 62.7% 89.5% 1167
hye_Armn 57.5% 68.7% 1119
ell_Grek 60.0% 73.6% 1045
heb_Hebr 63.1% – 1043
div_Thaa 78.9% – 813
xmf_Geor 29.6% – 576
hbo_Hebr 13.6% – 535
aii_Syrc 57.5% – 80
syr_Syrc 64.8% – 55
tzm_Tfng 50.0% – 6
pnt_Grek 28.6% 90.9% 6

Training

  • 40,000 steps of 64 pieces of up to 256 characters from the YellowMIST corpus (about 20M characters per language), with the punctuation removed and the text lowercased.
  • Languages are drawn in proportion to the size of their text (to the power 0.3).
  • ; and : are learnt as commas (except the Greek question mark). Quotes, brackets and dashes are left as they are.

Use

With the yellowmist library (recommended)

pip install yellowmist        # or: npm install yellowmist
import yellowmist as ym
ym.punct("your text without punctuation or capitals", "ell_Grek")
import * as ym from "yellowmist";
await ym.punct("your text without punctuation or capitals", "ell_Grek");
yellowmist punct "your text" --lang ell_Grek

The library downloads this model the first time it is needed, picks the right region for each language, and runs it with ONNX Runtime on the CPU. Output is the text with this language's own punctuation marks and, where the script has them, capitals.

Without the library (ONNX Runtime)

import json, unicodedata, numpy as np, onnxruntime as ort
from huggingface_hub import snapshot_download

d = snapshot_download("olaverse/YellowMIST-Punct-1.0-OA", allow_patterns=["onnx.json", "vocab.json", "punct.json", "model.int8.onnx"])
meta, pj = json.load(open(f"{d}/onnx.json")), json.load(open(f"{d}/punct.json"))
ids = {t: i for i, t in enumerate(json.load(open(f"{d}/vocab.json"))["vocab"])}
sess = ort.InferenceSession(f"{d}/model.int8.onnx")

lang = "ell_Grek"
names = ["none", "period", "comma", "question", "exclaim"]
glyph = {1: ".", 2: ",", 3: "?", 4: "!"}           # this language's own marks override these
glyph.update({(int(k) if str(k).isdigit() else names.index(k)): v for k, v in pj.get("glyphs", {}).get(lang, {}).items()})
cased = lang in pj.get("cased", [])

text = unicodedata.normalize("NFC", "your text without punctuation or capitals").lower()   # up to 255 characters
seq = [ids[f"<|lang:{lang}|>"]] + [ids.get(c, 1) for c in text]                    # 1 = <unk>
x = np.zeros((1, meta["length"]), np.int64); m = np.zeros((1, meta["length"]), np.float32)
x[0, :len(seq)] = seq; m[0, :len(seq)] = 1
p, c = (o[0, 1:len(seq)].argmax(-1) for o in sess.run(None, {"ids": x, "mask": m}))
print("".join((ch.upper() if cased and c[k] == 1 else ch) + (glyph[int(p[k])] if p[k] else "") for k, ch in enumerate(text)))

Longer text: cut it at spaces into pieces of at most 255 characters. The library also settles capitals word by word.

Fine-tune your own

The fine-tuning notebook (open in Colab) walks through continuing pretraining on your own text, fine-tuning a task, exporting to ONNX and sharing it. In short:

from yellowmist import train
import yellowmist as ym

enc = train.Encoder.load("OA")                       # this region's base encoder
model = train.finetune_punct(enc, {"ell_Grek": paragraphs})   # your own punctuated text
model.save("my-model")                           # weights + ONNX, ready for the library
ym.register("punct", "my-model")                        # your model now serves its languages

pip install "yellowmist[train]" for training (PyTorch and Dew).

More: documentation · GitHub · playground · fine-tuning notebook

Limits

  • Capitals are weaker than punctuation. Mean capitals F1 is 79.4% on this test, below our 85% target. The test text is web pages, with titles, lists and names in mixed case, and the larger model also falls short of the target on it. Treat capitals as a helpful guess.
  • The scores are on written web text. Speech transcripts and chat are punctuated differently; expect some drop.
  • Long text is cut into pieces of about 256 characters at spaces, so a mark right at a cut can be missed.

Licence

Apache-2.0.

Citation

@misc{yellowmist-punct-1.0-oa,
  title  = {YellowMIST-Punct-1.0-OA: tiny on-device punctuation and capitals restoration},
  author = {Olaverse},
  year   = {2026},
  url    = {https://huggingface.co/olaverse/YellowMIST-Punct-1.0-OA}
}
Downloads last month
-
Safetensors
Model size
15M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for olaverse/YellowMIST-Punct-1.0-OA

Finetuned
(2)
this model

Collection including olaverse/YellowMIST-Punct-1.0-OA