Menu

use models from SphinxTrain in Sphinx4

Help
tho_mee
2009-01-02
2012-09-22
  • tho_mee

    tho_mee - 2009-01-02

    hai...

    I have created the acoustic model using SphinxTrain. I created a folder DB in Sphinx4/models/acoustic and copied the acoustic model created by SphinxTrain in modelparameters/an4.cd_cont_1000_8 to it.

    They are also mentioning a .dic file and a fillerdic file. Should we manually create these and place it in DB/dict folder or are they also created by SphinxTrain? Since the training was done using the an4.dic file is it OK if i copy that .dic file to DB/dic folder?

     
    • tho_mee

      tho_mee - 2009-01-06

      hai again....

      I think I was not clear about what i asked...
      I made the jar file of the acoustic model and that is DBR_8gau_13dCep_16k_40mel_140Hz_6800Hz.jar
      It was formed in the sphinx4/lib folder.

      I had made the changes in the manifest file.

      Main-Class: edu.cmu.sphinx.demo.helloworld.HelloWorld
      Class-Path: ../lib/sphinx4.jar ../lib/jsapi.jar ../lib/DBR_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar

      this is my helloworld_config file.

      <?xml version="1.0" encoding="UTF-8"?>

      <!--
      Sphinx-4 Configuration file
      -->

      <!-- ******** -->
      <!-- an4 configuration file -->
      <!-- ******** -->

      <config>

      &lt;!-- ******************************************************** --&gt;
      &lt;!-- frequently tuned properties                              --&gt;
      &lt;!-- ******************************************************** --&gt;
      
      &lt;property name=&quot;logLevel&quot; value=&quot;WARNING&quot;/&gt;
      
      &lt;property name=&quot;absoluteBeamWidth&quot;  value=&quot;-1&quot;/&gt;
      &lt;property name=&quot;relativeBeamWidth&quot;  value=&quot;1E-80&quot;/&gt;
      &lt;property name=&quot;wordInsertionProbability&quot; value=&quot;1E-36&quot;/&gt;
      &lt;property name=&quot;languageWeight&quot;     value=&quot;8&quot;/&gt;
      
      &lt;property name=&quot;frontend&quot; value=&quot;epFrontEnd&quot;/&gt;
      &lt;property name=&quot;recognizer&quot; value=&quot;recognizer&quot;/&gt;
      &lt;property name=&quot;showCreations&quot; value=&quot;false&quot;/&gt;
      
      
      &lt;!-- ******************************************************** --&gt;
      &lt;!-- word recognizer configuration                            --&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;/propertylist&gt;
      &lt;/component&gt;
      
      &lt;!-- ******************************************************** --&gt;
      &lt;!-- The Decoder   configuration                              --&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;searchManager&quot;/&gt;
      &lt;/component&gt;
      
      &lt;component name=&quot;searchManager&quot;
          type=&quot;edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager&quot;&gt;
          &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
          &lt;property name=&quot;linguist&quot; value=&quot;flatLinguist&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;activeListFactory&quot; value=&quot;activeList&quot;/&gt;
      &lt;/component&gt;
      
      
      &lt;component name=&quot;activeList&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;trivialPruner&quot;
                  type=&quot;edu.cmu.sphinx.decoder.pruner.SimplePruner&quot;/&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;/component&gt;
      
      &lt;!-- ******************************************************** --&gt;
      &lt;!-- The linguist  configuration                              --&gt;
      &lt;!-- ******************************************************** --&gt;
      
      &lt;component name=&quot;flatLinguist&quot;
                  type=&quot;edu.cmu.sphinx.linguist.flat.FlatLinguist&quot;&gt;
          &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
          &lt;property name=&quot;grammar&quot; value=&quot;jsgfGrammar&quot;/&gt;
          &lt;property name=&quot;acousticModel&quot; value=&quot;wsj&quot;/&gt;
          &lt;property name=&quot;wordInsertionProbability&quot;
                  value=&quot;${wordInsertionProbability}&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;!-- The Grammar  configuration                               --&gt;
      &lt;!-- ******************************************************** --&gt;
      
      &lt;component name=&quot;jsgfGrammar&quot; type=&quot;edu.cmu.sphinx.jsapi.JSGFGrammar&quot;&gt;
          &lt;property name=&quot;dictionary&quot; value=&quot;dictionary&quot;/&gt;
          &lt;property name=&quot;grammarLocation&quot;
               value=&quot;resource:/edu.cmu.sphinx.demo.helloworld.HelloWorld!/edu/cmu/sphinx/demo/helloworld/&quot;/&gt;
          &lt;property name=&quot;grammarName&quot; value=&quot;hello&quot;/&gt;
      &lt;property name=&quot;logMath&quot; value=&quot;logMath&quot;/&gt;
      &lt;/component&gt;
      
      
      &lt;!-- ******************************************************** --&gt;
      &lt;!-- The Dictionary configuration                            --&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.DBR_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model!/edu/cmu/sphinx/model/acoustic/DBR_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/dbr.dic&quot;/&gt;
          &lt;property name=&quot;fillerPath&quot;
       value=&quot;resource:/edu.cmu.sphinx.model.acoustic.DBR_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model!/edu/cmu/sphinx/model/acoustic/DBR_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;allowMissingWords&quot; value=&quot;false&quot;/&gt;
          &lt;property name=&quot;unitManager&quot; value=&quot;unitManager&quot;/&gt;
      &lt;/component&gt;
      
      &lt;!-- ******************************************************** --&gt;
      &lt;!-- The acoustic model configuration                         --&gt;
      &lt;!-- ******************************************************** --&gt;
      

      <component name="dbr"
      type="edu.cmu.sphinx.model.acoustic.DBR_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model">
      <property name="loader" value="sphinx3Loader"/>
      <property name="unitManager" value="unitManager"/>
      </component>

      <component name="sphinx3Loader"
      type="edu.cmu.sphinx.model.acoustic.DBR_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader">
      <property name="logMath" value="logMath"/>
      <property name="unitManager" value="unitManager"/>
      </component>

      &lt;!-- ******************************************************** --&gt;
      &lt;!-- The unit manager configuration                           --&gt;
      &lt;!-- ******************************************************** --&gt;
      
      &lt;component name=&quot;unitManager&quot;
          type=&quot;edu.cmu.sphinx.linguist.acoustic.UnitManager&quot;/&gt;
      
      &lt;!-- ******************************************************** --&gt;
      &lt;!-- The frontend configuration                               --&gt;
      &lt;!-- ******************************************************** --&gt;
      
      &lt;component name=&quot;frontEnd&quot; type=&quot;edu.cmu.sphinx.frontend.FrontEnd&quot;&gt;
          &lt;propertylist name=&quot;pipeline&quot;&gt;
              &lt;item&gt;microphone &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;!-- The live frontend configuration                          --&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;microphone &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;!-- The frontend pipelines                                   --&gt;
      &lt;!-- ******************************************************** --&gt;
      
      &lt;component name=&quot;dataBlocker&quot; type=&quot;edu.cmu.sphinx.frontend.DataBlocker&quot;&gt;
          &lt;!--&lt;property name=&quot;blockSizeMs&quot; value=&quot;10&quot;/&gt;--&gt;
      &lt;/component&gt;
      
      &lt;component name=&quot;speechClassifier&quot;
                 type=&quot;edu.cmu.sphinx.frontend.endpoint.SpeechClassifier&quot;&gt;
          &lt;property name=&quot;threshold&quot; value=&quot;13&quot;/&gt;
      &lt;/component&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;property name=&quot;speechTrailer&quot; value=&quot;50&quot;/&gt;
      &lt;/component&gt;
      
      
      &lt;component name=&quot;premphasizer&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&gt;
      
      &lt;component name=&quot;fft&quot;
              type=&quot;edu.cmu.sphinx.frontend.transform.DiscreteFourierTransform&quot;&gt;
      &lt;/component&gt;
      
      &lt;component name=&quot;melFilterBank&quot;
          type=&quot;edu.cmu.sphinx.frontend.frequencywarp.MelFrequencyFilterBank&quot;&gt;
      &lt;/component&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;component name=&quot;microphone&quot;
                 type=&quot;edu.cmu.sphinx.frontend.util.Microphone&quot;&gt;
          &lt;property name=&quot;closeBetweenUtterances&quot; value=&quot;false&quot;/&gt;
      &lt;/component&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;!-- ******************************************************* --&gt;
      &lt;!--  Miscellaneous components                               --&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;
      

      </config>

       
      • Nickolay V. Shmyrev

        And who will change

        <property name="acousticModel" value="wsj"/>

        to

        <property name="acousticModel" value="dbr"/>

        :p

         
    • tho_mee

      tho_mee - 2009-01-02

      They have also asked to copy two .mdef files to DB/etc folder.
      But I found 4 .mdef files

      an4.1000.mdef
      an4.alltriphones.mdef
      an4.ci.mdef
      an4.untied.mdef
      in the an4/model_architecture folder.Which are the two mentioned by them ? One is the *.ci.mdef which is the other?Hope I am right...
      Do i need to rename them or is it enough to give these names in the model.props file? In model.props give

      modelDefinition=filename.mdef

       
      • Nickolay V. Shmyrev

        > Which are the two mentioned by them?

        an4.1000.mdef and an4.ci.mdef

        Actually you can copy only one an4.1000.mdef

        > Do i need to rename them or is it enough to give these names in the model.props file?

        no

         
    • Nickolay V. Shmyrev

      > Since the training was done using the an4.dic file is it OK if i copy that .dic file to DB/dic folder?

      It's ok.

       
    • tho_mee

      tho_mee - 2009-01-05

      Hello
      I am trying to run the HelloWorld demo using the acoustic model created
      But I am getting this error......What is the problem??

      $java -mx256m -jar bin/HelloWorld.jar

      Exception in thread "main" Property Exception component:'flatLinguist' property:'acousticModel' - mandatory property is not set!
      edu.cmu.sphinx.util.props.InternalConfigurationException
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:283)
      at edu.cmu.sphinx.linguist.flat.FlatLinguist.setupAcousticModel(FlatLinguist.java:220)
      at edu.cmu.sphinx.linguist.flat.FlatLinguist.newProperties(FlatLinguist.java:184)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:421)
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:271)
      at edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager.newProperties(SimpleBreadthFirstSearchManager.java:139)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:421)
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:271)
      at edu.cmu.sphinx.decoder.AbstractDecoder.newProperties(AbstractDecoder.java:52)
      at edu.cmu.sphinx.decoder.Decoder.newProperties(Decoder.java:31)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:421)
      at edu.cmu.sphinx.util.props.PropertySheet.getComponent(PropertySheet.java:271)
      at edu.cmu.sphinx.recognizer.Recognizer.newProperties(Recognizer.java:78)
      at edu.cmu.sphinx.util.props.PropertySheet.getOwner(PropertySheet.java:421)
      at edu.cmu.sphinx.util.props.ConfigurationManager.lookup(ConfigurationManager.java:163)
      at edu.cmu.sphinx.demo.helloworld.HelloWorld.main(HelloWorld.java:36)

       
    • tho_mee

      tho_mee - 2009-01-05

      hai..
      before running the code I had tried

      /sphinx4$ java -jar lib/DBR_8gau_13dCep_16k_40mel_140Hz_6800Hz.jar
      Unable to access jarfile lib/DBR_8gau_13dCep_16k_40mel_140Hz_6800Hz.jar

      I tried for all other jar files also the same message comes....

       
      • Nickolay V. Shmyrev

        > Unable to access jarfile lib/DBR_8gau_13dCep_16k_40mel_140Hz_6800Hz.jar

        There is really no such file, why do you think it will appear there?

        > But I am getting this error......What is the problem??

        The acoustic model jar is missing, isn't it clear? Probably you forgot to change manifest.in. Try to search this forum, this issue was discussed many times.

         

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.