Author Topic: Recognising 3 digit compass heading command  (Read 1817 times)

BuggSmasher

  • Newbie
  • *
  • Posts: 3
Recognising 3 digit compass heading command
« on: August 28, 2023, 06:34:52 AM »
Hi,

I'm writing a Voice Attack profile to recognise a 3 digit number to represent a compass heading, 0 to 360 degrees.

Basically, I've used "Set a Text Value" to a "Variable Name" with the Text:"{CMD}" option, which is then passed to a "Set a Decimal Value" Variable, using "convert Text/Token" {TXTNUM:'variable name'}. I've also set an event log to check and confirm these values are passed on and read correctly, which they appear to be.

First, I had implemented "When I say:" command as "Heading [0..360] [degrees;] and this works well (only generating 722 dynamic commands) when saying "Heading" and then a value in between "0" to "360" degrees" as a complete number i.e. "one hundred",

But when I moved onto the second phase saying headings as a three step number sequence, i.e "0 1 0",  I discovered that from "0 0 0" to "0 9 9" the heading would be "unrecognised", while "1 0 0" to "3 6 0" worked without any problems !

So after some experimenting I added [000..099], or "Heading [0..360] [000..099] [degrees;]"; ( giving rise to 72,922 commands created!) and success!! , but would not recognise values between 0 to 25.  Only =>"0 2 5" did I have success, unless I said "Heading 25" "degrees;"

So I decided to read the VA forums, "How do I . . .https://forum.voiceattack.com/smf/index.php?board=5.0" and "Speaking numbers . . . https://forum.voiceattack.com/smf/index.php?topic=3872.0", article about setting radio frequency comms. This educated me to adjust my syntax to "Heading [0..3] [0..9] [0..9]" [degrees;] ; Heading  [0..360] [degrees;], coming in at  generating 1522 dynamic commands !!

This code now seems to have improved recognition across all ranges when testing, but I still experience major problems around 20 degrees being recognised. Sometimes if I go from ""0 1 0" to "0 2 5" it works fine, but then I get an unrecognised "heading  020", or on a real bad run it will just keep developing "heading  0 to 0". Right now It must know I'm typing this topic and VA hasn't made, nor can I replicate a mistake !

Are there any other things I could do to improve recognition? I've completed Speech Engine Training three or four times, and amended the "Add/Remove Dictionary" with every number from 0 to 25, and 000 to 025, for accuracy improvements.

Best regards,

BuggSmasher
 



Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Recognising 3 digit compass heading command
« Reply #1 on: August 28, 2023, 06:57:52 AM »
But when I moved onto the second phase saying headings as a three step number sequence, i.e "0 1 0",  I discovered that from "0 0 0" to "0 9 9" the heading would be "unrecognised", while "1 0 0" to "3 6 0" worked without any problems !
"000" is not a valid integer number, and as such the leading zeroes are dropped when generating numeric ranges.

I.E. you were generating "heading 0" to "heading 99", which obviously doesn't then match "heading 000" or "heading 099"



On my machine, the speech recognition system recognizes "heading 0 2 5" with lower confidence, and less consistently than "heading 025", so you may want to try explicitly listing those three digits without spaces.

I.E.
Code: [Select]
Heading [000;001;002;003;004;005;006;007;008;009;010;011;012;013;014;015;016;017;018;019;020;021;022;023;024;025;026;027;028;029;030;031;032;033;034;035;036;037;038;039;040;041;042;043;044;045;046;047;048;049;050;051;052;053;054;055;056;057;058;059;060;061;062;063;064;065;066;067;068;069;070;071;072;073;074;075;076;077;078;079;080;081;082;083;084;085;086;087;088;089;090;091;092;093;094;095;096;097;098;099] [degrees;];Heading [0..360] [degrees;](speaking "heading one zero zero" should normally be recognized as "heading 100")



Basically, I've used "Set a Text Value" to a "Variable Name" with the Text:"{CMD}" option, which is then passed to a "Set a Decimal Value" Variable, using "convert Text/Token" {TXTNUM:'variable name'}. I've also set an event log to check and confirm these values are passed on and read correctly, which they appear to be.
That can certainly work, but if you consult the documentation for the the "{TXTNUM:}" token, you might notice that it takes literal values as well, I.E. what you type in manually, or another token is replaced by (all tokens are replaced by literal text; that is a basic principle of that feature).
Said value needs to be wrapped in double quotes to indicate that it is a literal value rather than a variable name.

Because of this, you can pass the "{CMD}" token directly to the "{TXTNUM:}" token, rather than using a text variable:
Code: [Select]
{TXTNUM:"{CMD}"}