Skip to main content

WeTextProcessing, including TN & ITN

Project description

Text Normalization & Inverse Text Normalization

1. How To Use

1.1 pip install

pip install WeTextProcessing
# tn
from tn.chinese.normalizer import Normalizer
normalizer = Normalizer()
normalizer.normalize("2.5平方电线")
# itn
from itn.chinese.inverse_normalizer import InverseNormalizer
invnormalizer = InverseNormalizer()
invnormalizer.normalize("二点五平方电线")

1.2 source code compilation

git clone https://github.com/wenet-e2e/WeTextProcessing.git
cd WeTextProcessing
python normalize.py --text "2.5平方电线"
python inverse_normalize.py --text "二点五平方电线"

2. TN Pipeline

Please refer to TN.README

3. ITN Pipeline

Please refer to ITN.README

Acknowledge

  1. Thank the authors of foundational libraries like OpenFst & Pynini.
  2. Thank NeMo team & NeMo open-source community.
  3. Thank Zhenxiang Ma, Jiayu Du, and SpeechColab organization.
  4. Referred Pynini for reading the FAR, and printing the shortest path of a lattice in the C++ runtime.
  5. Referred TN of NeMo for the data to build the tagger graph.
  6. Referred ITN of chinese_text_normalization for the data to build the tagger graph.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

WeTextProcessing-0.0.3.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

WeTextProcessing-0.0.3-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file WeTextProcessing-0.0.3.tar.gz.

File metadata

  • Download URL: WeTextProcessing-0.0.3.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for WeTextProcessing-0.0.3.tar.gz
Algorithm Hash digest
SHA256 29f9cf652f1946691af845c1d2760a5cf92fdd259fe86e82fd559c9c6a53eab2
MD5 109b4e3c396c26322950a6d7c3c9a033
BLAKE2b-256 4c7e7f21687da3a3692fbc726cad11fe6dfdecbcec5526380442d49e8ac8080d

See more details on using hashes here.

File details

Details for the file WeTextProcessing-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for WeTextProcessing-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 39986bead86dae0e63529dd95a0b810ca5bb8118e11d724ed0f8b2c66647de9b
MD5 df358c0e0778ee41ffd01631ff965112
BLAKE2b-256 cb5946691312b5cc29c3ec784d9131fc874f2328c47d12cb5408e3e0b7107a50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page