Skip to content

docs: NeMo TN parity ceiling + exact-parity FST route - #75

Merged
Alex-Wengg merged 1 commit into
mainfrom
docs/nemo-parity
Jul 9, 2026
Merged

docs: NeMo TN parity ceiling + exact-parity FST route#75
Alex-Wengg merged 1 commit into
mainfrom
docs/nemo-parity

Conversation

@Alex-Wengg

Copy link
Copy Markdown
Member

Records the outcome of the NeMo TN parity investigation so future work has the full picture in-repo.

What this documents (docs/NEMO_PARITY.md)

  • Current en TN parity: 506/566 (89%) — rule-based, pure Rust — with the per-class breakdown (13 classes at 100%).
  • 100% is not achievable, and never was. The test_cases_*.txt files are a union of expected outputs across different NeMo modes (deterministic, non-deterministic, the separate punctuation_match_input exact-spacing mode, and the multi-candidate normalize_with_audio). Confirmed empirically: NeMo's own Python normalizer scores 480/508 (94.5%) on these files — it cannot reproduce them either. So the practical ceiling is ~94–96%.
  • A validated exact-parity route. NeMo's actual compiled grammars (ClassifyFst 147K states / 7.7 MB, VerbalizeFst, PostProcessingFst) loaded in Rust via rustfst + a port of the normalize.py driver reaches 488/508 (96.1%) — genuine NeMo parity — prototyped end-to-end.
  • The three non-obvious fidelity fixes needed to match NeMo (rm_epsilon before shortest-path, a custom tropical DAG shortest-path because rustfst::shortest_path diverges from OpenFST on complex compositions, and a quote-aware token parser), and the size/dependency tradeoff (~10 MB grammars + rustfst vs the current tiny pure-Rust crate).

Docs-only; no code or behavior change.

🤖 Generated with Claude Code

Add docs/NEMO_PARITY.md documenting:
- current en TN parity (506/566, 89%) with the per-class breakdown
- the measured ceiling: NeMo's own normalizer scores only 480/508 (94.5%) on
  its own test files, so 100% is impossible for any single implementation
  (the files aggregate deterministic / non-deterministic / punctuation_match_
  input / normalize_with_audio modes)
- a validated exact-parity route: NeMo's compiled ClassifyFst/VerbalizeFst/
  PostProcessingFst loaded via rustfst + a normalize.py driver port, prototyped
  end-to-end at 488/508 (96.1%), i.e. NeMo-parity
- the three non-obvious fidelity fixes (rm_epsilon, custom tropical
  shortest-path, quote-aware parser) and the size/dependency tradeoff
@Alex-Wengg
Alex-Wengg merged commit 9f5a373 into main Jul 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant