Kyubyong / g2p

g2p: English Grapheme To Phoneme Conversion
Apache License 2.0
790 stars 128 forks source link

What is each phoneme in IPA terms? #29

Open obones opened 2 years ago

obones commented 2 years ago

Describing the pronunciation of words is usually done using the International Phonetic Alphabet (IPA) which uses Unicode characters. However, this package outputs ASCII character and there exists multiple mappings from Unicode IPA to ASCII. Which one are you using?

The readme file says you are using The CMU Pronouncing Dictionary, which in turns says it's based upon ARPABET. Can I thus safely assume you are using this subset of ARPABET for all results?

iamanigeeit commented 1 year ago

@obones I'm using this conversion for my own work. (UW without any number seems to be a mistake -- CMU dictionary does not have any entry with UW)

{
'<pad>': '<pad>',
'<unk>': '<unk>',
'<s>': '<s>',
'</s>': '</s>',
'AA0': 'ɑ',
'AA1': 'ˈɑː',
'AA2': 'ˌɑ',
'AE0': 'æ',
'AE1': 'ˈæ',
'AE2': 'ˌæ',
'AH0': 'ə',
'AH1': 'ˈʌ',
'AH2': 'ˌʌ',
'AO0': 'ɔ',
'AO1': 'ˈɔː',
'AO2': 'ˌɔ',
'AW0': 'aʊ',
'AW1': 'ˈaʊ',
'AW2': 'ˌaʊ',
'AY0': 'aɪ',
'AY1': 'ˈaɪ',
'AY2': 'ˌaɪ',
'B': 'b',
'CH': 'tʃ',
'D': 'd',
'DH': 'ð',
'EH0': 'ɛ',
'EH1': 'ˈɛ',
'EH2': 'ˌɛ',
'ER0': 'ɚ',
'ER1': 'ˈɚ',
'ER2': 'ˌɚ',
'EY0': 'eɪ',
'EY1': 'ˈeɪ',
'EY2': 'ˌeɪ',
'F': 'f',
'G': 'g',
'HH': 'h',
'IH0': 'ɪ',
'IH1': 'ˈɪ',
'IH2': 'ˌɪ',
'IY0': 'i',
'IY1': 'ˈi:',
'IY2': 'ˌi',
'JH': 'dʒ',
'K': 'k',
'L': 'l',
'M': 'm',
'N': 'n',
'NG': 'ŋ',
'OW0': 'oʊ',
'OW1': 'ˈoʊ',
'OW2': 'ˌoʊ',
'OY0': 'ɔɪ',
'OY1': 'ˈɔɪ',
'OY2': 'ˌɔɪ',
'P': 'p',
'R': 'ɹ',
'S': 's',
'SH': 'ʃ',
'T': 't',
'TH': 'θ',
'UH0': 'ʊ',
'UH1': 'ˈʊ',
'UH2': 'ˌʊ',
# 'UW': 'u:',
'UW0': 'u',
'UW1': 'ˈuː',
'UW2': 'ˌu',
'V': 'v',
'W': 'w',
'Y': 'j',
'Z': 'z',
'ZH': 'ʒ',
}
alope107 commented 9 months ago

@iamanigeeit Thanks so much, this was incredibly helpful! There are a few small typos in your dictionary though, where very a very similar looking character like ":" is used instead of "ː". For anyone else wanting to use this, here's a version without the typos:

{
    '<pad>': '<pad>',
    '<unk>': '<unk>',
    '<s>': '<s>',
    '</s>': '</s>',
    'AA0': 'ɑ',
    'AA1': 'ˈɑː',
    'AA2': 'ˌɑ',
    'AE0': 'æ',
    'AE1': 'ˈæ',
    'AE2': 'ˌæ',
    'AH0': 'ə',
    'AH1': 'ˈʌ',
    'AH2': 'ˌʌ',
    'AO0': 'ɔ',
    'AO1': 'ˈɔː',
    'AO2': 'ˌɔ',
    'AW0': 'aʊ',
    'AW1': 'ˈaʊ',
    'AW2': 'ˌaʊ',
    'AY0': 'aɪ',
    'AY1': 'ˈaɪ',
    'AY2': 'ˌaɪ',
    'B': 'b',
    'CH': 'tʃ',
    'D': 'd',
    'DH': 'ð',
    'EH0': 'ɛ',
    'EH1': 'ˈɛ',
    'EH2': 'ˌɛ',
    'ER0': 'ɚ',
    'ER1': 'ˈɚ',
    'ER2': 'ˌɚ',
    'EY0': 'eɪ',
    'EY1': 'ˈeɪ',
    'EY2': 'ˌeɪ',
    'F': 'f',
    'G': 'g',
    'HH': 'h',
    'IH0': 'ɪ',
    'IH1': 'ˈɪ',
    'IH2': 'ˌɪ',
    'IY0': 'i',
    'IY1': 'ˈiː',
    'IY2': 'ˌi',
    'JH': 'dʒ',
    'K': 'k',
    'L': 'l',
    'M': 'm',
    'N': 'n',
    'NG': 'ŋ',
    'OW0': 'oʊ',
    'OW1': 'ˈoʊ',
    'OW2': 'ˌoʊ',
    'OY0': 'ɔɪ',
    'OY1': 'ˈɔɪ',
    'OY2': 'ˌɔɪ',
    'P': 'p',
    'R': 'ɹ',
    'S': 's',
    'SH': 'ʃ',
    'T': 't',
    'TH': 'θ',
    'UH0': 'ʊ',
    'UH1': 'ˈʊ',
    'UH2': 'ˌʊ',
#    'UW': 'uː',
    'UW0': 'u',
    'UW1': 'ˈuː',
    'UW2': 'ˌu',
    'V': 'v',
    'W': 'w',
    'Y': 'j',
    'Z': 'z',
    'ZH': 'ʒ',
}