prosodylab / Prosodylab-Aligner

Python interface for forced audio alignment using HTK and SoX
http://prosodylab.org/tools/aligner/
MIT License
331 stars 77 forks source link

Unknown phone in dictionary (dictionary.txt), line 45710: "EY" #13

Closed jamiebullock closed 10 years ago

jamiebullock commented 10 years ago

Hi,

Regardless of the input wav / lab files I use with ./align_ex.sh the aligner fails with the above error message.

jamiebullock commented 10 years ago

Actually, there are a number of lines that cause a problem, see below:

localhost:Prosodylab-Aligner jamie$ ./align_ex.sh ~/Desktop/Alignment/test/test.wav ~/Desktop/Alignment/test/test.lab
Initializing...Error: Unknown phone in dictionary (dictionary.txt), line 46915: "IY" (did you want to train a new acoustic model? If so, use the -t flag).
Alignment failed.
localhost:Prosodylab-Aligner jamie$ ./align_ex.sh ~/Desktop/Alignment/test/test.wav ~/Desktop/Alignment/test/test.lab
Initializing...Error: Unknown phone in dictionary (dictionary.txt), line 46915: "IY" (did you want to train a new acoustic model? If so, use the -t flag).
Alignment failed.
localhost:Prosodylab-Aligner jamie$ ./align_ex.sh ~/Desktop/Alignment/test/test.wav ~/Desktop/Alignment/test/test.lab
Initializing...Error: Unknown phone in dictionary (dictionary.txt), line 95894: "AA" (did you want to train a new acoustic model? If so, use the -t flag).
Alignment failed.
kylebgorman commented 10 years ago

As the message says, those phones are not part of the built-in model. It sounds like you're using a dictionary without stress information ('IY' is out of vocabulary because it has to be 'IY1', 'IY2', or 'IY0'). The model it ships with uses stress levels from the CMU dictionary. If you want to ignore stress, you have to train your own model.

On Feb 20, 2014, at 8:10 AM, Jamie Bullock notifications@github.com wrote:

Actually, there are a number of lines that cause a problem, see below:

localhost:Prosodylab-Aligner jamie$ ./align_ex.sh ~/Desktop/Alignment/test/test.wav ~/Desktop/Alignment/test/test.lab Initializing...Error: Unknown phone in dictionary (dictionary.txt), line 46915: "IY" (did you want to train a new acoustic model? If so, use the -t flag). Alignment failed. localhost:Prosodylab-Aligner jamie$ ./align_ex.sh ~/Desktop/Alignment/test/test.wav ~/Desktop/Alignment/test/test.lab Initializing...Error: Unknown phone in dictionary (dictionary.txt), line 46915: "IY" (did you want to train a new acoustic model? If so, use the -t flag). Alignment failed. localhost:Prosodylab-Aligner jamie$ ./align_ex.sh ~/Desktop/Alignment/test/test.wav ~/Desktop/Alignment/test/test.lab Initializing...Error: Unknown phone in dictionary (dictionary.txt), line 95894: "AA" (did you want to train a new acoustic model? If so, use the -t flag). Alignment failed. \ Reply to this email directly or view it on GitHub.

jamiebullock commented 10 years ago

I am just using the dictionary downloaded by your ./get_dict.sh script.

localhost:dict jamie$ ./get_dict.sh 
localhost:dict jamie$ grep -w IY dictionary.txt
GERE G IH1 R IY
GERE JH IH1 R IY
localhost:dict jamie$ grep -w EY dictionary.txt
GAMEPLAY G EY1 M P L EY
localhost:dict jamie$ grep -w AA dictionary.txt
QUAFF K W AA F
kylebgorman commented 10 years ago

That downloads a dictionary with stress information…that can’t be the source of the issue. By any chance did you add some new words to the dictionary? If so, make sure that every vowel in the dictionary must have a stress number, 0, 1, or 2. If a vowel phoneme does not have a number, you will get this error (you will get the same error if you just make up a new phone).

You may also note that get_dict.sh has a special case for the word “Arabia”. That is because there is an error in the CMU dictionary whereby it’s transcribed

AH R EY1 B IY0 AH0

There should be a stress number on that first AH, like so:

AH0 R EY1 B IY0 AH0

As far as I know, that’s the only vowel that has that error in CMU. (I haven’t reported it upstream as they don’t seem to have an issue tracker by which to do so.)

If you want to perform alignment without stress information, you’ll need to train your own model.

An earlier version did not do this check. Consequently, if the check for in-vocabularly phones would have failed, HTK would error out with an inexplicable error message; at least now the error message is informative.

On Feb 20, 2014, at 9:33 AM, Jamie Bullock notifications@github.com wrote:

I am just using the dictionary downloaded by your ./get_dict.sh script.

— Reply to this email directly or view it on GitHub.

kylebgorman commented 10 years ago

Oh, I see. For some reason the email version of this didn't contain your bit of code there.

Those are other unfortunate error in the CMU dictionary, which must have been added since I wrote the script. Rather than spending my time adding special cases for bugs in the CMU dictionary, I'm just going to preserve a copy of it in this repository and deprecate that script. Thanks for reporting this.