Spaces:
Running
Running
File size: 1,849 Bytes
af3d42a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
punctuation = ["!", "?", "…", ",", ".", "'", "-"]
pu_symbols = punctuation + ["SP", "UNK"]
pad = "_"
# English
en_symbols = [
"aa",
"ae",
"ah",
"ao",
"aw",
"ay",
"b",
"ch",
"d",
"dh",
"eh",
"er",
"ey",
"f",
"g",
"hh",
"ih",
"iy",
"jh",
"k",
"l",
"m",
"n",
"ng",
"ow",
"oy",
"p",
"r",
"s",
"sh",
"t",
"th",
"uh",
"uw",
"V",
"w",
"y",
"z",
"zh",
]
num_en_tones = 4
# Cantonese
yue_symbols = [
"",
"aa",
"aai",
"aak",
"aam",
"aan",
"aang",
"aap",
"aat",
"aau",
"ai",
"ak",
"am",
"an",
"ang",
"ap",
"at",
"au",
"b",
"c",
"d",
"e",
"ei",
"ek",
"em",
"eng",
"eoi",
"eon",
"eot",
"ep",
"eu",
"f",
"g",
"gw",
"h",
"i",
"ik",
"im",
"in",
"ing",
"ip",
"it",
"iu",
"j",
"k",
"kw",
"l",
"m",
"m",
"n",
"ng",
"ng",
"o",
"oe",
"oek",
"oeng",
"oi",
"ok",
"on",
"ong",
"ot",
"ou",
"p",
"s",
"t",
"u",
"ui",
"uk",
"un",
"ung",
"ut",
"w",
"yu",
"yun",
"yut",
"z"
]
num_yue_tones = 7
# combine all symbols
normal_symbols = sorted(
set(en_symbols + yue_symbols))
symbols = [pad] + normal_symbols + pu_symbols
sil_phonemes_ids = [symbols.index(i) for i in pu_symbols]
# combine all tones
num_tones = num_en_tones + num_yue_tones
# language maps
language_id_map = {"EN": 0, "YUE": 1}
num_languages = len(language_id_map.keys())
language_tone_start_map = {
"EN": 0,
"YUE": num_en_tones,
}
if __name__ == "__main__":
a = set(yue_symbols)
b = set(en_symbols)
print(sorted(a & b))
|