Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Grammar Support #32

Open
joeladria opened this issue Feb 6, 2023 · 4 comments
Open

Custom Grammar Support #32

joeladria opened this issue Feb 6, 2023 · 4 comments

Comments

@joeladria
Copy link

Any chance grammar loading will be implemented?

/*! \brief Load a local grammar on the speech structure */

@nshmyrev
Copy link
Contributor

nshmyrev commented Feb 6, 2023

It should be very easy to send a grammar message to configure the recognizer! Please submit a patch or let us know if you need help implementing it!

@joeladria
Copy link
Author

I wish I could help out but my C experience isn't quite at that level unfortunately! I've only found the grammar implementation examples for Python so far... https://github.com/alphacep/vosk-api/blob/master/python/example/test_words.py

@joeladria
Copy link
Author

Looking for some feedback, I tried my hand at making it work.

Asterisk res_speech specifies the loading of grammar files which are then named at load time and then unloaded. Does vosk support or implement these grammar files at all?

In my implementation I've simply used the "name" string as input with the array of words to pass to the model in JSON format. Works nicely, but a bit of a hack. What do you think?

joeladria@4d7e05b

@nshmyrev
Copy link
Contributor

Yup, something like this should work. It needs a bit more love though for full integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants