updated pipeline

This commit is contained in:
Plachta
2023-02-26 20:06:31 +08:00
parent cfa4cc9878
commit 5b228b39be
18 changed files with 1083 additions and 401 deletions
+3 -2
View File
@@ -30,14 +30,15 @@ def text_to_sequence(text, symbols, cleaner_names):
return sequence
def cleaned_text_to_sequence(cleaned_text):
def cleaned_text_to_sequence(cleaned_text, symbols):
'''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.
Args:
text: string to convert to a sequence
Returns:
List of integers corresponding to the symbols in the text
'''
sequence = [_symbol_to_id[symbol] for symbol in cleaned_text if symbol in _symbol_to_id.keys()]
symbol_to_id = {s: i for i, s in enumerate(symbols)}
sequence = [symbol_to_id[symbol] for symbol in cleaned_text if symbol in symbol_to_id.keys()]
return sequence