Menu

lost getTimedBestResult() output

Help
Nate
2009-07-22
2012-09-22
  • Nate

    Nate - 2009-07-22

    Hello there,

    I'm not sure if this should go in Sphinx-4 Open Discussion or not.

    I modified the Transcriber demo source code as follows:

    Result result;
    while ((result = recognizer.recognize())!= null) {
    String resultText = result.getBestResultNoFiller();
    System.out.println(result.getTimedBestResult(true, true) +
    " -- " + resultText);
    unitTestBuffer.add(result);
    }

    In short, the output now includes a call to getTimedBestResult(). Using the demo-supplied grammar and .wav, the output looks as you would expect:

    <sil>(0.65,0.85) one(0.85,1.07) zero(1.07,1.52) zero(1.52,1.94) zero(1.94,2.23) one(2.23,2.74) -- one zero zero zero one
    <sil>(2.74,3.91) nine(3.91,4.17) oh(4.17,4.3) two(4.3,4.5) one(4.5,4.67) oh(4.67,4.96) -- nine oh two one oh
    <sil>(4.96,6.24) zero(6.24,6.67) one(6.67,6.88) eight(6.88,7.07) zero(7.07,7.49) three(7.49,8.2) -- zero one eight zero three

    When I change the config file to use the HelloNGram set-up and lm file, but with the same Transcriber .wav file, I get the following results:

    -- ones there was there was there are one
    -- back of two one all
    -- still one it's are with three

    The actual recognition is completely expected, and eerily accurate given the circumstances...it nailed one and three every time for example, and with a little imagination one can see how "eight zero" might be taken as "it's are" by a system lacking the words eight and zero. Neato!

    What isn't intuitive to me is how there is suddenly no timestamp information, and I'm just wondering if this has to do with my config file or if it might be a bug? Here is my config:

    <config>
    <!-- ******** -->
    <!-- frequently tuned properties -->
    <!-- ******** -->
    <property name="absoluteBeamWidth" value="500"/>
    <property name="relativeBeamWidth" value="1E-80"/>
    <property name="absoluteWordBeamWidth" value="20"/>
    <property name="relativeWordBeamWidth" value="1E-60"/>
    <property name="wordInsertionProbability" value="1E-16"/>
    <property name="languageWeight" value="7.0"/>
    <property name="silenceInsertionProbability" value=".1"/>
    <property name="frontend" value="epFrontEnd"/>
    <property name="recognizer" value="recognizer"/>
    <property name="showCreations" value="false"/>

    &lt;!-- ******************************************************** --&gt;
    &lt;!-- recognizer                                               --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;recognizer&quot;
               type=&quot;edu.cmu.sphinx.recognizer.Recognizer&quot;&gt;
        &lt;property name=&quot;decoder&quot; value=&quot;decoder&quot;/&gt;
        &lt;propertylist name=&quot;monitors&quot;&gt;
            &lt;item&gt;accuracyTracker &lt;/item&gt;
            &lt;item&gt;speedTracker &lt;/item&gt;
            &lt;item&gt;memoryTracker &lt;/item&gt;
            &lt;item&gt;recognizerMonitor &lt;/item&gt;
        &lt;/propertylist&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- decoder                                                  --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;decoder&quot; type=&quot;edu.cmu.sphinx.decoder.Decoder&quot;&gt;
        &lt;property name=&quot;searchManager&quot; value=&quot;wordPruningSearchManager&quot;/&gt;
        &lt;property name=&quot;featureBlockSize&quot; value=&quot;50&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- searchManager                                            --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;wordPruningSearchManager&quot;
               type=&quot;edu.cmu.sphinx.decoder.search.WordPruningBreadthFirstSearchManager&quot;&gt;
        &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
        &lt;property name=&quot;linguist&quot; value=&quot;lexTreeLinguist&quot;/&gt;
        &lt;property name=&quot;pruner&quot; value=&quot;trivialPruner&quot;/&gt;
        &lt;property name=&quot;scorer&quot; value=&quot;threadedScorer&quot;/&gt;
        &lt;property name=&quot;activeListManager&quot; value=&quot;activeListManager&quot;/&gt;
        &lt;property name=&quot;growSkipInterval&quot; value=&quot;0&quot;/&gt;
        &lt;property name=&quot;checkStateOrder&quot; value=&quot;false&quot;/&gt;
        &lt;property name=&quot;buildWordLattice&quot; value=&quot;false&quot;/&gt;
        &lt;property name=&quot;acousticLookaheadFrames&quot; value=&quot;1.7&quot;/&gt;
        &lt;property name=&quot;relativeBeamWidth&quot; value=&quot;${relativeBeamWidth}&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- logMath                                                  --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;logMath&quot; type=&quot;edu.cmu.sphinx.util.LogMath&quot;&gt;
        &lt;property name=&quot;logBase&quot; value=&quot;1.0001&quot;/&gt;
        &lt;property name=&quot;useAddTable&quot; value=&quot;true&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- pruner                                                   --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;trivialPruner&quot;
               type=&quot;edu.cmu.sphinx.decoder.pruner.SimplePruner&quot;/&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- scorer                                                   --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;threadedScorer&quot;
               type=&quot;edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer&quot;&gt;
        &lt;property name=&quot;frontend&quot; value=&quot;${frontend}&quot;/&gt;
        &lt;property name=&quot;isCpuRelative&quot; value=&quot;true&quot;/&gt;
        &lt;property name=&quot;numThreads&quot; value=&quot;0&quot;/&gt;
        &lt;property name=&quot;minScoreablesPerThread&quot; value=&quot;10&quot;/&gt;
        &lt;property name=&quot;scoreablesKeepFeature&quot; value=&quot;true&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- activeListManager and subcomponents                      --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;activeListManager&quot;
             type=&quot;edu.cmu.sphinx.decoder.search.SimpleActiveListManager&quot;&gt;
        &lt;propertylist name=&quot;activeListFactories&quot;&gt;
        &lt;item&gt;standardActiveListFactory&lt;/item&gt;
        &lt;item&gt;wordActiveListFactory&lt;/item&gt;
        &lt;item&gt;wordActiveListFactory&lt;/item&gt;
        &lt;item&gt;standardActiveListFactory&lt;/item&gt;
        &lt;item&gt;standardActiveListFactory&lt;/item&gt;
        &lt;item&gt;standardActiveListFactory&lt;/item&gt;
    &lt;/propertylist&gt;
    &lt;/component&gt;
    
    &lt;component name=&quot;standardActiveListFactory&quot;
               type=&quot;edu.cmu.sphinx.decoder.search.PartitionActiveListFactory&quot;&gt;
        &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
        &lt;property name=&quot;absoluteBeamWidth&quot; value=&quot;${absoluteBeamWidth}&quot;/&gt;
        &lt;property name=&quot;relativeBeamWidth&quot; value=&quot;${relativeBeamWidth}&quot;/&gt;
    &lt;/component&gt;
    
    &lt;component name=&quot;wordActiveListFactory&quot;
               type=&quot;edu.cmu.sphinx.decoder.search.PartitionActiveListFactory&quot;&gt;
        &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
        &lt;property name=&quot;absoluteBeamWidth&quot; value=&quot;${absoluteWordBeamWidth}&quot;/&gt;
        &lt;property name=&quot;relativeBeamWidth&quot; value=&quot;${relativeWordBeamWidth}&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- linguist                                                 --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;lexTreeLinguist&quot;
               type=&quot;edu.cmu.sphinx.linguist.lextree.LexTreeLinguist&quot;&gt;
        &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
        &lt;property name=&quot;acousticModel&quot; value=&quot;wsj&quot;/&gt;
        &lt;property name=&quot;languageModel&quot; value=&quot;trigramModel&quot;/&gt;
        &lt;property name=&quot;dictionary&quot; value=&quot;dictionary&quot;/&gt;
        &lt;property name=&quot;addFillerWords&quot; value=&quot;false&quot;/&gt;
        &lt;property name=&quot;fillerInsertionProbability&quot; value=&quot;1E-10&quot;/&gt;
        &lt;property name=&quot;generateUnitStates&quot; value=&quot;false&quot;/&gt;
        &lt;property name=&quot;wantUnigramSmear&quot; value=&quot;true&quot;/&gt;
        &lt;property name=&quot;unigramSmearWeight&quot; value=&quot;1&quot;/&gt;
        &lt;property name=&quot;wordInsertionProbability&quot;
                  value=&quot;${wordInsertionProbability}&quot;/&gt;
        &lt;property name=&quot;silenceInsertionProbability&quot;
                  value=&quot;${silenceInsertionProbability}&quot;/&gt;
        &lt;property name=&quot;languageWeight&quot; value=&quot;${languageWeight}&quot;/&gt;
        &lt;property name=&quot;unitManager&quot; value=&quot;unitManager&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- acoustic model                                           --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;wsj&quot;
               type=&quot;edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model&quot;&gt;
        &lt;property name=&quot;loader&quot; value=&quot;wsjLoader&quot;/&gt;
        &lt;property name=&quot;unitManager&quot; value=&quot;unitManager&quot;/&gt;
    &lt;/component&gt;
    
    &lt;component name=&quot;wsjLoader&quot;
               type=&quot;edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader&quot;&gt;
        &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
        &lt;property name=&quot;unitManager&quot; value=&quot;unitManager&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- language model                                           --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;trigramModel&quot;
               type=&quot;edu.cmu.sphinx.linguist.language.ngram.SimpleNGramModel&quot;&gt;
        &lt;property name=&quot;location&quot;
                  value=&quot;file:\C:\Documents and Settings\User\My Documents\NetBeansProjects\TranscriberDemo\src\hellongram.trigram.lm&quot;/&gt;
        &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
        &lt;property name=&quot;dictionary&quot; value=&quot;dictionary&quot;/&gt;
        &lt;property name=&quot;maxDepth&quot; value=&quot;3&quot;/&gt;
        &lt;property name=&quot;unigramWeight&quot; value=&quot;.7&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- dictionary                                               --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;dictionary&quot;
               type=&quot;edu.cmu.sphinx.linguist.dictionary.FastDictionary&quot;&gt;
        &lt;property name=&quot;dictionaryPath&quot;
                  value=&quot;resource:/edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model!/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/cmudict.0.6d&quot;/&gt;
        &lt;property name=&quot;fillerPath&quot;
              value=&quot;resource:/edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model!/edu/cmu/sphinx/model/acoustic/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict&quot;/&gt;
        &lt;property name=&quot;addSilEndingPronunciation&quot; value=&quot;false&quot;/&gt;
        &lt;property name=&quot;wordReplacement&quot; value=&quot;&amp;lt;sil&amp;gt;&quot;/&gt;
        &lt;property name=&quot;unitManager&quot; value=&quot;unitManager&quot;/&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- unit manager                                             --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;unitManager&quot;
               type=&quot;edu.cmu.sphinx.linguist.acoustic.UnitManager&quot;/&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- frontend                                                 --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;epFrontEnd&quot; type=&quot;edu.cmu.sphinx.frontend.FrontEnd&quot;&gt;
        &lt;propertylist name=&quot;pipeline&quot;&gt;
            &lt;item&gt;audioFileDataSource &lt;/item&gt;
            &lt;item&gt;dataBlocker &lt;/item&gt;
            &lt;item&gt;speechClassifier &lt;/item&gt;
            &lt;item&gt;speechMarker &lt;/item&gt;
            &lt;item&gt;nonSpeechDataFilter &lt;/item&gt;
            &lt;item&gt;premphasizer &lt;/item&gt;
            &lt;item&gt;windower &lt;/item&gt;
            &lt;item&gt;fft &lt;/item&gt;
            &lt;item&gt;melFilterBank &lt;/item&gt;
            &lt;item&gt;dct &lt;/item&gt;
            &lt;item&gt;liveCMN &lt;/item&gt;
            &lt;item&gt;featureExtraction &lt;/item&gt;
        &lt;/propertylist&gt;
    &lt;/component&gt;
    
    &lt;!-- ******************************************************** --&gt;
    &lt;!-- frontend pipeline                                        --&gt;
    &lt;!-- ******************************************************** --&gt;
    &lt;component name=&quot;audioFileDataSource&quot;
               type=&quot;edu.cmu.sphinx.frontend.util.AudioFileDataSource&quot;/&gt;
    
    &lt;component name=&quot;dataBlocker&quot;
               type=&quot;edu.cmu.sphinx.frontend.DataBlocker&quot;/&gt;
    
    &lt;component name=&quot;speechClassifier&quot;
               type=&quot;edu.cmu.sphinx.frontend.endpoint.SpeechClassifier&quot;/&gt;
    
    &lt;component name=&quot;nonSpeechDataFilter&quot;
               type=&quot;edu.cmu.sphinx.frontend.endpoint.NonSpeechDataFilter&quot;/&gt;
    
    &lt;component name=&quot;speechMarker&quot;
               type=&quot;edu.cmu.sphinx.frontend.endpoint.SpeechMarker&quot;/&gt;
    
    &lt;component name=&quot;preemphasizer&quot;
               type=&quot;edu.cmu.sphinx.frontend.filter.Preemphasizer&quot;/&gt;
    
    &lt;component name=&quot;windower&quot;
               type=&quot;edu.cmu.sphinx.frontend.window.RaisedCosineWindower&quot;/&gt;
    
    &lt;component name=&quot;fft&quot;
               type=&quot;edu.cmu.sphinx.frontend.transform.DiscreteFourierTransform&quot;/&gt;
    
    &lt;component name=&quot;melFilterBank&quot;
               type=&quot;edu.cmu.sphinx.frontend.frequencywarp.MelFrequencyFilterBank&quot;/&gt;
    
    &lt;component name=&quot;dct&quot;
               type=&quot;edu.cmu.sphinx.frontend.transform.DiscreteCosineTransform&quot;/&gt;
    
    &lt;component name=&quot;liveCMN&quot;
               type=&quot;edu.cmu.sphinx.frontend.feature.LiveCMN&quot;/&gt;
    
    &lt;component name=&quot;featureExtraction&quot;
               type=&quot;edu.cmu.sphinx.frontend.feature.DeltasFeatureExtractor&quot;/&gt;
    
    &lt;!-- ******************************************************* --&gt;
    &lt;!--  monitors                                               --&gt;
    &lt;!-- ******************************************************* --&gt;
    &lt;component name=&quot;accuracyTracker&quot;
               type=&quot;edu.cmu.sphinx.instrumentation.BestPathAccuracyTracker&quot;&gt;
        &lt;property name=&quot;recognizer&quot; value=&quot;${recognizer}&quot;/&gt;
        &lt;property name=&quot;showAlignedResults&quot; value=&quot;false&quot;/&gt;
        &lt;property name=&quot;showRawResults&quot; value=&quot;false&quot;/&gt;
    &lt;/component&gt;
    
    &lt;component name=&quot;memoryTracker&quot;
               type=&quot;edu.cmu.sphinx.instrumentation.MemoryTracker&quot;&gt;
        &lt;property name=&quot;recognizer&quot; value=&quot;${recognizer}&quot;/&gt;
    &lt;property name=&quot;showSummary&quot; value=&quot;false&quot;/&gt;
    &lt;property name=&quot;showDetails&quot; value=&quot;false&quot;/&gt;
    &lt;/component&gt;
    
    &lt;component name=&quot;speedTracker&quot;
               type=&quot;edu.cmu.sphinx.instrumentation.SpeedTracker&quot;&gt;
        &lt;property name=&quot;recognizer&quot; value=&quot;${recognizer}&quot;/&gt;
        &lt;property name=&quot;frontend&quot; value=&quot;${frontend}&quot;/&gt;
    &lt;property name=&quot;showSummary&quot; value=&quot;true&quot;/&gt;
    &lt;property name=&quot;showDetails&quot; value=&quot;false&quot;/&gt;
    &lt;/component&gt;
    
    &lt;component name=&quot;recognizerMonitor&quot;
               type=&quot;edu.cmu.sphinx.instrumentation.RecognizerMonitor&quot;&gt;
        &lt;property name=&quot;recognizer&quot; value=&quot;${recognizer}&quot;/&gt;
        &lt;propertylist name=&quot;allocatedMonitors&quot;&gt;
            &lt;item&gt;configMonitor &lt;/item&gt;
        &lt;/propertylist&gt;
    &lt;/component&gt;
    
    &lt;component name=&quot;configMonitor&quot;
               type=&quot;edu.cmu.sphinx.instrumentation.ConfigMonitor&quot;&gt;
        &lt;property name=&quot;showConfig&quot; value=&quot;false&quot;/&gt;
    &lt;/component&gt;
    

    </config>

     
    • Nickolay V. Shmyrev

      You need <property name="keepAllTokens" value="true"/> in searchManager most probably.

       
    • Nate

      Nate - 2009-07-22

      Perfect. Many thanks! As a rule of thumb then, is the SearchManager the closest we can get in the config file to tweaking what the Result includes? Or at least, is that a good place to start looking if the Result contains something it shouldn't, or doesn't contain something it should? Thanks again.

       
      • Nickolay V. Shmyrev

        Well, sort of. The result is built from the token tree which is maintained by search manager.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.