Thank you guys for reply me. The reason i want to reinitialize the decoder is that i want to use different set of models, dictionary and even lm file.
I want to change the decoder so that i can reconfigure to decode another language.
I have try with activex module that is provided in sphinx2 but it seems can't be used to reinitilize. I even try to load two piece of activex and it still give me the same result. The only thing that i can do with the decoder is to completely shuts my program down and start another piece of my program.
So, is there anything that i can do with this decoder so that it can decode two different language in a program at seperate time without having to restart this program?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With sphinx-2, you can load a language model dynamically (or, alternatively, load a set of LMs at start up and then switch between them dynamically), and you can add words to a dictionary, but you can't switch acoustic models.
A possible solution is to create a set of acoustic models that works for all your languages, possibly using unique symbols for each language, and a dictionary that can be used for all languages, including words from all languages.
You'd then switch the LMs as the language switches. The search is performed taking into account words that are present in both LM and dictionary. So, by having language-specific LMs, you end up limiting the words from the dictionary to only those that belong to the language (since only these words also appear in the LM).
You can load an n-gram LM on the fly with lm_read, from lm_3g.c, and you can set the LM to a specific with uttproc_set_lm (in uttproc.c). There are similar functions for loading ans switching an FSG.
--Evandro
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Train models for different language, using different set of phone set for each language.
Load all the phone set HMM models, common dictionary for all language, few LM files (one language each) during decoder initialization.
Set active LM files when want to switch between language.
I think this will work with my decoder, but the only thing i am concern is the search tree. If we train language with different phoneset, there will be more HMM models and this will increase the search tree. Will this slows down the decoder, or even reduce the accuracy?
Anyway, i will give it a try. Thanks for your idea.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Why do you want to stop and reload the decoder? I wouldn't be terribly surprised if that caused significant resource leaks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2005-05-17
We found that the Sphinx2 decoder was not really designed to be reinitialized, and we had to make considerable modifications to the code to allow this to be done -- sorry that I can't be more specific, but that was two jobs ago. The primary changes were to free allocated memory before reinitializing, but there may have been other changes in addition.
In our case, the reason for needing to do this was to switch dictionaries and/or acoustic models. In Sphinx2, these are loaded during initialization, and the structure of the decoder does not permit them to be changed thereafter.
cheers,
jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Anyone know how to reload sphinx2 decoder? I try to use:
cont_ad_close (cont);
fbs_end ();
ad_close (ad);
to end the current decoder but when i start another copy of decoder, it will fail at
fbs_init();
ad_open_sps(16000) <---- Fail here
did i miss something?
Thank you guys for reply me. The reason i want to reinitialize the decoder is that i want to use different set of models, dictionary and even lm file.
I want to change the decoder so that i can reconfigure to decode another language.
I have try with activex module that is provided in sphinx2 but it seems can't be used to reinitilize. I even try to load two piece of activex and it still give me the same result. The only thing that i can do with the decoder is to completely shuts my program down and start another piece of my program.
So, is there anything that i can do with this decoder so that it can decode two different language in a program at seperate time without having to restart this program?
With sphinx-2, you can load a language model dynamically (or, alternatively, load a set of LMs at start up and then switch between them dynamically), and you can add words to a dictionary, but you can't switch acoustic models.
A possible solution is to create a set of acoustic models that works for all your languages, possibly using unique symbols for each language, and a dictionary that can be used for all languages, including words from all languages.
You'd then switch the LMs as the language switches. The search is performed taking into account words that are present in both LM and dictionary. So, by having language-specific LMs, you end up limiting the words from the dictionary to only those that belong to the language (since only these words also appear in the LM).
You can load an n-gram LM on the fly with lm_read, from lm_3g.c, and you can set the LM to a specific with uttproc_set_lm (in uttproc.c). There are similar functions for loading ans switching an FSG.
--Evandro
Hi
I think i get what you mean here.
Train models for different language, using different set of phone set for each language.
Load all the phone set HMM models, common dictionary for all language, few LM files (one language each) during decoder initialization.
Set active LM files when want to switch between language.
I think this will work with my decoder, but the only thing i am concern is the search tree. If we train language with different phoneset, there will be more HMM models and this will increase the search tree. Will this slows down the decoder, or even reduce the accuracy?
Anyway, i will give it a try. Thanks for your idea.
Why do you want to stop and reload the decoder? I wouldn't be terribly surprised if that caused significant resource leaks.
We found that the Sphinx2 decoder was not really designed to be reinitialized, and we had to make considerable modifications to the code to allow this to be done -- sorry that I can't be more specific, but that was two jobs ago. The primary changes were to free allocated memory before reinitializing, but there may have been other changes in addition.
In our case, the reason for needing to do this was to switch dictionaries and/or acoustic models. In Sphinx2, these are loaded during initialization, and the structure of the decoder does not permit them to be changed thereafter.
cheers,
jerry