Skip to main content

Whisper Normalization

PyPI

A Python package for text normalization, specifically designed for use with Whisper models.

Note: This code is extracted from OpenAI's Whisper repository to allow for standalone usage of the text normalization modules without the heavy dependencies of the full Whisper package.

Installation

You can install this package directly from source:

pip install .

You can also be installed from PyPi:

pip install whisper-normalization

Usage

from whisper_normalization import EnglishTextNormalizer, BasicTextNormalizer

# English Normalization
normalizer = EnglishTextNormalizer()
text = "Mr. Smith bought $5.50 worth of apples in the 1990s."
normalized = normalizer(text)
print(normalized)
# Output: "mister smith bought five dollars and fifty cents worth of apples in the nineteen nineties"

# Basic Normalization
basic_normalizer = BasicTextNormalizer()
text = "Bonjour à tous!"
normalized = basic_normalizer(text)
print(normalized)

Features

  • Basic text cleaning (symbol removal, diacritic handling)
  • Advanced English normalization:
    • Number to text conversion (integers, decimals, currencies, years)
    • Contraction expansion
    • Abbreviation expansion
    • British to American spelling normalization

Release files for whisper-normalization 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whisper-normalization 1.0.0
File Size Uploaded
whisper_normalization-1.0.0.tar.gz 21.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for whisper-normalization 1.0.0
File Interpreter ABI Platform
whisper_normalization-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.3 kB

Release files / whisper_normalization-1.0.0.tar.gz

Download URL whisper_normalization-1.0.0.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f40718b485635feb87e15cbe1d736a748e3e1dc1a4855fda6743038ea9bc1364
BLAKE2b-256 checksum
How to use checksums
af5dd9083d7ec558e1136a12d835e597b3c6875f2277c018b4ff90dd48e1316e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / whisper_normalization-1.0.0-py3-none-any.whl

Download URL whisper_normalization-1.0.0-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fe0c47a84c00fc861787999d9bb3ad4f35295e58c24fa5b67ec974ee5d86d57
BLAKE2b-256 checksum
How to use checksums
a66a251a66beb4430650a9ca3291ad7597321b3fb910f3938333dac978be97fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page