parler-tts icon indicating copy to clipboard operation
parler-tts copied to clipboard

Trouble pronouncing dates

Open Kredithaichen opened this issue 9 months ago • 4 comments

I found that the model (here: the Jenny model, but I found the same issue with ParlerTTS mini) seems to have trouble pronouncing years and numbers. For example:

"The Crusaders marched through Eastern Europe, gathering support and supplies along the way, before reaching Constantinople in 1097."

https://github.com/huggingface/parler-tts/assets/31171070/a7f4c014-c8f0-4b07-b238-dd68d386bcaa

Kredithaichen avatar Apr 26 '24 11:04 Kredithaichen

Hey @Kredithaichen, I'll add this to the README soon, but I just pushed a PR in the demo that shows how to correct number issues using a prompt normalizer: https://huggingface.co/spaces/parler-tts/parler_tts_mini/commit/a07119c35ecef98bd7c016b86ff71dfdc102d8b2

Let me know if it helps!

ylacombe avatar Apr 26 '24 12:04 ylacombe

@ylacombe Thanks for the swift response! Your changes fixed the issue for numbers in general, such that they are now clearly understandable. The model does not, however, recognize it as a year, so if I prompt:

"The Crusaders marched through Eastern Europe, gathering support and supplies along the way, before reaching Constantinople in 1397."

It says 'One-thousand three-hundred ninety-seven', rather than 'thirteen-hundred ninety-seven'. Do you happen to know of any library that could fix this or would I need to replace to replace the number outright with text in a 'historic date' style?

Kredithaichen avatar Apr 26 '24 12:04 Kredithaichen

@Kredithaichen just use the number to text conversion $ pip install inflect

import inflect p = inflect.engine() p.number_to_words(1234567) 'one million, two hundred and thirty-four thousand, five hundred and sixty-seven'

atulpokharel001 avatar May 02 '24 18:05 atulpokharel001

@atulpokharel001 wouldn't that make the year '1984' into 'one thousand nine hundred and eighty four'?

platform-kit avatar May 02 '24 19:05 platform-kit