[Solved] I wonder if this component could only do number recognition

I’ve been trying to get this component to do number recognition, the problem is that when I say 1, 2 or 3 it turns me into one, two or three and my idea is that I only want whole numbers and not written in full.
I appreciate any help.
Rec

1 Like

This is the image with the resolution of the problem, for those who are interested.
Solved

I am sure you can appreciate the fact that if the recognizer could be tuned to do number only recognition, it would not react gracefully if it picks up the word “computer” when it was expecting “seven”.

What you need is to build around this, being already grateful that the system apparently does not confuse “two” with “too” and “to”.

That said, I tried the speech recognizer, and when saying “one two three”, it returned “1 2 3” (my test app is configured to display and read back aloud what it picked up). I even tried saying “one hundred and twenty eight” and got “128” back, which possibly the best anyone can expect.
(I however had an issue with “ten”, which the system occasionally claimed was “send”).

I tried “one million” and got “1 million”. But “one million five hundred and thirty three thousand two hundred seventy nine” returned “1533279”. This is not always perfect, as the recognition of another complex value “five hundred twenty eight thousand three hundred twenty one” stubbornly returns 520-8321.

The fact is that Google takes care of the speech recognition, so your are more or less depending on them improving the system, not on Thunkable. And in many instances, the recognition is less than perfect – which is why I decided against making one of my app offering voice command.

How many numbers does you app need to detect? If there is a limited choices, you can always add a block to check if the value returned is a number, if it is seen as a single entry or separated digits (i.e. one two three is seen as 123 as opposed as 1-2-3) and so on, and then have a procedure to replace “one” by “1” and concatenate entries to make one number from multiple digits.

And you would do this by having a list with “one”, “two”, “three” etc.
If whatever the speech recognizer is found as an element of the list, then it returns the index of that table as a value, effectively turning “two” into the cardinal number 2.
Of course, this plan breaks down if you want to add ‘zero’, in which you’d probably need a second table populated with the numeric values 0, 1, 2 etc, aligned with the list with ‘zero’, ‘one’, ‘two’ etc.

My only problems were with Zero, one, two and three. But it’s already settled. Thanks.

Your structure is not optimized. If you already have determined that it was “um”, you are still checking for it being “dois”, which is uncalled for.
You need nested “else if” that will bail out as soon as one value is identified and matched.
And if the value was ALREADY recognized to be a number, you can skip the whole matching to text logic.

[quote=“CBVG, post:5, topic:259257, full:true”]
Your structure is not optimized. If you already have determined that it was “um”, you are still checking for it being “dois”, which is uncalled for.
You need nested “else if” that will bail out as soon as one value is identified and matched.
And if the value was ALREADY recognized to be a number, you can skip the whole matching to text logic.
[/quote]Friend, for what I intended. Is perfect.
Thank you very much.