CoolFace
Apppublic

hanfish/LSai

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
__init__.py16 linesDownload Raw Back to text
1from text.symbols import *2 3 4_symbol_to_id = {s: i for i, s in enumerate(symbols)}5 6def cleaned_text_to_sequence(cleaned_text):7  '''Converts a string of text to a sequence of IDs corresponding to the symbols in the text.8    Args:9      text: string to convert to a sequence10    Returns:11      List of integers corresponding to the symbols in the text12  '''13  phones = [_symbol_to_id[symbol] for symbol in cleaned_text]14  return phones15 16