Code Monkey home page Code Monkey logo

Comments (16)

syl22-00 avatar syl22-00 commented on September 13, 2024

@sunilindia , first, I advise you to make an out-of-source build, for instance inside a build folder. So from the base of the sources, run:

$ mkdir build
$ cd build
$ cmake -DEMSCRIPTEN=1 -DCMAKE_TOOLCHAIN_FILE=path_to_emscripten/emscripten/cmake/Platform/Emscripten.cmake -DHMM_BASE=./ -DHMM_FOLDERS=Espx -DLM_BASE=./Espx_lm -DLM_FILES=Espx.lm -DDICT_BASE=./Espx_lm -DDICT_FILES=Espx.dic ..
$ make

It just worked for me with your files.

Then, I see you modified live.html, but with a few mistakes:

  • You should have postRecognizerJob({ command: 'initialize', data: [["-hmm", "Espx"], ["-dict", "Espx.dic"],["-lm", "Espx.lm"]]},
  • Do not call feedWords in your callback as you want to use the words from your own dictionary instead of the ones I put in the demo. Similarily, there is no call to feedGrammar or addGrammar as you want to use your own language model.
  • When you call start, don't give it an id as, again, you want to use your own language model instead of a grammar.

I hope that helps

from pocketsphinx.js.

sunilindia avatar sunilindia commented on September 13, 2024

sir please give me sample for custom model intergration

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

Here are the docs @sunilindia :
https://github.com/syl22-00/pocketsphinx.js#2b-compilation-with-custom-models-and-dictionary

if you have any issue in the process, please see my previous comment and provide compiler and JavaScript console outputs.

from pocketsphinx.js.

sunilindia avatar sunilindia commented on September 13, 2024
  1. For custom model intergation i do changes in live.html or recognizer.js
  2. i have already compiled dictionary in pocketsphinx.js but i have an doubt i need to specify it live.html like this
    var wordList = [["ONE", "W AH N"]
    var grammarDigits = { numStates: 1, start: 0, end: 0, transitions: [{ from: 0, to: 0, word: "ONE" }
    var grammarCities = { numStates: 1, start: 0, end: 0, transitions: [{ from: 0, to: 0, word: "NEW-YORK" },

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

@sunilindia recognizer.js is a utility to help interact with pocketsphinx.js, do not modify it.

live.html is a sample application to show how to use pocketsphinx.js, use it as an example, for instance on how to add words to the dictionary (if a word is in a packaged dictionary file, then you do not need to add it with addWord), and how to add grammars. If you use a statistical language model, you probably do not want to add grammars.

from pocketsphinx.js.

sunilindia avatar sunilindia commented on September 13, 2024

i run my testsuite.html it look this
https://www.dropbox.com/s/nhb16gf9dqs68ah/pocketsphinxt.jpg
it correct or not

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

Obviously not, it says "0 assertions of 21 passed, 21 failed".

from pocketsphinx.js.

sunilindia avatar sunilindia commented on September 13, 2024

https://www.dropbox.com/s/3p56jhdv2ekcp18/syl22-00.rar
sir i configure with own acoustic model it shows the below error during recognizing
Loading page
Error in addWords with code [object Object]

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

Hi @sunilindia , if you'd like people to help you resolve your issues you should also do your part of the work and help people help you:

  • Use an open format for files you provide, such as .zip, tar(.gz/bzip), 7z. Rar is not widely available.
  • Document clearly 1. what you have done, 2. where things break, and 3. describe what debugging you have done.
  • Describe your environment.
  • If you attach files, document what they are.

Looking at your files, it is not possible to me to undestand what they all are. One thing I noticed in a file called live644654.html is that you call addWords with ["MAAnAHM", "M AA n AH M"] which mixes uppercase and lowercase in both the word and the phonemes. Are you sure your acoustic model does have the phonemes M, AA, n, AH and M?

from pocketsphinx.js.

sunilindia avatar sunilindia commented on September 13, 2024

dictionary
By using the above dictionary, i got the correct output when i am running this command
pocketsphinx_continuous -hmm <your_new_model_folder> -lm your_lm -dict your_dict.
it recognizes the words correctly in cmd.
Then i wish to integrate this in web application so, i follow the below steps.
https://www.dropbox.com/s/b0dszzt1vowdwwf/webapp.zip
I have generated the own pocketsphinx.js by using this command
cmake -DEMSCRIPTEN=1 -DCMAKE_TOOLCHAIN_FILE=path_to_emscripten/emscripten/cmake Platform/Emscripten.cmake -DHMM_BASE=./ -DHMM_FOLDERS=Espx -G"Unix Makefiles" /Desktop/pocketsphinx
then, i place that generated pocketsphinx.js file in js folder of webapp.
Then, i made two changes in live.html file

live

live1
after changing these things in html fle, i got an error like this
Error in addWords with code [object Object]
I have another doubt, if i compile pocketsphinx.js file with our own language model and dictionary what are the changes i have to made?

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

@sunilindia . First, to integrate your dictionary and language model files, you need to add them when you run cmake. I gave you the command above. If you're on Windows, as explained in the emscripten toolchain file, you need to use "MinGW Makefiles" generator and 'mingw32-make' version of make.

Then, when you post the initialize job to the recognizer, you must add all command-line parameters you would use with pocketsphinx_continuous (ie. in your case, -hmm, -lm and -dict).

Then, of course, since you already have the dictionary and the language model loaded at init time, do not call addWords and then addGrammar in the callback. Once initialize is done, you're good to go!

from pocketsphinx.js.

sunilindia avatar sunilindia commented on September 13, 2024

live

As you said, I made two changes in live.html file as shown in the above image file
I got the output like this, but recognition accuracy is less , most of the time it displays
plz give suggestion to improve accuracy.
live1

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

@sunilindia it seems like you're good to go, at least with pocketsphinx.js, congratulations! I believe your issue with silent audio is the same as what we're just discussing there:
#9

It seems to be a Firefox bug.

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

@sunilindia as mentioned in the issue above, this issue should be now resolved with the proposed hack.

from pocketsphinx.js.

sunilindia avatar sunilindia commented on September 13, 2024

sorry didn't understood what you mean proposed hack

from pocketsphinx.js.

syl22-00 avatar syl22-00 commented on September 13, 2024

@sunilindia my previous comment was referring to issue #9 in which we talk about a hack that fixes your issue, please look at it if you still have this issue of silent input.

from pocketsphinx.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.