-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
whisper grammar: experimental implementation with boost::spirit #2127
base: master
Are you sure you want to change the base?
Conversation
I'm interested in alternate grammar implementations, since the existing one has odd accuracy issues, especially when it comes to matching whole words from the grammar. But what does this branch do? It doesn't seem to substitute the boost::spirit implementation in place of the existing grammar implementation. |
True. It doesn't replace the original, but adds a I guess you can just plug an example input exhibiting these issues into the test code and see if boost::spirit behaves differently and, if it doesn't, if it can be easily fixed. Let me know if you need help with that. |
Having said that, I would also say it may be better to fix the problem in the original implementation. I am fairly familiar with the grammar parser, so If you give me an example grammar input demonstrating the oddities, I may be able to suggest a fix. |
The only grammar I have is a very large one. If I can figure out how to cut it down to where it reproduces the problem, I will. I imagine the problem is that whisper.cpp's grammar is character-based, and if it finds multiple possibilities that begin with the same prefix, but can't decide between them, it terminates recognition at the common prefix, instead of realizing that an incomplete word is not a match. |
Okay, but that doesn't sound like a parser bug, unless you have some modification in mind. |
It's a bug in how whisper.cpp applies grammars, though. It does me no good to get a response back from Whisper that doesn't match the grammar I gave it. |
Fair enough, but the application of the grammar is terra incognita for me. Want to help, but I don't know if I could. @ggerganov what do you think? |
A repro would be needed - without a specific example of the problem, I don't think we can do anything |
An explorative re-implementation of @ejones's parser which IMHO captures the advantages and disadvantages of
boost::spirit
very well.