syl22-00 / pocketsphinx.js

Speech recognition in JavaScript and WebAssembly
1.49k stars 261 forks source link

Example non-english keyword detection #80

Open Nixellion opened 7 years ago

Nixellion commented 7 years ago

Hello! I have troubles trying to figure out how to setup non-english keyword detection (live_kws.html). I tried just adding a word and it's phoneme into the var wordList and var keywords, but it does not work with non-latin characters.

And from the live_kz.html demo I see that I have to add another dictionary, the one that would translate english keywords into proper utf-8 non-latin (cyrillic in my case) strings.

Now, i'm going to dig into documentation and API and I hope I'll find some guidance there, but it would be great to have an example for non-latin keyword\hotword detection.

Thanks.

Nixellion commented 7 years ago

Oh, I see that I will probably need a version of pocketsphinx.js compiled for russian language? You have chinese compiled in examples, could someone who already has everything setup for compiling, please, help me out and compile pocketsphinx.js with russian acoustic model?

Thanks!

nshmyrev commented 7 years ago

Compilation is described in README:

https://github.com/syl22-00/pocketsphinx.js#2b-compilation-with-custom-models-and-dictionary

Maybe you can try the steps and report the problems instead

Nixellion commented 7 years ago

@nshmyrev

Thank you for reply. Steps there are clearly meant for linux. I am currently working on windows. And as I said - compiling it for someone who already has everything setup and ready to compile would take a few minutes, for me - it would take hours if not days to set everything up, figure out how, and compile it.

syl22-00 commented 7 years ago

@Nixellion You do not need to recompile pocketsphinx.js, you can (lazy)-load the model, everything is explained in the docs.

Nixellion commented 7 years ago

Ah, ok, sorry, did not notice it.

6gsaifulislam commented 7 years ago

@Nixellion Did you manage to change the model as I am struggling to do the same on a windows 10 setup?

Nixellion commented 7 years ago

@JohnAReid Nope, not yet. I'm also checking out this thing: https://github.com/dreamdom/JsSpeechRecognizer it seems like it might be even more appropriate for keyword spotting, since you can basically train it to react to any sound sample, from what I understand. But it seems like it has to be rewritten a bit to actually be usable in an app.

6gsaifulislam commented 7 years ago

@Nixellion Sorry to hear that - I have been trying most of the day to compile the system and getting errors in vs2015 - I am thinking that it might be easier to install a Linux boot on the pc rather than figure out where windows is going wrong.

syl22-00 commented 7 years ago

emscripten and CMake are both available on Windows, Mac OSX and Linux. Emscripten has a very comprehensive documentation and a github page where issues can also be raised.

Also as I said earlier, you do not need to compile to use custom acoustic or language models, dictionaries or any other specific parameter.

Nixellion commented 7 years ago

Yes, it's available, but it's much simpler to compile stuff in linux anyway.

Thank you anyway :) Will dig further.