For a project I'm working on I need Sphinx to return to me a lattice, or even better, list of candidate sentences with scores. The lattice, however, seems to always contain one and only one path in it, namely, the one that it hypothesized as the best possibility. Am I missing something here? Is there a property to control the 'bushiness' of the lattice? Thanks!
-mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is a demo in demo/sphinx/lattice that demonstrates how to build a lattice from a result. In order to turn this on, you need to set the "buildWordLattice" property to "true" in the config file. Here's a snippet from the lattice demo config file:
If you're not doing this in your work, then you might run into problems. If you are setting the property, however, please let me know and we can start digging further.
Hope this helps,
Will
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the suggestion! That appears to have already been sent, however I'd like to take a look at the entire lattice demo before making you help me any further - I might be able to see what I'm doing wrong from that. As it turns out, the reason I never saw that demo is because it's not in my demo directory! I have confidence, hellodigits, hellongram, helloworld, transcriber, wavfile, and zipcity, but no lattice. Also, the link to that demo's README at the Sphinx FAQ leads to a 404.
Please let me know if you can, how I can get a hold of this demo to try to figure this out. Thanks again!!
-mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh dear! I forgot that we added this to the CVS repository after the alpha release. You can get the latest and greatest code directly from the CVS repository. The instructions can be found here:
https://sourceforge.net/cvs/?group_id=1904
Use sphinx4 as the module name.
Hope this helps,
Will
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the help, Will. I'll try to work this in a second, but this actually leads me to another question:
If I'm retrieving the result after it's been returning from recognizer.recognize() in the BatchModeRecognizer, what would you recommend as the simplest way to rescore sentence confidences before the actual 'best sentence' is returned to the batch process?
Thanks!
-mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, I haven't been successful in trying to get anything more out of the lattice, and I can't figure out why. Could it be some setting in the config.xml file I'm missing? Following the LatticeDemo.java example, I added this to BatchModeRecognizer's decode() function, inside the while loop that loops over all the batch items. I added this just after the call to recognizer.recognize():
Lattice lattice = new Lattice(result);
LatticeOptimizer optimizer = new LatticeOptimizer(lattice);
optimizer.optimize();
lattice.dumpAllPaths();
System.out.println("best was: " + result.getBestResultNoFiller());
And the result I get, still, is just one possible path, as shown here:
As you can see, that dumpAllPaths() call only shows one path, which doesn't make much sense. Certainly the recognizer is producing other hypotheses? Does this help you to help me in figuring out what I'm missing? Thanks!
-mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made these same exact changes to BatchModeRecognizer and ran the wsj5k_trigram test in the tests/performance/wsj5k directory.
I also modified any occurrence of buildWordLattice in the wsj5k.config.xml file to the following:
<property name="buildWordLattice" value="true"/>
The thing worked like a charm. What you might be running into is that the config.xml file is created from wsj5k.config.xml. So...if you modify config.xml, it's just going to get overwritten.
Will
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm working on something similar. First step is to look at the file
test_ps_nbest.c in the tests folder. It shows how to step through the top N
hypotheses and print out sentence and word level probability data.
.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
For a project I'm working on I need Sphinx to return to me a lattice, or even better, list of candidate sentences with scores. The lattice, however, seems to always contain one and only one path in it, namely, the one that it hypothesized as the best possibility. Am I missing something here? Is there a property to control the 'bushiness' of the lattice? Thanks!
-mike
Hi Mike:
There is a demo in demo/sphinx/lattice that demonstrates how to build a lattice from a result. In order to turn this on, you need to set the "buildWordLattice" property to "true" in the config file. Here's a snippet from the lattice demo config file:
If you're not doing this in your work, then you might run into problems. If you are setting the property, however, please let me know and we can start digging further.
Hope this helps,
Will
Hi Willie,
Thanks for the suggestion! That appears to have already been sent, however I'd like to take a look at the entire lattice demo before making you help me any further - I might be able to see what I'm doing wrong from that. As it turns out, the reason I never saw that demo is because it's not in my demo directory! I have confidence, hellodigits, hellongram, helloworld, transcriber, wavfile, and zipcity, but no lattice. Also, the link to that demo's README at the Sphinx FAQ leads to a 404.
Please let me know if you can, how I can get a hold of this demo to try to figure this out. Thanks again!!
-mike
Oh dear! I forgot that we added this to the CVS repository after the alpha release. You can get the latest and greatest code directly from the CVS repository. The instructions can be found here:
Use sphinx4 as the module name.
Hope this helps,
Will
Thanks for the help, Will. I'll try to work this in a second, but this actually leads me to another question:
If I'm retrieving the result after it's been returning from recognizer.recognize() in the BatchModeRecognizer, what would you recommend as the simplest way to rescore sentence confidences before the actual 'best sentence' is returned to the batch process?
Thanks!
-mike
Well, I haven't been successful in trying to get anything more out of the lattice, and I can't figure out why. Could it be some setting in the config.xml file I'm missing? Following the LatticeDemo.java example, I added this to BatchModeRecognizer's decode() function, inside the while loop that loops over all the batch items. I added this just after the call to recognizer.recognize():
Lattice lattice = new Lattice(result);
LatticeOptimizer optimizer = new LatticeOptimizer(lattice);
optimizer.optimize();
lattice.dumpAllPaths();
System.out.println("best was: " + result.getBestResultNoFiller());
And the result I get, still, is just one possible path, as shown here:
...
As you can see, that dumpAllPaths() call only shows one path, which doesn't make much sense. Certainly the recognizer is producing other hypotheses? Does this help you to help me in figuring out what I'm missing? Thanks!
-mike
Hi Mike:
I made these same exact changes to BatchModeRecognizer and ran the wsj5k_trigram test in the tests/performance/wsj5k directory.
I also modified any occurrence of buildWordLattice in the wsj5k.config.xml file to the following:
<property name="buildWordLattice" value="true"/>
The thing worked like a charm. What you might be running into is that the config.xml file is created from wsj5k.config.xml. So...if you modify config.xml, it's just going to get overwritten.
Will
I'm working on something similar. First step is to look at the file
test_ps_nbest.c in the tests folder. It shows how to step through the top N
hypotheses and print out sentence and word level probability data.
.