Menu

How to Create/Change Dictionary Words???

Help
2004-06-10
2012-09-22
  • Tekkno Genius

    Tekkno Genius - 2004-06-10

    How do I either create a new dictionary or change/modify an existing one? I'd like to use the the AN4 dictionary and modify some words within it. Any help would be greatly appreciated.
    Thanx

     
    • Tekkno Genius

      Tekkno Genius - 2004-06-10

      I'm using the Sphinx4. I've written an application that works, but I'm using the 5000 word dictionary (I think its the WSJ), and I only use 100 words. Also, how do I use the AN4 dictionary anyway? I don't see the .jar file for it.

      Also, any hints on making the recognizer allocate quicker? It takes about a minute to allocate the needed resources.

      Thanx again.

       
      • Paul Lamere

        Paul Lamere - 2004-06-10

        Tekkno:

        It does not  matter (in terms of recognition speed and accuracy) if you have extra words in your dictionary.  Typically (depending upon your configuration), the language model or the Grammar being used will define the active vocabulary. For instance if you are using an N-Gram language model with 1000 words in it, only those 1,000 words will be considered during the search, even if your dictionary has 100,000 words. Likewise with a JSGF grammar, only the words explicitly mentioned in the grammar will be used in the decoding, regardless of the size of the dictionary. 

        There may be a small penalty in terms of memory footprint and startup time with a larger dictionary. But this is negligible when compared to the tiem spent loading acoustic models, language models and grammars.

        With regard to making the recognizer allocate quicker... I am working right now on a new linguist that will compile jsgf grammars much more quickly and efficiently.  This will reduce the startup time for command and control type recognitions. 

        There are probably a number of other things that can be done to improve the startup time, however this has been rather low on our priority list. We've been focusing mostly on recognition accuracy and recognition speed. Memory foot print and startup time have been of only secondary concern.  Sometime soon we may get a chance to look more closely at improving startup time.

        As you probably realize, there are many many ways to configure sphinx-4, so it is not always easy to answer specific questions without knowing how your recognizer is configured.  If you could attach your config.xml (or if it is based on one of the config.xml files included in the release, let us know which it is based on), this will help us answer the questions better.

        Thanks for trying Sphinx-4!

        Paul

         
    • Tekkno Genius

      Tekkno Genius - 2004-06-11

      Thanx for the reply. Here is my config.xml (it is based on the cardmatch.config.xml from the demo\jsapi\cardmatch directory). Here it is...

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

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

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

      <config>       
         
          <!-- ******************************************************** -->
          <!-- frequently tuned properties                              -->
          <!-- ******************************************************** -->
         
          <property name="absoluteBeamWidth"  value="800"/>
          <property name="relativeBeamWidth"  value="1E-150"/>
          <property name="wordInsertionProbability" value="1E-26"/>
          <property name="languageWeight"     value="7"/>
          <property name="silenceInsertionProbability"  value="1"/>
         
          <property name="frontend" value="frontEnd"/>
          <property name="recognizer" value="recognizer"/>
          <property name="showCreations" value="false"/>
         
         
          <!-- ******************************************************** -->
          <!-- jamie configuration                                      -->
          <!-- ******************************************************** -->  
         
          <component name="jamie"
                     type="demo.jsapi.jamie.JaMIE">
              <property name="recognizer" value="${recognizer}"/>
              <property name="microphone" value="microphone"/>
              <property name="grammar" value="jsgfGrammar"/>
              <property name="useVoice" value="false"/>
              <property name="plantNumber" value="441000022"/>
              <property name="numberOfQuestions" value="3"/>
              <propertylist name="ruleNames">
                <item>quality</item>
                <item>schedule</item>
                <item>yield</item>
              </propertylist>
              <propertylist name="questionSets">
                <item>10</item>
                <item>1</item>
                <item>6</item>
              </propertylist>
              <propertylist name="questionPrompts">
                      <item>Not performed</item>
                      <item>Prime</item>
                      <item>Choice</item>
                      <item>Select</item>
                      <item>Standard</item>
                      <item>Commercial</item>
                      <item>Utility</item>
                      <item>Cutter</item>
                      <item>Canner</item>
                      <item>Cull</item>
                      <item>Schedule</item>
                      <item>Zero</item>
                      <item>One</item>
                      <item>Two</item>
                      <item>Three</item>
                      <item>Four</item>
                      <item>Five</item>
              </propertylist>
          </component>
       
         
          <!-- ******************************************************** -->
          <!-- word recognizer configuration                            -->
          <!-- ******************************************************** -->
         
          <component name="recognizer"
                                type="edu.cmu.sphinx.recognizer.Recognizer">
              <property name="decoder" value="decoder"/>
              <propertylist name="monitors">
      <!--
                  <item>accuracyTracker </item>
                  <item>speedTracker </item>
                  <item>memoryTracker </item>
                  <item>recognizerMonitor </item>
      -->
              </propertylist>
          </component>
         
          <!-- ******************************************************** -->
          <!-- The Decoder   configuration                              -->
          <!-- ******************************************************** -->
         
          <component name="decoder" type="edu.cmu.sphinx.decoder.Decoder">
              <property name="searchManager" value="searchManager"/>
          </component>
         
          <component name="searchManager"
              type="edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager">
              <property name="logMath" value="logMath"/>
              <property name="linguist" value="flatLinguist"/>
              <property name="pruner" value="trivialPruner"/>
              <property name="scorer" value="threadedScorer"/>
              <property name="activeListFactory" value="activeList"/>
          </component>
         
         
          <component name="activeList"
                   type="edu.cmu.sphinx.decoder.search.PartitionActiveListFactory">
              <property name="logMath" value="logMath"/>
              <property name="absoluteBeamWidth" value="${absoluteBeamWidth}"/>
              <property name="relativeBeamWidth" value="${relativeBeamWidth}"/>
          </component>
         
          <component name="trivialPruner"
                      type="edu.cmu.sphinx.decoder.pruner.SimplePruner"/>
         
          <component name="threadedScorer"
                      type="edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer">
              <property name="frontend" value="${frontend}"/>
              <property name="isCpuRelative" value="true"/>
              <property name="numThreads" value="0"/>
              <property name="minScoreablesPerThread" value="10"/>
              <property name="scoreablesKeepFeature" value="true"/>
          </component>
         
          <!-- ******************************************************** -->
          <!-- The linguist  configuration                              -->
          <!-- ******************************************************** -->
         
          <component name="flatLinguist"
                      type="edu.cmu.sphinx.linguist.flat.FlatLinguist">
              <property name="logMath" value="logMath"/>
              <property name="grammar" value="jsgfGrammar"/>
              <property name="acousticModel" value="wsj"/>
              <property name="wordInsertionProbability"
                      value="${wordInsertionProbability}"/>
              <property name="silenceInsertionProbability"
                      value="${silenceInsertionProbability}"/>
              <property name="languageWeight" value="${languageWeight}"/>
              <property name="unitManager" value="unitManager"/>
          </component>
         
         
         
          <!-- ******************************************************** -->
          <!-- The Grammar  configuration                               -->
          <!-- ******************************************************** -->
         
             
          <component name="jsgfGrammar"
                      type="edu.cmu.sphinx.jsapi.JSGFGrammar">
              <property name="grammarLocation" value="file:./"/>
              <property name="dictionary" value="dictionary"/>
              <property name="grammarName" value="jamie"/>        
              <property name="logMath" value="logMath"/>
          </component>
         
         
         
          <!-- ******************************************************** -->
          <!-- The Dictionary configuration                            -->
          <!-- ******************************************************** -->
         
          <component name="dictionary"
              type="edu.cmu.sphinx.linguist.dictionary.FullDictionary">
              <property name="dictionaryPath"
           value="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"/>
              <property name="fillerPath"
           value="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"/>
              <property name="addSilEndingPronunciation" value="false"/>
              <property name="wordReplacement" value="&lt;sil&gt;"/>
              <property name="allowMissingWords" value="true"/>
              <property name="unitManager" value="unitManager"/>
          </component>

          <!-- ******************************************************** -->
          <!-- The acoustic model configuration                         -->
          <!-- ******************************************************** -->
          <component name="wsj"
            type="edu.cmu.sphinx.model.acoustic.WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model">
              <property name="loader" value="wsjLoader"/>
              <property name="unitManager" value="unitManager"/>
          </component>

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

          <!-- ******************************************************** -->
          <!-- The unit manager configuration                           -->
          <!-- ******************************************************** -->

          <component name="unitManager"
              type="edu.cmu.sphinx.linguist.acoustic.UnitManager"/>

             
          <!-- ******************************************************** -->
          <!-- The frontend configuration                               -->
          <!-- ******************************************************** -->
         
          <component name="frontEnd" type="edu.cmu.sphinx.frontend.FrontEnd">
              <propertylist name="pipeline">
                  <item>microphone </item>
                  <item>premphasizer </item>
                  <item>windower </item>
                  <item>fft </item>
                  <item>melFilterBank </item>
                  <item>dct </item>
                  <item>liveCMN </item>
                  <item>featureExtraction </item>
              </propertylist>
          </component>
         
          <!-- ******************************************************** -->
          <!-- The live frontend configuration                          -->
          <!-- ******************************************************** -->
          <component name="epFrontEnd" type="edu.cmu.sphinx.frontend.FrontEnd">
              <propertylist name="pipeline">
                  <item>microphone </item>
                  <item>speechClassifier </item>
                  <item>speechMarker </item>
                  <item>nonSpeechDataFilter </item>
                  <item>premphasizer </item>
                  <item>windower </item>
                  <item>fft </item>
                  <item>melFilterBank </item>
                  <item>dct </item>
                  <item>liveCMN </item>
                  <item>featureExtraction </item>
              </propertylist>
          </component>
          <!-- ******************************************************** -->
          <!-- The frontend pipelines                                   -->
          <!-- ******************************************************** -->
         
          <component name="speechClassifier"
                      type="edu.cmu.sphinx.frontend.endpoint.SpeechClassifier">
              <property name="threshold" value="13"/>
          </component>
         
          <component name="nonSpeechDataFilter"
                      type="edu.cmu.sphinx.frontend.endpoint.NonSpeechDataFilter"/>
         
          <component name="speechMarker"
                      type="edu.cmu.sphinx.frontend.endpoint.SpeechMarker" >
              <property name="speechTrailer" value="50"/>
          </component>
         
         
          <component name="premphasizer"
                      type="edu.cmu.sphinx.frontend.filter.Preemphasizer"/>
         
          <component name="windower"
                      type="edu.cmu.sphinx.frontend.window.RaisedCosineWindower">
          </component>
         
          <component name="fft"
                  type="edu.cmu.sphinx.frontend.transform.DiscreteFourierTransform"/>
         
          <component name="melFilterBank"
                  type="edu.cmu.sphinx.frontend.frequencywarp.MelFrequencyFilterBank">
          </component>
         
          <component name="dct"
                  type="edu.cmu.sphinx.frontend.transform.DiscreteCosineTransform"/>
         
          <component name="batchCMN"
                     type="edu.cmu.sphinx.frontend.feature.BatchCMN"/>

          <component name="liveCMN"
                     type="edu.cmu.sphinx.frontend.feature.LiveCMN"/>
         
         
          <component name="featureExtraction"
                     type="edu.cmu.sphinx.frontend.feature.DeltasFeatureExtractor"/>
         
          <component name="microphone"
                     type="edu.cmu.sphinx.frontend.util.Microphone">
              <property name="closeBetweenUtterances" value="false"/>
          </component>

          <component name="dataDumper"
              type="edu.cmu.sphinx.frontend.util.DataDumper"/>
         
          <!-- ******************************************************* -->
          <!--  monitors                                               -->
          <!-- ******************************************************* -->

      <!--   
          <component name="accuracyTracker"
                      type="edu.cmu.sphinx.instrumentation.AccuracyTracker">
              <property name="recognizer" value="${recognizer}"/>
              <property name="showAlignedResults" value="false"/>
              <property name="showRawResults" value="false"/>
          </component>
         
          <component name="memoryTracker"
                      type="edu.cmu.sphinx.instrumentation.MemoryTracker">
              <property name="recognizer" value="${recognizer}"/>
          </component>
         
          <component name="speedTracker"
                      type="edu.cmu.sphinx.instrumentation.SpeedTracker">
              <property name="recognizer" value="${recognizer}"/>
              <property name="frontend" value="${frontend}"/>
          </component>
         
          <component name="configMonitor"
                          type="edu.cmu.sphinx.instrumentation.ConfigMonitor">
              <property name="showConfig" value="false"/>
          </component>

          <component name="recognizerMonitor"
                      type="edu.cmu.sphinx.instrumentation.RecognizerMonitor">
              <property name="recognizer" value="${recognizer}"/>
              <propertylist name="allocatedMonitors">
                  <item>configMonitor </item>
              </propertylist>
          </component>
      -->

         
         
         
          <!-- ******************************************************* -->
          <!--  Miscellaneous components                               -->
          <!-- ******************************************************* -->
         
          <component name="logMath" type="edu.cmu.sphinx.util.LogMath">
              <property name="logBase" value="1.0001"/>
              <property name="useAddTable" value="true"/>
          </component>
         
      </config>

       
      • Paul Lamere

        Paul Lamere - 2004-06-12

        Thanks, that helps. How big is the 'jamie' grammar? What kind of load time are you seeing and what is your goal for a load time?

        Paul

         
        • Tekkno Genius

          Tekkno Genius - 2004-06-13

          Here is the jamie grammar. Not very big. All in all about 100 words (including spelling out a some things). I wrote a pilot program for a client. It works, but I need to improve a few things first. Namely, load time and then I'll need to tweak some recognition parameters to produce better recognition in a noisy (factory) atmosphere.

          My goal would be 10-20 seconds at max. I put up a splash screen while it is loading to soften the impact. Which brings me to another point, is there a way to get feedback from the recognizer while it is allocating (that way at least I can put up a progress bar on the splash screen).

          BTW, the load time seems indifferent to the grammar I use. Also, the recognition works fine, but there seem to be gaps during the listening phase. What I mean is that if I give "command slight pause command slight pause command" it recognizes all three commands quickly, but if I do a single command at a time, it seems to take longer. So, I'm wondering how I can correct this. I guess it has to do with the setting for the endpointing????

          Anyway, here is the grammar:
          /**
          * JSGF Grammar for JaMIE
          */
          #JSGF V1.0;

          grammar jamie;

          public <next> = next {next} ;

          public <back> = back {back} ;

          public <save> = save {save} ;

          public <flag> = flag {flag} ;

          public <new> = new {new} ;

          public <pause> = pause {pause} | continue {continue} ;

          public <command> = <next> | <back> | <save> | <flag> | <new> | <pause> ;

          public <yield> = <command> | <zero> | <ones_1_5> ;

          public <quality> = ( <yield> ) | <ones_6_9> ;

          <zero> = zero {0} | oh {0} ;

          <ones_1_5> =  one {1} | two {2} | three {3} | four {4} | five {5} ;

          <ones_6_9> =  six {6} | seven {7} | eight {8} | nine {9} ;

          <ones> = <ones_1_5> | <ones_6_9> ;

          <teens> = eleven {11} | twelve {12} | thirteen {13} | fourteen {14} | fifteen {15} | sixteen {16} | seventeen {17} | eighteen {18} | nineteen {19} ;

          <tens> = ten {10} | twenty {20} | thirty {30} | forty {40} | fifty {50} | sixty {60} | seventy {70} | eighty {80} | ninety {90} ;

          public <schedule> = <pause> | <back>
                              | <ones> {1}
                              | <teens> {1}
                              | <tens> {1} [<ones> {1}]
                              | ( <ones> {100} (hundred {0} | <zero>) {0} <ones> {1}
                              | <ones> {100} [hundred {0} {0}] (<teens> {1} | <tens> {1} [<ones> {1}])
                              ) {schedule};

          public <grader> = <next> | <new> | <pause> |
                            O P T {grader} {1} |
                            L X {grader} {2} |
                            X Z {grader} {3} |
                            Z Z {grader} {4} |
                            K U {grader} {5} |
                            A W {grader} {6} |
                            N F {grader} {7} |
                            K E {grader} {8} |
                            A G {grader} {9} |
                            P J {grader} {10}  |
                            Z C {grader} {11}  |
                            C L B {grader} {12}  |
                            E L {grader} {13}  |
                            O P Y {grader} {14}  |
                            W G {grader} {15}  |
                            E N {grader} {16}  |
                            L I {grader} {17}  |
                            H K {grader} {18}  |
                            D O B {grader} {19}  |
                            N Q {grader} {20}  |
                            S T H {grader} {21}  |
                            N A {grader} {22}  |
                            T J {grader} {23}  |
                            D E {grader} {24}  |
                            K O {grader} {25}  |
                            A O {grader} {26}  |
                            L E {grader} {27}  |
                            S S {grader} {28}  |
                            H X {grader} {29}  |
                            J H {grader} {30}  |
                            G B {grader} {31}  |
                            T Q {grader} {32}  |
                            C M {grader} {33}  |
                            S F {grader} {34}  |
                            E H {grader} {35}  |
                            Y Z R {grader} {36}  |
                            T X {grader} {37}  |
                            L B {grader} {38}  |
                            E B {grader} {39}  |
                            J A B {grader} {40}  |
                            E F D {grader} {41}  |
                            M A C {grader} {42}  |
                            O P Z {grader} {43}  |
                            B A {grader} {44}  |
                            Q K {grader} {45}  |
                            L Q {grader} {46}  |
                            C C C {grader} {47}  |
                            D W X {grader} {48}  |
                            D D {grader} {49}  |
                            Y Z U {grader} {50}  |
                            C V C {grader} {51}  |
                            W X Y {grader} {52}  |
                            E D {grader} {53}  |
                            F B {grader} {54}  |
                            L S {grader} {55}  |
                            H P {grader} {56}  |
                            J Z {grader} {57}  |
                            U Y {grader} {58}  |
                            X R {grader} {59}  |
                            P D {grader} {60}  |
                            O P S {grader} {61}  |
                            A U {grader} {62}  |
                            Y Z J {grader} {63}  |
                            S K {grader} {64}  |
                            I W {grader} {65}  |
                            E F C {grader} {66}  |
                            A I {grader} {67}  |
                            L S D {grader} {68}  |
                            J A {grader} {69}  |
                            I D {grader} {70}  |
                            A L {grader} {71}  |
                            Q R T {grader} {72}  |
                            M D {grader} {73}  |
                            D P {grader} {74}  |
                            J L {grader} {75}  |
                            U V N {grader} {76}  |
                            S D {grader} {77}  |
                            M A {grader} {78}  |
                            W V {grader} {79}  |
                            L S T {grader} {80}  |
                            E F V {grader} {81}  |
                            Y Z F {grader} {82}  |
                            H H {grader} {83}  |
                            L Z {grader} {84}  |
                            G N {grader} {85}  |
                            J E F {grader} {86}  |
                            U V I {grader} {87}  |
                            C N {grader} {88}  |
                            A W X {grader} {89}  |
                            O P W {grader} {90}  |
                            D N {grader} {91}  |
                            Y Z D {grader} {92}  |
                            F X {grader} {93}  |
                            P R F {grader} {94}  |
                            M J F {grader} {95}  |
                            R V {grader} {96}  |
                            T O {grader} {97}  |
                            O L {grader} {98}  |
                            E F M {grader} {99}  |
                            D O {grader} {100} |
                            Y Z A {grader} {101} |
                            G F {grader} {102} |
                            N W X {grader} {103} |
                            M W {grader} {104} |
                            L R {grader} {105} |
                            S S T {grader} {106} |
                            L G {grader} {107} |
                            I W X {grader} {108} |
                            P B {grader} {109} |
                            J J G {grader} {110} |
                            Y L {grader} {111} |
                            L M H {grader} {112} |
                            Z N {grader} {113} |
                            J U {grader} {114} |
                            S C H {grader} {115} |
                            B C D {grader} {116} |
                            Y V {grader} {117} |
                            B V {grader} {118} |
                            N K {grader} {119} |
                            N M {grader} {120} |
                            I U {grader} {121} |
                            S I {grader} {122} |
                            J A H {grader} {123} |
                            R N H {grader} {124} |
                            V V {grader} {125} |
                            J E {grader} {126} |
                            E R {grader} {127} |
                            M B {grader} {128} |
                            E M {grader} {129} |
                            Y A {grader} {130} |
                            M K {grader} {131} |
                            C X {grader} {132} |
                            G H {grader} {133} |
                            A N {grader} {134} |
                            O P A {grader} {135} |
                            N N {grader} {136} |
                            F K L {grader} {137} |
                            N Z {grader} {138} |
                            I T {grader} {139} |
                            B W {grader} {140} |
                            K T {grader} {141} |
                            B U {grader} {142} |
                            I G {grader} {143} |
                            A V {grader} {144} |
                            H T {grader} {145} |
                            M Y {grader} {146} |
                            N U {grader} {147} |
                            A H {grader} {148} |
                            Z U {grader} {149} |
                            M G {grader} {150} |
                            L L L {grader} {151} |
                            G I {grader} {152} |
                            Z A {grader} {153} |
                            U V E {grader} {154} |
                            B W X {grader} {155} |
                            V L {grader} {156} |
                            Y Z S {grader} {157} |
                            W X O {grader} {158} |
                            W H {grader} {159} |
                            R F {grader} {160} |
                            E S {grader} {161} |
                            L E L {grader} {162} |
                            B I {grader} {163} |
                            H R L {grader} {164} |
                            J K L {grader} {165} |
                            M S {grader} {166} |
                            J X M {grader} {167} |
                            K L D {grader} {168} |
                            W X T {grader} {169} |
                            F P {grader} {170} |
                            E T {grader} {171} |
                            T T {grader} {172} |
                            V T {grader} {173} |
                            Z W X {grader} {174} |
                            Y Z T {grader} {175} |
                            W E M {grader} {176} |
                            F D {grader} {177} |
                            U V B {grader} {178} |
                            J B {grader} {179} |
                            Z T {grader} {180} |
                            W X K {grader} {181} |
                            P M C {grader} {182} |
                            P S T {grader} {183} |
                            K L K {grader} {184} |
                            J W {grader} {185} |
                            B H {grader} {186} |
                            W X J {grader} {187} |
                            Y Z V {grader} {188} |
                            G R {grader} {189} |
                            S T W {grader} {190} |
                            P I {grader} {191} |
                            S T Z {grader} {192} |
                            Y D {grader} {193} |
                            M F {grader} {194} |
                            G X {grader} {195} |
                            L C {grader} {196} |
                            G G {grader} {197} |
                            U D {grader} {198} |
                            K L U {grader} {199} |
                            N H {grader} {200} |
                            E F R {grader} {201} |
                            S T T {grader} {202} |
                            E E {grader} {203} |
                            O P O {grader} {204} |
                            M U {grader} {205} |
                            R C P {grader} {206} |
                            D Y {grader} {207} |
                            W X P {grader} {208} |
                            T H {grader} {209} |
                            M I J {grader} {210} |
                            Y W {grader} {211} |
                            J U V {grader} {212} |
                            Y Z M {grader} {213} |
                            W V {grader} {214} |
                            B H {grader} {215} |
                            C J {grader} {216} |
                            S W {grader} {217} |
                            L P K {grader} {218} |
                            Y R {grader} {219} |
                            K V {grader} {220} |
                            L P {grader} {221} |
                            J N {grader} {222} |
                            H L P {grader} {223} |
                            A A B {grader} {224} |
                            M S P {grader} {225} |
                            M H P {grader} {226} |
                            K L R {grader} {227} |
                            J P {grader} {228} |
                            S W X {grader} {229} |
                            B O {grader} {230} |
                            W X M {grader} {231} |
                            D W R {grader} {232} |
                            J R {grader} {233} |
                            J L R {grader} {234} |
                            Y B {grader} {235} |
                            V R {grader} {236} |
                            A A {grader} {237} |
                            J S {grader} {238} |
                            D H {grader} {239} |
                            U V G {grader} {240} |
                            W X R {grader} {241} |
                            S E R {grader} {242} |
                            F J {grader} {243} |
                            U V A {grader} {244} |
                            H G {grader} {245} |
                            B M {grader} {246} |
                            F I J {grader} {247} |
                            C W {grader} {248} |
                            F Y {grader} {249} |
                            G O {grader} {250} |
                            V U {grader} {251} |
                            S A {grader} {252} |
                            U V O {grader} {253} |
                            D G H {grader} {254} |
                            K L W {grader} {255} |
                            K S {grader} {256} |
                            T E {grader} {257} |
                            D Q {grader} {258} |
                            C U T {grader} {259} |
                            E J {grader} {260} |
                            Y Z G {grader} {261} |
                            S S S {grader} {262} |
                            G S {grader} {263} |
                            S R S {grader} {264} |
                            O M {grader} {265} |
                            P K S {grader} {266} |
                            S T P {grader} {267} |
                            T U {grader} {268} |
                            E K {grader} {269} |
                            H J {grader} {270} |
                            H Y {grader} {271} |
                            T I {grader} {272} |
                            U V R {grader} {273} |
                            F H {grader} {274} |
                            M Z {grader} {275} |
                            W X N {grader} {276} |
                            H R {grader} {277} |
                            M S S {grader} {278} |
                            E A {grader} {279} |
                            A P {grader} {280} |
                            C I J {grader} {281} |
                            P G {grader} {282} |
                            J M {grader} {283} |
                            D L S {grader} {284} |
                            S T L {grader} {285} |
                            T P {grader} {286} |
                            S L {grader} {287} |
                            F T {grader} {288} |
                            A K {grader} {289} |
                            U S T {grader} {290} |
                            S O {grader} {291} |
                            W X L {grader} {292} |
                            Y Z I {grader} {293} |
                            M C {grader} {294} |
                            F W {grader} {295} |
                            D W {grader} {296} |
                            W Z {grader} {297} |
                            D R {grader} {298} |
                            X W X {grader} {299} |
                            S T M {grader} {300} |
                            S T X {grader} {301} |
                            C G {grader} {302} |
                            N O {grader} {303} |
                            W X Z {grader} {304} |
                            W W X {grader} {305} |
                            K L X {grader} {306} |
                            K W {grader} {307} |
                            B E {grader} {308} |
                            Q R A {grader} {309} |
                            Q M {grader} {310} |
                            Z K {grader} {311} |
                            A M A {grader} {312} |
                            Y M {grader} {313} |
                            I Z {grader} {314} |
                            M P {grader} {315} |
                            S M {grader} {316} |
                            M I {grader} {317} |
                            S T O {grader} {318} |
                            L W {grader} {319} |
                            M R {grader} {320} |
                            E F U {grader} {321} |
                            C V {grader} {322} |
                            S T B {grader} {323} |
                            O X {grader} {324} |
                            I F {grader} {325} |
                            E F A {grader} {326} |
                            J R W {grader} {327} |
                            C L {grader} {328} |
                            Y Z P {grader} {329} |
                            G J {grader} {330} |
                            C B {grader} {331} |
                            D W W {grader} {332} |
                            Z M {grader} {333} |
                            Y Z H {grader} {334} |
                            J G {grader} {335} |
                            S T C {grader} {336} |
                            C O {grader} {337} |
                            U F {grader} {338} |
                            R B {grader} {339} |
                            J K {grader} {340} |
                            Q K L {grader} {341} |
                            O U {grader} {342} |
                            R S W {grader} {343} |
                            L Y Y {grader} {344} |
                            C P {grader} {345} ;

           
          • Paul Lamere

            Paul Lamere - 2004-06-14

            There's some timing instrumentation built into S4.  If you add a speed tracker to your set of monitors and configure the speedTracker to show timers you can get an idea where the time is being spent during startup. Since you based your config on cardmatch, you probably do not have a speed tracker set up. To set it up edit your s4 config.xml and do the following:

            1) Find the recognizer monitors list (looks like this in cardmatch.config.xml):

                <component name="recognizer"                       type="edu.cmu.sphinx.recognizer.Recognizer">
                    <property name="decoder" value="decoder"/>
                    <propertylist name="monitors">
                        <item>accuracyTracker </item>
                        <item>recognizerMonitor </item>
                    </propertylist>
                </component>

            2) Add a speed tracker like so:

                <component name="recognizer"                         type="edu.cmu.sphinx.recognizer.Recognizer">
                    <property name="decoder" value="decoder"/>
                    <propertylist name="monitors">
                        <item>accuracyTracker </item>
                        <item>speedTracker </item>
                        <item>memoryTracker </item>
                        <item>recognizerMonitor </item>
                    </propertylist>
                </component>

            3) Add the configuration for the speed tracker like so:

                <component name="speedTracker"
                            type="edu.cmu.sphinx.instrumentation.SpeedTracker">
                    <property name="recognizer" value="${recognizer}"/>
                    <property name="frontend" value="${frontend}"/>
                    <property name="showTimers" value="true"/>
                </component>

            Now ... when you run your program you'll get some speed statistics including timers showing the times spent during various initialization phases.

            Here's what I get when I run an4 with timers enabled:

            # ----------------------------- Timers----------------------------------------
            # Name          Count   CurTime   MinTime   MaxTime   AvgTime   TotTime  
            AM_Load         1       18.1190s  18.1190s  18.1190s  18.1190s  18.1190s 
            DictionaryLoad  1       5.3800s   5.3800s   5.3800s   5.3800s   5.3800s  
            compile         1       7.8010s   7.8010s   7.8010s   7.8010s   7.8010s  
              createGStates 1       0.2090s   0.2090s   0.2090s   0.2090s   0.2090s  
              collectContex 1       0.3210s   0.3210s   0.3210s   0.3210s   0.3210s  
              expandStates  1       6.6900s   6.6900s   6.6900s   6.6900s   6.6900s  
              connectNodes  1       0.5750s   0.5750s   0.5750s   0.5750s   0.5750s

            This shows 18 seconds loading the acoustic model, 5 seconds loading the dictionary and 8 seconds compiling the grammar.  (This is on a 1.4ghz p4 running linux). It will be interesting to see what your timings are.  I am guessing that your grammar compile time will be quite a bit higher.

            Currently there is no way to get feedback from the recognizer while it is allocating ... sorry.

            Phil is the endpointing expert. Perhaps he'll chime in and answer your question about endpointing.

             
    • Philip Kwok

      Philip Kwok - 2004-06-14

      By default, the endpointer detects 200ms of speech to determine that an utterance has started, and detects 500ms of silence to determine that an utterance has ended. You can vary these two parameters to suit your response time needs. In your config.xml file, set these parameters (in milliseconds):

      <component name="speechMarker"           type="edu.cmu.sphinx.frontend.endpoint.SpeechMarker" >
          <property name="startSpeech" value="..."/>
          <property name="endSilence" value="..."/>
      </component>

      Hope that helps!

      philip

       

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.