Menu

(no subject)

Help
2018-09-12
2018-09-13
  • akshat dashore

    akshat dashore - 2018-09-12

    while creating decoder i.e

    config.set_string('-hmm', path.join(MODELDIR, 'en-us/en-us'))
    config.set_string('-lm', path.join(MODELDIR, 'en-us/en-us.lm.bin'))
    config.set_string('-dict', path.join(MODELDIR, 'en-us/cmudict-en-us.dict'))

    i understood files for -lm and -dict but for -hmm i have 9 files i.e feat.params,feature_transform,mdef,means,mixture_weights,noisedict,noisedict.save,transition_matrices,variances which one to pass till now i didn't found accurate results for hyp().hypstr i.e i got none value

    here is my code

    from os import environ, path
    from pocketsphinx.pocketsphinx import *
    from sphinxbase.sphinxbase import *

    MODELDIR = "/home/user/scribe/model/"
    DATADIR = "/home/user/scribe/pocketsphinx/test/data/"

    config = Decoder.default_config()
    config.set_string('-hmm', path.join(MODELDIR, 'hmm'))
    config.set_string('-lm', path.join(MODELDIR, 'lm/en-us.lm.bin'))
    config.set_string('-dict', path.join(MODELDIR, 'dict/cmu07a.dic'))

    decoder = Decoder(config)

    print("value of decoder",decoder)

    print ("Pronunciation for word 'hello' is ", decoder.lookup_word("hello"))
    print ("Pronunciation for word 'abcdf' is ", decoder.lookup_word("abcdf"))

    decoder.start_utt()
    stream = open(path.join(DATADIR, 'goforward.raw'), 'rb')

    while True:
    buf = stream.read(1024)
    if buf:
    decoder.process_raw(buf, False, False)
    else:
    break
    decoder.end_utt()

    hypothesis = decoder.hyp()
    logmath = decoder.get_logmath()
    print ('Best hypothesis: ', hypothesis.hypstr, " model score: ", hypothesis.best_score, " confidence: ", logmath.exp(hypothesis.prob))

     

    Last edit: akshat dashore 2018-09-12
    • sheharyar masood

      Hi,
      brother I have an issue. That I am confused about sphinx_lm_convert I
      want to convert .lm to .dmp! but it do not recognises the command please
      tell me I am stuck here for a long time! thanks....

      On Wed, 12 Sep 2018, 1:21 pm akshat dashore, akshat@users.sourceforge.net
      wrote:

      while creating decoder i.e

      config.set_string('-hmm', path.join(MODELDIR, 'en-us/en-us'))
      config.set_string('-lm', path.join(MODELDIR, 'en-us/en-us.lm.bin'))
      config.set_string('-dict', path.join(MODELDIR, 'en-us/cmudict-en-us.dict'))

      i understood files for -lm and -dict but for -hmm i have 9 files i.e
      feat.params,feature_transform,mdef,means,mixture_weights,noisedict,noisedict.save,transition_matrices,variances
      which one to pass till now i didn't found accurate results for hyp().hypstr
      i.e i got none value

      here is my code

      from os import environ, path
      from pocketsphinx.pocketsphinx import *
      from sphinxbase.sphinxbase import *

      MODELDIR = "/home/user/scribe/model/"
      DATADIR = "/home/user/scribe/pocketsphinx/test/data/"

      config = Decoder.default_config()
      config.set_string('-hmm', path.join(MODELDIR, 'hmm'))
      config.set_string('-lm', path.join(MODELDIR, 'lm/en-us.lm.bin'))
      config.set_string('-dict', path.join(MODELDIR, 'dict/cmu07a.dic'))

      decoder = Decoder(config)

      print("value of decoder",decoder)

      print ("Pronunciation for word 'hello' is ", decoder.lookup_word("hello"))
      print ("Pronunciation for word 'abcdf' is ", decoder.lookup_word("abcdf"))

      decoder.start_utt()
      stream = open(path.join(DATADIR, 'goforward.raw'), 'rb')

      while True:
      buf = stream.read(1024)
      if buf:
      decoder.process_raw(buf, False, False)
      else:
      break
      decoder.end_utt()

      hypothesis = decoder.hyp()
      logmath = decoder.get_logmath()
      print ('Best hypothesis: ', hypothesis.hypstr, " model score: ",
      hypothesis.best_score, " confidence: ", logmath.exp(hypothesis.prob))


      (no subject)


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/cmusphinx/discussion/sphinx4/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       
  • akshat dashore

    akshat dashore - 2018-09-12

    i resolved the issue by the way thanks lets close the discussion

     
  • akshat dashore

    akshat dashore - 2018-09-13

    @sheharyar send me the link of model you downloaded

     
    • sheharyar masood

      Hi Akshat,
      Actually, I had created it by LMTool, right now I have file available, which is here.... If link is necessary then please tell me I will do something.....

       
    • sheharyar masood

      Hi Akshat,
      Actually, I had created it by LMTool, right now I have
      file available, which is here.... If link is necessary then please tell me
      I will do something.....

      On Thu, 13 Sep 2018, 11:52 am akshat dashore, akshat@users.sourceforge.net
      wrote:

      @sheharyar send me the link of model you downloaded


      (no subject)


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/cmusphinx/discussion/sphinx4/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

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.