Java bits in Sphinx4

I spent some time converting sphinx4 to Java5, mostly changing the loops dropping iterators. I hope it will not just make the code cleaner but give us a few bits of performance.

Also tried to profile sphinx4 lattice code. It seems that I broke it by changing the default value for keepAllStates to true. With all HMM states left in a tree it's very hard to traverse the tree to create a lattice. Unfortunately TPTP profiler in Eclipse appeared to be very slow, looking for profiler now as well as on the way to solve this keepAllStates issue.

That change had another drawback, now we doing very unnatural work when we decide if stream is over. Currently scorer returns null on every SpeechEnd signal. It should also return null on DataEnd signal and that null should be different from the first one since we should stop the recognition only after DataEnd in case of long wav file transcription and continue after SpeechEnd. Now we distinguish them by presence of the data frames which are kept due to keepAllTokens settings. Very unnatural dependency which has drawbacks as well at least it eats memory. But I haven't decided what do do with this not so perfect API yet. Most probably we'll need to introduce something like EOF in C to find out if stream is over.

No comments:

Post a Comment