Downloads · 30 days
9
9% of all-time downloads
Mikhailo/mT5-small-ITN-uk
mT5-small-ITN-uk is a machine learning model from Mikhailo. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Inverse Text Normalization model for Ukrainian, fine-tuned from google/mt5-small.
Downloads · 30 days
9
9% of all-time downloads
All-time downloads
103
Public
Parameters
172M
2.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors689 MB · 97%
From the Hugging Face model README
Inverse Text Normalization model for Ukrainian, fine-tuned from google/mt5-small.
For fast CPU inference, use the CTranslate2 version: Mikhailo/mT5-small-ITN-uk-ct2
from transformers import MT5ForConditionalGeneration, AutoTokenizer
import torch
tok = AutoTokenizer.from_pretrained("Mikhailo/mT5-small-ITN-uk")
model = MT5ForConditionalGeneration.from_pretrained("Mikhailo/mT5-small-ITN-uk").eval()
def itn(text):
inp = tok(text, return_tensors="pt")
with torch.no_grad():
out = model.generate(**inp, max_new_tokens=140, num_beams=4)
return tok.decode(out[0], skip_special_tokens=True)
print(itn("сорок два відсотки населення")) # → 42% населення
print(itn("пʼятнадцять доларів і двадцять центів")) # → $15.20
google/mt5-smallMikhailo/ubertext-itn-uk (~889k pairs)