How to use CMU Sphinx 4 for speech to text with english voxforge models
Asked Answered
W

1

10

I'm trying to figure out how to use sphinx4 or pocketsphinx with the english voxforge model but I can't get it working. I have tried to read doc pages (like this one http://cmusphinx.sourceforge.net/sphinx4/doc/UsingSphinxTrainModels.html ) but it does not help me.

What I want is an executable where I can specify which model to use and which audio file to use as source and have the executable print out it's best guess about what the voice on the recording says.

I hade some luck with: pocketsphinx_continuous -infile recording.wav 2> /dev/null

But it aborts before the complete audio file is transcribed and the default model has waay to few words to create a readable text from the audio.

I have compiled and tested the demos in sphinx4 source package but all the examples seem to have to few words and needs a model loke the voxforge one to be useful to me.

How can I set this up?

Whinstone answered 31/12, 2011 at 0:20 Comment(4)
I've been able to modify Sphinx to transcribe using the Voxforge models. The bad news is that even with Voxforge, Sphinx's accuracy is embarrassingly bad. I wouldn't waste your time with Sphinx. It's not usuable at all.Morpheus
@Morpheus what would you recommend as an alternative?Curst
I'm also interested in alternatives. Could you give us anything better? Preferable free?Goldsberry
The author of the blog grasch.net/node/21 used Sphinx with Voxforge to get to 27.9% word error rate, 13.3% after adapting to his voice. This is pretty good for a large language model, and he used it for transcribing text successfully (see a later blog post of his)Imperforate
F
10

It's very simple to plug in Voxforge acoustic model. The main document covering the API is cmusphinx tutorial:

http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4

It's recommended to read it before you start. Please also note that it is recommended to use En_US English Generic acoustic model, it is more accurate than Voxforge.

Step by step you need to do the following:

  • Download voxforge model from sourceforge and unpack it to a folder
  • Checkout sphinx4 from github and build it with gradle
  • Run TranscriberDemo
  • Go to sphinx4-samples/src/main/java/edu/cmu/sphinx/demo/transcriber folder, open Transcriber demo and edit the acoustic model path as below.
  • Edit the location of the audio file in sources if you need another audio file
  • Run demo again and enjoy

That would be it

   // Load model from the folder in your project
   configuration.setAcousticModelPath("file:voxforge-en-0.4/model_parameters/voxforge_en_sphinx.cd_cont_5000");
Femininity answered 2/1, 2012 at 9:41 Comment(8)
very nice answer... i also have similar problem I have downloaded voxforge-en-0.3 from SourceForge, the etc folder has so many jars, I just cant figure out which path should be given... please help and visit #8727889Englishism
I'm not sure what are you talking about. Which jars in etc? There are no jars at all. As for that question, you haven't clearly indicated the problem to solve, no idea what issue do you have there.Femininity
I followed your answer and downloaded VoxForge from sourceforge, However I couldn't configure it to be used with Sphinx4. You said <property name="location" value="file:voxforge_model_folder_name"/>, However that didnt work for me. So I browsed the VoxForge Folder, but tried various combinations... but nothing is working so far... plz Help!! please see the edited answer....Englishism
Acoustic model folder is voxforge-en-0.4/model_parameters/voxforge_en_sphinx.cd_cont_5000Femininity
many thanks to you!!! plz see my edited question at #8727889Englishism
Running java -mx1256m -jar bin/LatticeDemo.jar just results in the exception "Allocation of search manager resources failed"...Morpheus
cmusphinx.sourceforge.net/sphinx4/src/apps/edu/cmu/sphinx/demo/…Morpheus
@Morpheus the link is not valid. Could you check,please?Carbajal

© 2022 - 2024 — McMap. All rights reserved.