Skip to main content

Text normalization for Whisper models

Project description

Whisper Normalization

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 .

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

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

whisper_normalization-0.1.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

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

whisper_normalization-0.1.0-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file whisper_normalization-0.1.0.tar.gz.

File metadata

  • Download URL: whisper_normalization-0.1.0.tar.gz
  • Upload date:
  • Size: 21.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for whisper_normalization-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af393036df480f9df2a13a8571a221be70d2d5f698a8978d033b1af1109d6bf7
MD5 1a1874387fb8922a261bc2a6c485b3b4
BLAKE2b-256 5cb128c67bf49fd8a92fdfc4bf16ec5abbf906f9083f9bf4b69a6f6292ca566a

See more details on using hashes here.

File details

Details for the file whisper_normalization-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for whisper_normalization-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2155a2fb48e8ebe358711a4884d1586cdd9f9866da66707b95f649734ff3e602
MD5 4088aa49e72274ba69dae485716ddc00
BLAKE2b-256 c83f5e2783d3912554faa60a9017d9d14e609e53d0981e81d6135c925a0d3e13

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