Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi! I'm devloping a speech recognition app using 'watson-html5-speech-recognition'. How can I constrain the recognition context to recognize only numbers (i.e the recognized word should be a number e.g 101, 40, 76, 4.. etc) and not (one hundred and one, forty, seventy six, four.. etc).

I'm working on a math app, where the result should never be a string text, just numbers. Thanks


What I have tried:

I tried using javascript to parse the recognized text(if isNumber()) after recognition, but I think it will be better to constrain the spoken words to only numbers before recognizing and not after..
Posted
Updated 18-May-19 5:31am

1 solution

Speech recognition converts spoken words to string, and I do not think it is possible, nor suitable, to entangle with the speech recognition engine for that. Moreover, you cannot recognize anything before having it parsed in the first place (from audio signal to actual string).
Real-One wrote:
I think it will be better to constrain the spoken words to only numbers before recognizing and not after.

You may have to reconsider this opinion :)
Kindly.
 
Share this answer
 
Comments
Real-One 19-May-19 1:02am    
Thanks for your response phil.o.

..but how do I achieve this. For instance when I say 'five' it transcribes to '5' (which is fine), but when I say 'three' it often transcribes to 'free' (which is not what I want). Is there a work around to this?
phil.o 19-May-19 4:03am    
I do not know. It could be an issue in the recognition engine itself, or it could be a mis-pronunciation of the user, or a combination of both. For this kind of issue, you may have better answers on the developpers' forum[^] itself.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900