Author Topic: Speech recognition and command/phrase setup  (Read 5560 times)

0 Members and 4 Guests are viewing this topic.

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Speech recognition and command/phrase setup
« on: November 18, 2014, 03:39:39 AM »
Hi!

Im currently in trile mode and I rely like this product and wanna buy it. But be4 I do, I wanna get some help to get voxcommando to recognize me to a minimum 9 out of 10 commands I give it.
Currently it dose not do that  :(

So im gonna list what I have done this far.

* Using MS SP 11
* Hifi mic open air
* My english accent is pretty good. (I have tried both US and GB)
* my mic registers about 3-10% of voxcommando mic level indicator


Okey so I have set up a baseline: controlling the bed light
i have 2 phrases

Phrase 1. turn, switch, bed light, bed lights
Phrase 2. on, off, bed light on, bed light off, bed lights on, bed lights off, on bed light, off bed light, on bed lights, off bed lights


and then something like (A)contains(B)
if {lastspoken} contains "on"
event.EG.bedlight.ON
else
event.EG.bedlight.OFF


Okey. how can I reach a accuracy of 9 out of 10 commands (accuracy 90%)?

1. Is it possible to get 90% or higher?
2. what is best MS SP 11 or the regular (without training and with training)
3. is it a smart way of setting up the phreses for the commands to help voxcommando?
4. is it possible to run two voxcommando at the same time on the same computer using MS SP 11 and regular with 2 microphones (one mic for each instant of vox) to compare results
5. what else can I do to improve the accuracy?

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #1 on: November 18, 2014, 04:41:20 AM »
Hi tn42 and welcome to VC-Forum.

short help:

1. Yes
2. http://voxcommando.com/mediawiki/index.php?title=Version_2#Choice_of_speech_engines
3. Yes, absolute
4. Yes, is described in the first link at point 5.
5. http://voxcommando.com/forum/index.php?topic=1321.0 / http://voxcommando.com/mediawiki/index.php?title=FAQ


for point 1 + 3: copy and past this group in your command tree (disable or delete your old group). You must first edit the command action for eventghost in this group, because I don't know how it must looks like.
the curly brackets with a number "{1}" which you can see by editing the command, stand for "payload 1" which contain the ON or OFF. Let us know if it works better.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.2.1-->
<commandGroup open="True" name="tn42 bed light" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="443" name="turn bed light ON or OFF" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>EventGhost.Send</cmdType>
      <params>
        <param>your data to send to eventghost without ON or OFF</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTSMS.Speak</cmdType>
      <params>
        <param>I have switched the bed light {1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase optional="true">turn, switch, set the</phrase>
    <phrase>bed light</phrase>
    <payloadList>on, off</payloadList>
  </command>
</commandGroup>
« Last Edit: November 18, 2014, 04:46:18 AM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Speech recognition and command/phrase setup
« Reply #2 on: November 18, 2014, 08:42:30 AM »

* Using MS SP 11
* Hifi mic open air
* My english accent is pretty good. (I have tried both US and GB)
...

1. Is it possible to get 90% or higher?
2. what is best MS SP 11 or the regular (without training and with training)
3. is it a smart way of setting up the phreses for the commands to help voxcommando?
4. is it possible to run two voxcommando at the same time on the same computer using MS SP 11 and regular with 2 microphones (one mic for each instant of vox) to compare results
5. what else can I do to improve the accuracy?

Hi tn42.

Here is my first recommendation:  If you want help with a command you have created, you should always post the XML for the actual command you are using and not a "pseudo code" description of your command.  Please look at this: http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum

Question 1: It is possible to get 99% accuracy but it depends on many factors and we don't know about your microphone or your accent so we cannot say for sure how well it can possibly work for you.

Question 2: The desktop engine is probably better than SP in your case (you should do some training), unless your microphone is bluetooth.

Question 3: It looks like your phrases and macro could be better.  If you had posted your XML it would be easier for us to send back an improved version, but what Kalle has posted for you is a good start.

Question 4: Yes it is possible to run two instances of VoxCommando at the same time, but it is difficult to get them to use different microphones because they will both want to use the default microphone, so it is easier (and no problem) to have them both use the same microphone.  In your case I don't see any reason to do this though, and I recommend you don't try to do it.

Question 5:  This question is too vague and the topic has been discussed extensively in many threads on the forum.  My first question to you would be: what is the exact model of your microphone, and how far away from it are you sitting.  Is your microphone close to a source of other noise, or music, TV etc.?

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #3 on: November 19, 2014, 04:28:15 AM »
A big thanx for the fast reply jitterjames and Kalle, it feels good to know that there is always a supportive community ready to help others. And may I say: Grüße aus Schweden :-) Hope I got it right ;-)

Well I tried a few things yestoday,

  • I switched from MS SP 11 to SAPI. this resulted in a bit higher accuracy.
  • After training I received a even higher accuracy.
  • After implementing the XML command kalle sent med (slightly modified) I go a rely good accuracy.

In fact it worked so well that I could be standing strait in front of the mice all the way back to about 14m away from the mic and it took all commands  :)

Okey So now Im feeling very happy with this. Or so I thought?


I let it run for about 1h without giving it any commands. After some time it started to react to "basically nothing" without me saying anything or whenever i spoke in Swedish it reacted and thought that i was speaking English?
Without restarting VOX I tried to give it some commands but it never seamed to get any of the commands right. After a restart of VOX it worked again as expected.

1. * So my first question is. what happened to VOX? Why did it act this way?


Okey, so I later tried my own command because the XML kalle sent med required me to say "something/optional" - bed light - on/off
and i wanna be able to be able to say "on/off" before the word "bed light" or "on/off" after the word "bed light" I did not want to be limited to saying the words in the specific order every single time.

2. * So I did a try myself in programing the phrases. (XML included further down) but after this I received a lot lower accuracy. that I had with kalles XML, any Ideas to why?

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.0.3-->
<command id="261" name="turn bed lights off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastSpoken}&amp;&amp;on</ifParams>
    <then>
      <action>
        <cmdType>EventGhost.Send</cmdType>
        <params>
          <param>BedlightON</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>EventGhost.Send</cmdType>
        <params>
          <param>BedlightOFF</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>turn, switch, bed lights, bed light</phrase>
  <phrase optional="true">off bed lights, off the bed lights, off bed light, off the bed light, off</phrase>
  <phrase optional="true">on bed lights, on the bed lights, on bed light, on the bed light, on</phrase>
</command>
« Last Edit: November 19, 2014, 05:37:38 AM by tn42 »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #4 on: November 19, 2014, 08:56:54 AM »
Många hälsningar från Tyskland  ;)

Let me try to help you.
The first problem is your command structur, because it is a bad idea to use the same words in each phrase of your command, in your case the word "bed light and bed lights".
It is better to use as first phrase only "turn, switch" and as second phrase "bed light, bed lights" and as final phrase "on, off".
It is also a bad idea to set phrase 2 and 3 as optional, because the command will execute after the first phrase "turn, switch" - optional means - you can say it but it is not necessary.

About your action in the command: To use a logic IF (A)contains(B) with {LastSpoken} contains "on" will bring you a lot of problems, because your command will execute when VC recognize a word which contains on - as example: button, one, ...
It is a advantage to use payloads like in my example command above.

I recommend to you VC2.1.2.1 instead of 2.1.0.3 - you can download it from here: http://voxcommando.com/downloads.asp
« Last Edit: November 19, 2014, 09:08:36 AM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Speech recognition and command/phrase setup
« Reply #5 on: November 19, 2014, 09:05:04 AM »
I let it run for about 1h without giving it any commands. After some time it started to react to "basically nothing" without me saying anything or whenever i spoke in Swedish it reacted and thought that i was speaking English?
Without restarting VOX I tried to give it some commands but it never seamed to get any of the commands right. After a restart of VOX it worked again as expected.

1. * So my first question is. what happened to VOX? Why did it act this way?

It is difficult to answer this because we don't know anything about your microphone or how it is connected you your computer.  It is probably safe to say it is not VoxCommando's fault.

It sounds like your input volume is too high.  Some microphones will use automatic gain control. This is very bad for voice recognition and should be disabled.  Automatic gain control will increase the input volume when it hears silence for a long time.

If you are using an open microphone that is always on you must keep VoxCommando in standby mode when not using it.

Instead of restarting VoxCommando you can probably just switch VC to off mode to reset your microphone.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Speech recognition and command/phrase setup
« Reply #6 on: November 19, 2014, 09:10:34 AM »
Just to follow up on Kalle's points about your poor command structure, the following command group uses proper payload lists, and has the necessary flexibility you are seeking, but without confusing VC by making everything optional.

By using two commands, you can have flexibility while still being precise about how the command must be issued.

Note that you shouldn't need to specify both "bed light" and "bed lights". If you say "bed lights" and the command says just "bed light", that is close enough for the computer.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.2.1-->
<commandGroup open="True" name="bed light commands" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="275" name="turn bed lights (1)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>EventGhost.Send</cmdType>
      <params>
        <param>Bedlight{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Bedlight {1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>turn, switch</phrase>
    <phrase optional="true">the</phrase>
    <phrase>bed lights</phrase>
    <payloadList>ON, OFF</payloadList>
  </command>
  <command id="304" name="turn {1} bed lights" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>EventGhost.Send</cmdType>
      <params>
        <param>Bedlight{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Bedlight {1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>turn, switch</phrase>
    <payloadList>ON, OFF</payloadList>
    <phrase optional="true">the</phrase>
    <phrase>bed lights</phrase>
  </command>
</commandGroup>
« Last Edit: November 19, 2014, 09:24:10 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Speech recognition and command/phrase setup
« Reply #7 on: November 19, 2014, 09:25:44 AM »
If you have more than one set of lights you want to eventually control, ("living room lights", "kitchen lights"), you could use a payload list for your sets of lights instead of the phrase "bed light".
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #8 on: November 20, 2014, 05:17:57 AM »
Hi! Thank you all, for taking your time. I have read all of you posted and today I'm gonna give it a try.

I kind of had a bad yestoday, I when to the dentist to repair a tooth, when I got back home half of my mouth was so numb from the anesthesia that there was no point of trying anything with voxcommando.
And in my stupidity (I blame this all so on the anesthesia), I was so lost in my head and confused that I by accident deleted the Virituel machin running eventghost. So I spent all night reinstalling everything.

But anyhow, I will try out your tips later today and repport back tomorrow morning with the results.

If you have more than one set of lights you want to eventually control, ("living room lights", "kitchen lights"), you could use a payload list for your sets of lights instead of the phrase "bed light".

Yes I'm gonna have all sorts of sensors, switches, lights and IR devices. Im defiantly gonna try to create a payload XML file

Is it possible to have
phrase: turn, switch
payload XML (bed light, kitchen light...)
payload ON , OFF


Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #9 on: November 20, 2014, 05:54:18 AM »
Quote
Is it possible to have
phrase: turn, switch
payload XML (bed light, kitchen light...)
payload ON, OFF

Yes, this exact how it works  ;)
***********  get excited and make things  **********

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Speech recognition and command/phrase setup
« Reply #10 on: November 20, 2014, 08:16:30 AM »
If you haven't looked at the wiki page on payloads yet, it's here: http://voxcommando.com/mediawiki/index.php?title=Payloads

And though you're not using a Vera controller, you might find it helpful to watch the command-building portion of the Vera tutorial video, as it demonstrates using payloads in the way that you're asking about.

The 2 videos on editing commands are also very worthwhile.

http://voxcommando.com/mediawiki/index.php?title=Video_Tutorials
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #11 on: November 21, 2014, 04:26:02 AM »
Good morning!

I was trying out the command structure last night. I followed your tips and it worked out realy well.

I had some problems with eventghost due to the USB virtualizing in virtualbox (I run event-ghost on a virtual machine, and used shared USB ports for the RF and IR USB communication with all the devices in the house). Im gonna try and fix this when I come back home today.

But apart from that everything went rely smooth. Running VOX using SAPI, training and the proper command, phrase setup did the trick. Still a few question left, but I will adress them later on, when I have fixed event-ghost and started to bridge VOX with EG.

As you probably already figured out I have several rooms and I wanna be able to use run speech commands in 3-4 rooms. Could I do this maybe by having one voxcommando client/ room (do you know what im thinking of)? And have all 3-4 vox commandos running on the same machine? where each one only have access to one microphone?

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #12 on: November 21, 2014, 05:23:23 AM »
Yes, you can run 4 instances of VC on the same machine, but why? You can control all rooms with one instance of VC. That is nime5ter suggestion to use payloads.

If you need a example how you can do this, let us know.
« Last Edit: November 21, 2014, 05:28:13 AM by Kalle »
***********  get excited and make things  **********

tn42

  • Jr. Member
  • **
  • Posts: 39
  • Karma: 0
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #13 on: November 21, 2014, 05:55:36 AM »
Yes, you can run 4 instances of VC on the same machine, but why? You can control all rooms with one instance of VC. That is nime5ter suggestion to use payloads.

If you need a example how you can do this, let us know.


If I understand the VC documentation correctly. Then if I run one instance of VC it will collect microphone data from all rooms at the same time.

Lets allso assuming that I have 1 microphone/ room and that the microphones are so far away from each other that they do not interfere.

1* This will generate allot of background noise, by adding the sound from all microphones?
2* If I give one command and another person gives another command at the same time in another room VC will have a problem?
3* Or two ppl are having a conversation in one room and I try to give a command in another room would not VC have problems capturing the command since its allso listening to the conversation of the two ppl at the same time?
« Last Edit: November 21, 2014, 06:10:19 AM by tn42 »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Speech recognition and command/phrase setup
« Reply #14 on: November 21, 2014, 07:03:47 AM »
If all microphones are connected to the same soundcard input, then also all VC instances will pickup the voices from each room at the same time - so it makes no difference if you use one or four instances. I think the multiroom solution is a bit tricky and maybe James can give you a answer to your questions or you can search here in the forum for "multiroom" or "open mic" and you will find some posts from other users.
***********  get excited and make things  **********