Comments (16)
@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 tofeedGrammar
oraddGrammar
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.
sir please give me sample for custom model intergration
from pocketsphinx.js.
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.
- For custom model intergation i do changes in live.html or recognizer.js
- 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.
@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.
i run my testsuite.html it look this
https://www.dropbox.com/s/nhb16gf9dqs68ah/pocketsphinxt.jpg
it correct or not
from pocketsphinx.js.
Obviously not, it says "0 assertions of 21 passed, 21 failed".
from pocketsphinx.js.
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.
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.
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
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.
@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.
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.
from pocketsphinx.js.
@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.
@sunilindia as mentioned in the issue above, this issue should be now resolved with the proposed hack.
from pocketsphinx.js.
sorry didn't understood what you mean proposed hack
from pocketsphinx.js.
@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)
- lazyLoading, Module.FS_createPath not found (emscripten compilation without accoustic model) HOT 1
- some time when click on start i am getting Cannot change search while decoding, end utterance first HOT 1
- FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory HOT 2
- Words.push_back accept 1 arguments only HOT 1
- Trying to build but submodules fail HOT 2
- BindingError with self-compiled pocketsphinx.js HOT 2
- Change threshold to increase accuracy detection HOT 2
- in web form asp.net? HOT 2
- Can't install with npm HOT 1
- Webapp.js file is missing HOT 1
- Buffer in recognizer uses obsolete data on multiple "process"-requests
- issue with make
- Web Worker Lazy Load Command - Outgoing Message is Empty HOT 1
- Compilation Failed In Custom Acoustic Model
- Grammar for numbers? HOT 5
- Pocketsphinx within web worker
- live.html demo no longer works in Chrome, only Firefox
- Compilation into WebAssembly fails HOT 1
- Sorry if I laugh HOT 1
- Local host not working with chrome
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pocketsphinx.js.