问题
How to add my words to sphinx using java? Iam a new learner for learning sphinx,I just know how to use it.I want to learn adding my words.anybody can help me.
回答1:
Add the word to the dictionary file sphinx4/models/acoustic/wsj/dict/cmudict.0.6d:
ABACK AH B AE K
ABACO AE B AH K OW
ABACUS AE B AH K AH S
PINTREST P IH N T R EH S T
Then add the word to the grammar sphinx4/src/apps/edu/cmu/sphinx/demo/helloworld/hello.gram:
#JSGF V1.0;
grammar hello;
public = (Good morning | Hello) ( Bhiksha | Evandro | Paul | Philip | Rita | Will | Pintrest );
Recompile and run HelloWorld demo, it will understand a new word.
If the word is already in the dictionary, you can just add it to the grammar.
回答2:
If you want to add more words then you need to add them in dictionary file acoustic model.
Create a txt file “words.txt”, Write all the names of cities and states in it and save.
Open this link : http://www.speech.cs.cmu.edu/tools/lmtool.html
On that page, go to “Sentence corpus file:” section, Browse to “words.txt” file and click “Compile Knowledge Base”.
On next page, Click on “Dictionary” link and save that .DIC file.
Extract WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar file. Go to edu\cmu\sphinx\model\acoustic\WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz\dict folder.
Open “cmudict.0.6d” file in that folder Copy data from .DIC file, you have downloaded in PART ONE, paste it in “cmudict.0.6d” file and save. Zip the extracted hierarchy back as it was and Zip file named should be same as JAR file.
Change in gram file and reloading in sphinx
来源:https://stackoverflow.com/questions/18898126/how-to-add-words-to-sphinx