wenet-e2e/WeTextProcessing

Text Normalization & Inverse Text Normalization

What it solves

WeTextProcessing handles the conversion between written text and its spoken form, a critical step for speech-based applications. It performs Text Normalization (TN), which converts written symbols like "12" into spoken words like "twelve" (useful for speech synthesis), and Inverse Text Normalization (ITN), which converts spoken words back into written symbols (useful for speech recognition).

How it works

The project uses Weighted Finite-State Transducers (WFSTs) built with Pynini and OpenFst. It defines language-specific grammars that identify structured expressions like dates, times, and currencies. The system operates in two stages: tagging, which identifies and labels these expressions, and verbalization, which converts them into the target format. It supports automatic caching of these processing graphs to improve performance and provides a C++ runtime for native deployment.

Who it’s for

This tool is designed for developers and researchers building speech synthesis or speech recognition pipelines who need a reliable, rule-based way to handle text formatting. It is particularly useful for those working with Chinese, English, Japanese, or Korean, where language-specific normalization rules are already implemented.

Highlights

  • Supports four languages: Chinese, English, Japanese, and Korean.
  • Provides explainable output by allowing users to inspect raw tagged fields and trace input/output spans.
  • Supports n-best results, allowing the system to return multiple potential interpretations for a given input.
  • Includes a C++ runtime for high-performance production deployment.
  • Features automatic, configuration-aware FST caching to speed up processing.

Related

  • Project
  • Project
  • Project
  • Project
  • Project