The Sphinx2 documentation states that I can change language models and update the dictionary while it is running. Extracted from the manual:
The recognition engine can be recognfigured in several ways, but generally only in between utterances:
The active language model can be switched in between utterances.
New words and their pronunciations can be added to the dictionary in between utterances. The words are automatically added to the unnamed language model as unigrams. (This is a HACK. There ought to be a mechanism for adding a word to a specified language model.)
How do you go about doing this? Do I just have to insert the new pronunciations into the .dic file? How do I create pronunciations from text input? Is there a tool in place to perform this?
Thanks in advance,
Steve
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-07-10
Language models can be manipulated easily. You can use lm_read() to read in new language models at run time, and uttproc_set_lm() to select one of the loaded LMs.
But the words in any LMs you load must _already_ be in the in-core dictionary*. This dictionary is loaded as one of the very first steps of Sphinx2 initialization. Although it's not mentioned in the Application Programming Interface section in the Sphinx-II User Guide, there is a function dict_add_word() in dict.c that allows you to load new words at run time, but there's a limited number of slots available for new words, and these words aren't incorporated into the right/left context tables in quite the same way that the main dictionary words are. So you'll need to read and understand the comments in that function to understand its limitations.
Creating pronunciations for new words is generally done manually, using knowledge of the 43 or so phonetic symbols in the default acoustic model (or however many you have in an AM that you may have trained yourself). I don't know of any tools for doing this automatically.
IMHO, Sphinx2 wasn't designed for adding words after initialization. dict_add_word() appears to have been added to cater to some specific and limited need, not for general use. I hope this helps.
cheers,
jerry
* If they are not, the LM will still load and will be functional, _except_ that the absent word(s) will be non-functional -- will never be able to be recognized.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yet another question...
The Sphinx2 documentation states that I can change language models and update the dictionary while it is running. Extracted from the manual:
The recognition engine can be recognfigured in several ways, but generally only in between utterances:
The active language model can be switched in between utterances.
New words and their pronunciations can be added to the dictionary in between utterances. The words are automatically added to the unnamed language model as unigrams. (This is a HACK. There ought to be a mechanism for adding a word to a specified language model.)
How do you go about doing this? Do I just have to insert the new pronunciations into the .dic file? How do I create pronunciations from text input? Is there a tool in place to perform this?
Thanks in advance,
Steve
Language models can be manipulated easily. You can use lm_read() to read in new language models at run time, and uttproc_set_lm() to select one of the loaded LMs.
But the words in any LMs you load must _already_ be in the in-core dictionary*. This dictionary is loaded as one of the very first steps of Sphinx2 initialization. Although it's not mentioned in the Application Programming Interface section in the Sphinx-II User Guide, there is a function dict_add_word() in dict.c that allows you to load new words at run time, but there's a limited number of slots available for new words, and these words aren't incorporated into the right/left context tables in quite the same way that the main dictionary words are. So you'll need to read and understand the comments in that function to understand its limitations.
Creating pronunciations for new words is generally done manually, using knowledge of the 43 or so phonetic symbols in the default acoustic model (or however many you have in an AM that you may have trained yourself). I don't know of any tools for doing this automatically.
IMHO, Sphinx2 wasn't designed for adding words after initialization. dict_add_word() appears to have been added to cater to some specific and limited need, not for general use. I hope this helps.
cheers,
jerry
* If they are not, the LM will still load and will be functional, _except_ that the absent word(s) will be non-functional -- will never be able to be recognized.