Voice recognition, is there a way to determine what the user is saying, perhaps through regular expression?

I use the voice recognition function in android, I can speak on my device and present a list of possible words.

When I say "start", he gives me the following words that he considered heard:

  • stocks
  • stock
  • stop
  • start
  • stops
  • Starkov

This list will depend on user accents among other factors. Is there an easy way to check this list for a specific word?

If the user issues a "start" or "stop" command, I need to indicate the difference between the two commands.

My initial thought was to use a regular expression to check for "sta" or "sto" in any of the answers, is there a better way?

+3
source share
1 answer

As a rule, I suggest you create Soundex for each word that you return, type the entire list against the Soundexes of words that you are looking for as part of the characters that are compared and use these ratings to decide which word is most likely to match.

For example, start coding to S363and stop coding to S310. By copying them against words as a percentage of the characters matching the results in the following table:

Word    Soundex  S363   S310
----    -------  ----   ----
stocks  S320     0.50   0.75
stock   S320     0.50   0.75
stop    S310     0.50   1.00
start   S363     1.00   0.50
stops   S312     0.50   0.75
starks  S362     0.75   0.50
                 ----   ----
Average Score    0.63   0.71

, ( , , , , ), . , , .

, , , , , . Soundex . , (, , ).

.

+3

Source: https://habr.com/ru/post/1791675/


All Articles