mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-17 00:23:14 +00:00
update doc
This commit is contained in:
@@ -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]
|
||||
Reference in New Issue
Block a user