A python package for text standardisation/normalization. It uses normalization algorithm mentioned in OpenAI whisper paper. Using Whisper normalization can cause issues in Indic languages and other low resource languages when using BasicTextNormalizer. So normalization in Indic languages is also implemented in this package which was derived from indic-nlp-library.
This package is a python implementation of the text standardisation/normalization approach which is being used in OpenAI whisper. The code was originally being released as open-source in Whisper source code. More details about the text normalization approach used by whisper can be found on Appendix Section C pp.21 the paper Robust Speech Recognition via Large-Scale Weak Supervision by OpenAI team.
In ASR systems it’s important to normalize the text to reduce unintentional penalties in metrics like WER, CER etc.
Text normalization/standardization is process of converting texts in different styles into a standardized form, which is a best-effort attempt to penalize only when a word error is caused by actually mistranscribing a word, and not by formatting or punctuation differences.(from Whisper paper)
Why use this python package?
This package is a python implementation of the text standardisation/normalization approach which is being used in OpenAI whisper text normalizer. If you want to use just text normalization alone, it’s better to use this instead reimplementing the same thing. OpenAI approach of text normalization is very helpful and is being used as normalization step when evaluating competitive models like AssemblyAI Conformer-1 model.
Models evaluated using Whisper normalization
OpenAI Whisper
Massively Multilingual Speech (MMS) models by Meta
You can use the same thing in this package as follows:
from whisper_normalizer.english import EnglishTextNormalizerenglish_normalizer = EnglishTextNormalizer()english_normalizer("I'm a little teapot, short and stout. Tip me over and pour me out!")
'i am a little teapot short and stout tip me over and pour me out'
from whisper_normalizer.basic import BasicTextNormalizernormalizer = BasicTextNormalizer()normalizer("I'm a little teapot, short and stout. Tip me over and pour me out!")
'i m a little teapot short and stout tip me over and pour me out '
Using BasicTextNormalizer in your mother tongue might be a bad idea
This model extends Whisper_normalizer to support Indic languages as well.
The logic for normalization in Indic languages is derived from indic-nlp-library. The logic for Malayalam normalization is expanded beyond the Indic NLP library by MalayalamNormalizer.
from whisper_normalizer.indic_normalizer import MalayalamNormalizernormalizer = MalayalamNormalizer()normalizer("എന്റെ കമ്പ്യൂട്ടറിനു് എന്റെ ഭാഷ.")