Open raffiniert opened 2 months ago
Hi @raffiniert, you can get the confidence scores per word segment through event.results[x].segments
, however there's a few things to note:
On Android, your mileage may vary based on the recognition service you're using. This seems to be the only public Github repo that implements this functionality for RecognizerIntent.EXTRA_REQUEST_WORD_CONFIDENCE
-- https://github.com/search?q=EXTRA_REQUEST_WORD_CONFIDENCE&type=code
Also of note for Android:
RecognitionPart.CONFIDENCE_LEVEL_UNKNOWN
) at least on my Samsung Galaxy S23 Ultra. -- this will likely have to be fixed upstream on Google's end.com.google.android.as
recognition service (using on device speech recognition). I couldn't verify it to work with com.google.android.tts
and com.samsung.android.bixby.agent
.For iOS:
So to wrap it up, not really working for Android, but does work for iOS. Android will need upstream fixes for this feature to work. In the meantime if you do need to get this consistent across devices, there's two options you could explore:
recordingOptions: { persist: true }
and then send the recognized audio to that service when speech recognition has ended.man you're awesome. I don't have time to deep-dive rn but just wanted to thank you for your reply immediately.
Hope Android will fix it upstream soon and will look into the iOS-solution asap. Thanks again!
Very nice library, thank you so much for all the efforts!
For my project, I would need a confidence score not only on the final result of f.e. a complete sentence, but on a per-word basis. Currently, the confidence score per word is always returned as 0.
Is there any way you could implement this in an upcoming release? I would buy you coffee/beer in large amounts for it :-D