Downloads · 30 days
0
brady-pplx/sherpa-onnx-en-itn
sherpa-onnx-en-itn is a machine learning model from brady-pplx. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Builds enitn.fst, an inverse-text-normalization rewrite consumed by sherpa-onnx's rulefsts/rulefars ITN stage. It turns spoken-form numbers in the recognizer output into written form ("two thousand twenty six" → "2026…
Downloads · 30 days
0
Access
Public
Updated Jun 16, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.fst62.1 KB · 83%
From the Hugging Face model README
Builds en_itn.fst, an inverse-text-normalization rewrite consumed by
sherpa-onnx's rule_fsts/rule_fars ITN stage. It turns spoken-form numbers in
the recognizer output into written form ("two thousand twenty six" → "2026",
"five dollars" → "$5", "ten percent" → "10%").
This exists because our on-device NeMo/Nemotron model spells numbers out, and neither WeTextProcessing (Chinese-only ITN) nor NVIDIA's NeMo-text-processing FARs are usable here — NeMo's exports are a tagger+verbalizer pair that require Sparrowhawk's two-pass parser, whereas sherpa applies each FST as a single-pass rewrite. So we author our own.
sherpa loads the FST and runs compose(input_text, rule) → shortestpath. The
rule FST must therefore be:
standard arc type (StdArc / tropical) — asserted on load, log rejectedvector or const OpenFST binarybyte lib"" and wipes the
transcriptbuild_en_itn.py satisfies all four. test_en_itn.py validates by replicating
sherpa's compose+shortestpath, so a green test means it works at runtime.
pynini cannot build natively on macOS arm64, so the build is containerized:
./build.sh
Outputs tools/itn/out/en_itn.fst (and en_itn.far), runs the test suite.
Distributed exactly like the punctuation model — a Hugging Face repo under our
org, pulled by the on-device ModelManager via OnDeviceModelSpec::Repo. The
SDK references it through the ItnModel config (OnDeviceAsrConfig::with_itn)
and sets config.rule_fsts in
sdk/multimodal-asr-on-device-client/src/engines/asr.rs.
Upload the built FST to the repo the SDK is wired to (brady-pplx/sherpa-onnx-en-itn):
pip install -U huggingface_hub
huggingface-cli login # needs write access to brady-pplx
huggingface-cli upload brady-pplx/sherpa-onnx-en-itn tools/itn/out/en_itn.fst en_itn.fst
ItnModel.revision resolves as a branch/tag ref (defaults to main), not a raw
commit hash, so to freeze a version create a tag on the repo and set that. The
grammar is authored here from scratch, so the artifact carries no upstream
license obligation.
Covered: cardinals 0–999,999,999, US-dollar amounts, percentages.
Follow-ups: year readings ("twenty twenty six" currently → "20 20 6"), cents ("five dollars fifty"), ordinals, dates, phone numbers.