update doc

This commit is contained in:
Brandon Thomas
2022-07-02 14:58:49 -04:00
parent 8b4eb12497
commit 1bfc4f9959
2 changed files with 21 additions and 6 deletions
+15 -6
View File
@@ -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 = '-'
@@ -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]