diff --git a/tts/text/sequencing/english_symbols_v1.py b/tts/text/sequencing/english_symbols_v1.py index df4753a..d064316 100644 --- a/tts/text/sequencing/english_symbols_v1.py +++ b/tts/text/sequencing/english_symbols_v1.py @@ -1,14 +1,23 @@ -"""Adapted from https://github.com/keithito/tacotron """ +""" +Originally adapted from https://github.com/keithito/tacotron -''' -Defines the set of symbols used in text input to the model. +This defines the set of symbols used in text input to the model. + +This is the set of character encodings that FakeYou and UberDuck models have +been trained on. We freeze it here as "V1", because these may change in future +notebooks. + +Original documentation: + The default is a set of ASCII characters that works well for English or + text that has been run through Unidecode. For other data, you can modify + _characters. See TRAINING_DATA.md for details. +""" -The default is a set of ASCII characters that works well for English or text that has been run through Unidecode. -For other data, you can modify _characters. See TRAINING_DATA.md for details. -''' from tts.text.phonetization import cmudict from typing import List +# NB: DO NOT CHANGE THE ORDER OF SYMBOLS! +# Models are trained on and depend upon the order. _pad = '_' _punctuation = '!\'(),.:;? ' #NB: Includes space _special = '-' diff --git a/tts/text/sequencing/test_english_symbols_v1.py b/tts/text/sequencing/test_english_symbols_v1.py index 00b4438..6c9e71c 100644 --- a/tts/text/sequencing/test_english_symbols_v1.py +++ b/tts/text/sequencing/test_english_symbols_v1.py @@ -11,13 +11,19 @@ class TestEnglishSymbols: assert output == [] def test_arpabet_word(self): + # NB: Models are trained on these integer encodings. + # If these tests break, the order of symbols may have changed. output = arpabet_to_sequence('T EH1 S T') assert output == [133, 94, 131, 133] def test_grapheme_word(self): + # NB: Models are trained on these integer encodings. + # If these tests break, the order of symbols may have changed. output = symbols_to_sequence('test') assert output == [57, 42, 56, 57] def test_grapheme_sentence(self): + # NB: Models are trained on these integer encodings. + # If these tests break, the order of symbols may have changed. output = symbols_to_sequence('this is a test.') assert output == [57, 45, 46, 56, 11, 46, 56, 11, 38, 11, 57, 42, 56, 57, 7] \ No newline at end of file