Sunday, September 9, 2012

Speech Recognition with PocketSphinx

The following post puts together information from different sources about speech recognition and gives a brief overview of the CMUSphinx project and how to get started with PocketSphinx on Windows.

CMUSphinx project is an open source speech recognition project developed at Carnegie Mellon University, which consists of various tools use to build speech applications:
  • CMUclmtk — language model tools
  • Sphinxtrain — acoustic model training tools

The following recognizers (decoders)
  • Pocketsphinx: Designed to be fast and for real time speed written in C, supports desktop applications and mobile devices. It  needs the library Sphinxbase.
  • Sphinx3: Speed recognizer intended for researchers .
  • Sphinx4: Speech recognition written in the Java.

Let’s learn how HMM based speech recognition is handled: it functions by first learning the characteristics (or parameters) of a set of sound units, and then using what it has learned about the units to find the most probable sequence of sound units for a given speech signal. The process of learning about the sound units is called training. The process of using the knowledge acquired to deduce the most probable sequence of units in a given signal is called decoding, or simply recognition.

Setup Pocketsphinx  on  windows

Environment: Windows 7 and Visual Studio 2012, sphinxbase-0.7, pocketsphinx-0.7

Name the folders (sphinxbase / pocketsphinx ), the project pocketsphinx has external dependencies that use the relative paths like the following  “..\..\..\sphinxbase\include\sphinxbase\ad.h”.

To test the installation let's run pocketsphinx_continuous.exe, this tool runs speech recognition both continuous listening from microphone and continuous file transcription. To run it requires:
  • Copy sphinxbase.dll to the build folder, for example C:\Project\SpeechRecognition\CMUSphinx\pocketsphinx\bin\Debug.
  • The parameter –hmm, the directory containing acoustic model files.
  • The parameter –lm, word trigram language model input file.
  • The parameter –dict,  main pronunciation dictionary (lexicon) input file.

This is running the command with the information contained in the project.

pocketsphinx_continuous.exe -hmm C:\Project\SpeechRecognition\CMUSphinx\pocketsphinx\model\hmm\en_US\hub4wsj_sc_8k 
-dict C:\Project\SpeechRecognition\CMUSphinx\pocketsphinx\model\lm\en_US\cmu07a.dic 
-lm C:\Project\SpeechRecognition\CMUSphinx\pocketsphinx\model\lm\en_US\wsj0vp.5000.DMP


this is the output of me saying “no no no”

New Picture (2)

I will take a closer look at the project to check more the accuracy of the recognition.

Terminology

language model assigns a probability to a sequence of m words P(w1, .., w1) by means of a probability distribution. Language modeling is used in many natural language processing applications such as speech recognition, machine translation, part-of-speech tagging, parsing and information retrieval. In speech recognition and in data compression, such a model tries to capture the properties of a language, and to predict the next word in a speech sequence.

HMM: (Hidden_Markov_model)  is a statistical Markov model in which the system being modeled is assumed to be a Markov process with unobserved (hidden) states.

Resources:

41 comments:

  1. I run this example, but I get error :(

    ReplyDelete
  2. Great tutorial!! it worked perfect. Thank you

    ReplyDelete
  3. Do you have a tutorial about how to compile the "hello world" example on Windows?

    ReplyDelete
  4. Getting this...
    ERROR: "acmod.c", line 84: Acoustic model definition is not specified neither with -medef option nor with -hmm
    :(

    ReplyDelete
  5. getting this error plz help me out


    READY....
    ERROR: "pocketsphinx.c", line 625: No search module is selected, did you forget
    to specify a language model or grammar?
    FATAL_ERROR: "continuous.c", line 274: Failed to start utterance


    ReplyDelete
  6. I got this error

    Debug Assertion Failed!

    Program: .....Parser.exe

    file f:\dd\vctools\crt_bld\Self_x86\crt\src\fopen.c

    Line 54

    Expression: (file!=NULL)"

    Could you please help me??

    ReplyDelete
  7. Thanks for the explanation. It works!

    ReplyDelete
  8. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  9. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  10. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  11. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  12. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  13. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  14. Great Post,really it was very helpful for us.
    Thanks a lot for sharing!
    I found this blog to be very useful!!
    Python training in Bangalore

    ReplyDelete
  15. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  16. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  17. Reading Buddy Software is advanced, speech recognition reading software that listens, responds, and teaches as your child reads. It’s like having a tutor in your computer

    ReplyDelete
  18. Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.

    digital marketing coaching in hubli

    ReplyDelete
  19. Great Post. It is really very helpful. Thanks for sharing!
    Python training in Bangalore

    ReplyDelete
  20. Nice Article, Great experience for me by reading this info. Thanks for sharing the information with us.keep updating your ideas.

    Looking for the best ppc course in Bangalore? Learn PPC from Ranjan Jena, 10+ Years Expert Google Ads Trainer. 1000+ Students Trained @ eMarket Education, Koramangala, Bangalore.
    Best Online Digital Marketing Courses in Bangalore, India
    Best Digital Marketing Institute in Bangalore

    ReplyDelete
  21. Awesome post Maam,
    really appreciate for your writing. This blog is very much useful...
    Looking for the best ppc course in Bangalore? Learn PPC from Ranjan Jena, 10+ Years Expert Google Ads Trainer. 1000+ Students Trained @ eMarket Education, Koramangala, Bangalore.
    Best Online Digital Marketing Courses in Bangalore, India

    ReplyDelete
  22. Very informative blog and useful article thank you for sharing with us
    by cognex is the AWS Training in Chennai

    ReplyDelete
  23. I am very happy to have seen your blog. Thanks again for all the details.
    Data Science Training in Lucknow

    ReplyDelete
  24. Chemistry is our forte. We provide chemicals ranging from fine chemcials for early R&D application to large scale industrial production. Glycidol (556-52-5 ) manufacturer USA is a leading developer, manufacturer and exporter of API, intermediates of API, Fragrance intermediates, Specialty Chemicals & other Customized Products.
    Located in Asia's largest chemical industrial estate, Rampur, U.P., Agex Pharma begins its operations as a small scale unit in 1990 and in a span of three decades in market has emerged as a leading player
    which believes in quality. Today with an inventory of 500+ products, 200+ clients globally Agex Pharma has placed itself in one of the most sought after companies in the nation for Fine and Rare Specialty
    chemicals.Our business is based on a simple philosophy: to provide our customers with high quality fine chemicals at reasonable prices and with fast turn-around schedules.

    ReplyDelete
  25. Thank you so much for sharing this nice article.
    Introducing our Next Level Complete Laundry Management & Dry-Cleaning software. Connect with us to get accelerated and cost-effective Laundry Management Software.
    Visit Now: https://syswash.net/

    ReplyDelete
  26. Such an ideal piece of blog. It’s quite interesting to read content like this. I appreciate your blog

    Best Homecare Services in Bangalore
    caregiver services in bangalore

    ReplyDelete
  27. Thanks for sharing this blog its very helpful to implement in our work
    Marketing Agency in Dubai

    ReplyDelete
  28. If you are searching for an Ethical Hackers Academy then you should be join Cyber Crime Awareness Society. Cyber Crime Awareness Society is one of the Best Online Ethical Hacking Institute In Jaipur. Cyber Crime Awareness Society is IT Consulting Company managed by Ethical Hackers & IT professionals, working with Police Agencies and Cyber Crime Cell of Government in India. It is also backed by a team of Experts working with RAW, CBI, ATS, IB and Cyber Crime Cell with an aim to create India the safest place of internet in the World

    ReplyDelete
  29. Unified communications and Ip Pbx includes the connection of various communication systems both for the collaboration tools as the digital workforce.

    ReplyDelete
  30. Thanks for sharing this awesome and informative article. Your post has really made it easy to understand. I have also written some technical blogs at:

    https://www.programink.com/python-training-in-bangalore.html
    https://www.programink.com/django-training-in-bangalore.html
    https://www.programink.com/aws-training-in-bangalore.html
    https://www.programink.com/devops-training-in-bangalore.html
    https://www.programink.com/selenium-training-in-bangalore.html
    https://www.programink.com/data-science-training-courses-in-bangalore.html

    ReplyDelete