Speech Recognition using PocketSphinx on Win32

4673 days ago

The zeroth thing you need is the Pocketsphinx binaries.

Just download the win32 binaries from the Sphinx website (download pocketsphinx, sphinxbase, sphinxtrain and cmuclmtk from the Sphinx website).

The first thing you need to do is build a language model or a grammar.

The grammar can be something simple in a format called JSGF, and this is the easier way to get a speech recognizer up and running. Alternatively, you can use a language model. The language model can be built using the instructions on the Sphinx site. You can create it starting from a file with sentences like this:

<s> I WANT A NEXTCUBE ZERO FOUR ZERO </s>
<s> I WANT THE NEXTCUBE ZERO FOUR ZERO </s>
<s> I NEED A NEXTCUBE ZERO FOUR ZERO </s>
<s> I NEED THE NEXTCUBE ZERO FOUR ZERO </s>
<s> I AM LOOKING FOR A NEXTCUBE ZERO FOUR ZERO </s>
<s> I AM LOOKING FOR THE NEXTCUBE ZERO FOUR ZERO </s>
<s> I AM SEEKING A NEXTCUBE ZERO FOUR ZERO </s>
<s> I AM SEEKING THE NEXTCUBE ZERO FOUR ZERO </s>

A sample JSGF file would be (modified from the sample on the Sphinx website) … note that I’ve made all the words capitals because the CMU phonetic dictionary has all the words listed in caps (make sure that any language model is all caps as well, except for the sentence boundaries):

#JSGF V1.0;
/**
 * JSGF Grammar for Hello World example
 */
grammar hello;
public <greet> = (GOOD MORNING | HELLO | HI) ( PAUL | RITA | WILL );

The second thing you need is an Acoustic Model

An acoustic model maps sound features from the speech recognizer to phonemes.
Voxforge provides a free acoustic model for Pocketsphinx that you can use.

The third thing you need is a phonetic dictionary

The phonetic dictionary maps the recognized phonemes to actual words in your language. For English, there is a phonetic dictionary available from CMU

You will just need to download one file: cmudict.0.7a_SPHINX_40

Now, you have all the components you need!

Running Pocketsphinx

With JSGF:

$ pocketsphinx-0.7-win32/pocketsphinx_continuous.exe \
-hmm voxforge-en-r0_1_3/model_parameters/voxforge_en_sphinx.cd_cont_3000 \
-jsgf greet.jsgf \
-dict cmudict.0.7a_SPHINX_40

With a language model:

$ pocketsphinx-0.7-win32/pocketsphinx_continuous.exe \
-hmm voxforge-en-r0_1_3/model_parameters/voxforge_en_sphinx.cd_cont_3000 \ -lm cmuclmtk-0.7-win32/output.lm.DMP \
-dict cmudict.0.7a_SPHINX_40l

Any additional phonetic entries in the phonetic dictionary can be created using the CMU dictionary phoneme set

Education

  1. Videos on speech recognition
  2. Lectures on speech recognition
  3. Voxforge has an article on what an acoustic model is
Cohan Sujay Carlos

User Guides,

Comment

---

What's Vaklipi?

4781 days ago

Vaklipi


The Vaklipi language lets you program using a natural language, for example, English or Hindi.

You no longer have to learn the complex syntax of a formal programming language in order to make a computer or a robot do what you want.

If you wanted a human to say “Rumpelstiltskin”, the words you would use would probably be: ‘Say “Rumpelstiltskin”’ …

If you typed that into Vaklipi, Vaklipi would just print the word “Rumpelstiltskin” on the screen.

If you typed ‘What is 2*3?’ it would print 6.0.


Use Cases


We believe that computer users should not have to learn a formal programming language in order to get the computer to do anything for them.

Imagine the following scenario:

You have a record of your expenditure for the month in a file on your computer, and now you want to add up the numbers.

If you were a programmer, you would write a script to add the numbers up.

But if you were not, what would you do?

If you were using Vaklipi, you could just type something like …

‘Add up all the numbers in the second column of the file “expenses.txt” in the directory C:\finances’

… and it would be done!


Domain Adaptation


Since Vaklipi could find use in a variety of situations, we provide means for vendors and technology partners to extend Vaklipi.

The extension interface uses the concept of selectors, which are identifiers of objects in the real world.

Examples are file pathnames and urls.

Vaklipi handles the natural language intricacies surrounding selectors and lets the technology partner develop the domain specific capabilities for doing things with them without having to take any human languages into account.


Multilingual


What’s more, instructions can be given in any of a large number of human languages.

Another cool thing about Vaklipi is that a program that you write using a particular language, say English, on Vaklipi, can be read by another user in another human language, say Chinese.

You can find a set of tutorials in the section on Vaklipi.


Cohan Sujay Carlos

Vaklipi,

Comment

---