I recently trained a model called "commands" with Sphinx Train. I have followed the directions here: http://cmusphinx.sourceforge.net/sphinx4/doc/UsingSphinxTrainModels.html
to use them with Sphinx 4. I have just edited the helloworld demo to do this. When I use build.xml to run, however, Netbeans responds with the following:
all:
Compiling 1 source file to C:\sphinx4\sphinx4-1.0beta\bld\classes
run:
Loading...
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 123, Size: 123
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at edu.cmu.sphinx.linguist.acoustic.tiedstate.Pool.get(Pool.java:60)
at edu.cmu.sphinx.model.acoustic.commands.ModelLoader.getSenoneSequence(ModelLoader.java:1260)
at edu.cmu.sphinx.model.acoustic.commands.ModelLoader.loadHMMPool(ModelLoader.java:1216)
at edu.cmu.sphinx.model.acoustic.commands.ModelLoader.loadModelFiles(ModelLoader.java:564)
at edu.cmu.sphinx.model.acoustic.commands.ModelLoader.load(ModelLoader.java:476)
at edu.cmu.sphinx.model.acoustic.commands.Model.allocate(Model.java:177)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.allocateAcousticModel(FlatLinguist.java:336)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.allocate(FlatLinguist.java:318)
at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.allocate(SimpleBreadthFirstSearchManager.java:602)
at edu.cmu.sphinx.decoder.Decoder.allocate(Decoder.java:109)
at edu.cmu.sphinx.recognizer.Recognizer.allocate(Recognizer.java:182)
at demo.sphinx.helloworld.HelloWorld.main(HelloWorld.java:54)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
I made a few extra changes that the website didn't mention just to get it this far. I can post the files that I changed if needed. Can anyone identify what is causing this error? Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hm, microphone pipeline also include datablocker in original demo. Probably it's the case. Can you please follow the demo more precisely. Also please paste model.props.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm sorry. I haven't been able to find anything about a microphone pipeline or datablocker anywhere in the demo file. s. What exactly are you referring to?
> I'm sorry. I haven't been able to find anything about a microphone pipeline or datablocker anywhere in the demo file. s. What exactly are you referring to?
It must be different in the sphinx4-1.0beta-src.zip file on SourceForge. I got it via svn, but I'm having trouble setting it up in Netbeans now. There are no com, edu, and demo folders in $SPHINX_ROOT anymore. Where do I find these to add them to the source/test package folders?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
indeed, the directory structure has been changed since s4b1. You need to add all subfolders (excluding 'demo') of the src-folder and the src-folder itself as source-folders in netbeans.
@nshmyrev: What do you think: Should we move the demo folder to an own subfolder? The current state is not nice because the demo-folder is already part of the demo-class-package which leads to the strange procedure of adding children of 'src' and 'src' itself as source-folders.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm all for structure simplification. For example in eclipse current view is very confusing - it shows src folder, src/sphinx4 subfolder and organization of packages is not clear. At least we can remove empty extras folder (in svn you can do it :)) The reason of separation of demos on jsapi and sphinx is not clear for me too.
About original problem, of course it's better to work with trunk, the corresponding code seems missing now. But it seems it's not related to config but to the model itself. Number of tied states is not correct probably, what about state number 123 there? ldb88, can you please give a link to mdef file from a model? Better send me the model jar, by mail for example.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) You are using context dependent mdef cd_cont.1000.mdef with context independant means and variances. In model props use ci_cont mdef, it will work fine. also set correct number of gaussians (I suppose it's 1 for ci).
2) For US English there is no sense to train your own model, use wsj instead. You won't get better performance unless you have enormous amount of data.
3) Even if you decided to train, either use more states or use smaller phonetic units (syllables or phones). If you are using unique or big units like syllables or words, do not train context dependant models, they are senseless. Use ci models instead.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I recently trained a model called "commands" with Sphinx Train. I have followed the directions here:
http://cmusphinx.sourceforge.net/sphinx4/doc/UsingSphinxTrainModels.html
to use them with Sphinx 4. I have just edited the helloworld demo to do this. When I use build.xml to run, however, Netbeans responds with the following:
all:
Compiling 1 source file to C:\sphinx4\sphinx4-1.0beta\bld\classes
run:
Loading...
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 123, Size: 123
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at edu.cmu.sphinx.linguist.acoustic.tiedstate.Pool.get(Pool.java:60)
at edu.cmu.sphinx.model.acoustic.commands.ModelLoader.getSenoneSequence(ModelLoader.java:1260)
at edu.cmu.sphinx.model.acoustic.commands.ModelLoader.loadHMMPool(ModelLoader.java:1216)
at edu.cmu.sphinx.model.acoustic.commands.ModelLoader.loadModelFiles(ModelLoader.java:564)
at edu.cmu.sphinx.model.acoustic.commands.ModelLoader.load(ModelLoader.java:476)
at edu.cmu.sphinx.model.acoustic.commands.Model.allocate(Model.java:177)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.allocateAcousticModel(FlatLinguist.java:336)
at edu.cmu.sphinx.linguist.flat.FlatLinguist.allocate(FlatLinguist.java:318)
at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.allocate(SimpleBreadthFirstSearchManager.java:602)
at edu.cmu.sphinx.decoder.Decoder.allocate(Decoder.java:109)
at edu.cmu.sphinx.recognizer.Recognizer.allocate(Recognizer.java:182)
at demo.sphinx.helloworld.HelloWorld.main(HelloWorld.java:54)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
I made a few extra changes that the website didn't mention just to get it this far. I can post the files that I changed if needed. Can anyone identify what is causing this error? Thanks.
Hm, looks rather strange. Can you share yor files or at least your configuration file.
Here is my configuration file. The name of the acoustic model is "commands", so the associated .jar file is "commands.jar".
<?xml version="1.0" encoding="UTF-8"?>
<!--
Sphinx-4 Configuration file
-->
<!-- ******** -->
<!-- an4 configuration file -->
<!-- ******** -->
<config>
</config>
Here is build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="The hello world demo.">
<description>
This file is used to run the hello world demo.
NOTE: Before running the tests, you must have already built
the sphinx-4 sources by typing "ant" in the top level
sphinx4 directory.
</description>
</project>
And finally the manifest:
Main-Class: demo.sphinx.helloworld.HelloWorld
Class-Path: ../lib/sphinx4.jar ../lib/jsapi.jar ../lib/commands.jar
HelloWorld.java is unchanged. Any ideas? Thanks.
Hm, microphone pipeline also include datablocker in original demo. Probably it's the case. Can you please follow the demo more precisely. Also please paste model.props.
I'm sorry. I haven't been able to find anything about a microphone pipeline or datablocker anywhere in the demo file. s. What exactly are you referring to?
Here is my model.props file:
description = commands acoustic models
modelClass = edu.cmu.sphinx.model.acoustic.commands.Model
modelLoader = edu.cmu.sphinx.model.acoustic.commands.ModelLoader
dataLocation = commands.ci_cont
modelDefinition = etc/commands.1000.mdef
isBinary = true
featureType = ls_c_d_dd
vectorLength = 39
sparseForm = false
numberFftPoint = 512
numberFilters = 40
gaussians = 8
minimumFrequency = 133.33334
maximumFrequency = 6855.4976
sampleRate = 16000
I set these values as best I could determine from SphinxTrain's make_feats.pl file, which I ran before running the RunAll.pl script.
Also, I recently made some hardware changes, leading to my microphone no longer working (I'm working on a fix). Could this be the problem?
Thanks.
> I'm sorry. I haven't been able to find anything about a microphone pipeline or datablocker anywhere in the demo file. s. What exactly are you referring to?
http://cmusphinx.svn.sourceforge.net/viewvc/cmusphinx/trunk/sphinx4/src/demo/sphinx/helloworld/helloworld.config.xml?revision=6346&view=markup
line 169
It must be different in the sphinx4-1.0beta-src.zip file on SourceForge. I got it via svn, but I'm having trouble setting it up in Netbeans now. There are no com, edu, and demo folders in $SPHINX_ROOT anymore. Where do I find these to add them to the source/test package folders?
Hi,
indeed, the directory structure has been changed since s4b1. You need to add all subfolders (excluding 'demo') of the src-folder and the src-folder itself as source-folders in netbeans.
@nshmyrev: What do you think: Should we move the demo folder to an own subfolder? The current state is not nice because the demo-folder is already part of the demo-class-package which leads to the strange procedure of adding children of 'src' and 'src' itself as source-folders.
I'm all for structure simplification. For example in eclipse current view is very confusing - it shows src folder, src/sphinx4 subfolder and organization of packages is not clear. At least we can remove empty extras folder (in svn you can do it :)) The reason of separation of demos on jsapi and sphinx is not clear for me too.
About original problem, of course it's better to work with trunk, the corresponding code seems missing now. But it seems it's not related to config but to the model itself. Number of tied states is not correct probably, what about state number 123 there? ldb88, can you please give a link to mdef file from a model? Better send me the model jar, by mail for example.
Here is a link to the .jar file:
http://rapidshare.com/files/84626619/commands.jar.html
Thanks.
Oh, well, now it's clear.
1) You are using context dependent mdef cd_cont.1000.mdef with context independant means and variances. In model props use ci_cont mdef, it will work fine. also set correct number of gaussians (I suppose it's 1 for ci).
2) For US English there is no sense to train your own model, use wsj instead. You won't get better performance unless you have enormous amount of data.
3) Even if you decided to train, either use more states or use smaller phonetic units (syllables or phones). If you are using unique or big units like syllables or words, do not train context dependant models, they are senseless. Use ci models instead.