Feature/malayalam normalizer#161
Open
spigelspike wants to merge 2 commits into
Open
Conversation
Add built-in Malayalam (ml) text normalization that automatically converts numbers, currency (?), percentages (%), time, decimals, fractions, ordinals, acronyms, and measurement units into their Malayalam spoken-word equivalents during TTS preprocessing.
Adds support for multiple global currencies including Dollars ($), Pounds (£), Euros (€), Yen (¥), and alternative Rupee formats (Rs, Rs.) in both prefix and suffix positions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds text normalization for Malayalam (
language="ml"). Numbers, currency symbols, time, percentages, etc. get converted to spoken Malayalam words before the text hits the tokenizer.Without this, the model tries to pronounce raw symbols like
₹,%,5:30which sounds broken.Examples
₹250ഇരുനൂറ്റി അമ്പത് രൂപ5:30അഞ്ച് മുപ്പത്AICTEഎ ഐ സി ടി ഇ10.5പത്ത് പോയിന്റ് അഞ്ച്1/2അര1stഒന്നാമത്തെ$100നൂറ് ഡോളർ10kmപത്ത് കിലോമീറ്റർFiles changed
omnivoice/utils/text_normalization/__init__.py— language dispatcheromnivoice/utils/text_normalization/malayalam.py— the normalizeromnivoice/models/omnivoice.py— callsnormalize_text()inside_preprocess_all(), guarded by language check so other languages are unaffectedtests/test_malayalam_normalizer.py— 58 testsdocs/tips.md— added a note about this featureAudio samples (before/after)
Test 1:
"എന്റെ കയ്യിൽ $100 ഉം Rs. 50 ഉം ഉണ്ട്. ഇതിന് £200 വിലവരും."Test 2:
"എനിക്ക് ₹100 ഉണ്ട്, സമയം 5:30 ആയി. AICTE മോഡൽ 10.5 സ്കോർ നേടി. 1/2 ലിറ്റർ പാലും 1st പ്രൈസും കിട്ടി"