vosk-android-demo icon indicating copy to clipboard operation
vosk-android-demo copied to clipboard

onPartialResult callback and grammar

Open matanel-6over6 opened this issue 1 year ago • 11 comments

First of all it works great and fast.

  1. onPartialResult callback called several times if I say one word, why?
  2. I have grammar(json array) and If I say a word that is not on the list, he still returns one of the words on the list. There is no option to identify that there is no match at all? Thanks for the help

matanel-6over6 avatar Feb 07 '24 20:02 matanel-6over6

onPartialResult callback called several times if I say one word, why?

Partial results returned 5 times a second to provide you real-time updates.

I have grammar(json array) and If I say a word that is not on the list, he still returns one of the words on the list. There is no option to identify that there is no match at all?

Add a special [unk] word to the list

nshmyrev avatar Feb 07 '24 21:02 nshmyrev

Thanks for the fast answer. This is my json array: ["yes","no","none","next","zero","one","two","three","four","red","blue","green","yellow","white"]

I say 'five' and i get four

matanel-6over6 avatar Feb 07 '24 21:02 matanel-6over6

You need to add "[unk]" to the list

nshmyrev avatar Feb 07 '24 22:02 nshmyrev

["yes","no","none","next","zero","one","two","three","four","red","blue","green","yellow","white", "[unk]"] like this? I say five and from onPartialResult i get four but from onFinalResult i get [unk]. why?

matanel-6over6 avatar Feb 08 '24 08:02 matanel-6over6

I sat seven and i get in the first onPartialResult "zero" and after that i get [unk]

Screenshot 2024-02-08 at 11 22 53

matanel-6over6 avatar Feb 08 '24 09:02 matanel-6over6

Yes, partial results are preliminary and not very reliable

nshmyrev avatar Feb 08 '24 11:02 nshmyrev

Is it just the first time? I can count on it the second time and onwards will be [unk]?

matanel-6over6 avatar Feb 08 '24 11:02 matanel-6over6

There is an option to get reliability or score in onPartialResult?

matanel-6over6 avatar Feb 08 '24 12:02 matanel-6over6

You can find more accurate model, yes! In general it is very hard to spot words in realtime, you'd better have some delay.

nshmyrev avatar Feb 08 '24 14:02 nshmyrev

Thanks a lot

matanel-6over6 avatar Feb 08 '24 14:02 matanel-6over6

Last question, where can I find a more accurate and slimmer model?

matanel-6over6 avatar Feb 08 '24 15:02 matanel-6over6