Text Preprocessing for TTS
What you'll learn: How to transform raw text into clean, speech-ready input that makes your TTS system sound natural and accurate.
Why Text Preprocessing Matters
Before feeding text to a TTS model, you must normalize it into a form the model can pronounce correctly. Raw text is messy—it contains abbreviations like "Dr.", numbers like "1234", symbols like "50" as "dee-are-dot Smith paid dollar fifty zero" instead of "Doctor Smith paid fifty dollars."
Core Preprocessing Tasks
Abbreviation Expansion
Convert "Mr.", "Inc.", "etc." into their full forms: "Mister," "Incorporated," "etcetera." Context matters—"St." could be "Street" or "Saint" depending on usage.
Number Normalization
Transform digits into speakable words:
- Currency: "$42.99" → "forty-two dollars and ninety-nine cents"
- Dates: "12/25/2024" → "December twenty-fifth, twenty twenty-four"
- Ordinals: "1st" → "first"
- Decimal points: "3.14" → "three point one four"
Special Character Handling
Replace or expand symbols:
- "&" → "and"
- "%" → "percent"
- "@" → "at"
- "#" → "number" or "hashtag" (context-dependent)
Case and Whitespace
Normalize capitalization for acronyms (NASA vs. nasa) and clean extra spaces, tabs, or line breaks that might confuse pronunciation.
The Pipeline Flow
Think of preprocessing as translation: you're converting written shorthand into how a human would actually say it aloud. This step happens before the TTS model sees the text, ensuring consistent, high-quality speech output.
Key Takeaway: Text preprocessing transforms raw, ambiguous written text into clean, unambiguous speakable text by expanding abbreviations, converting numbers to words, and handling special characters—making TTS output sound natural and accurate.