Author Topic: xref.xml  (Read 7963 times)

0 Members and 4 Guests are viewing this topic.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
xref.xml
« on: July 09, 2013, 10:01:04 PM »
Hey James, yes still alive, just finishing this god damm dissertation. 

In regards to xref.xml functionality.  Could you provide me with an example xml.  It would be nice if an editor was introduced straight from the phrase tree but none the less I want to test the validity of this command. 

I've got many commands that use similar introductory phrasing so using an xref.xml for all these phrases will be great especially considering how complicated it has become with simulating some natural language ability. 

Thanks. 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: xref.xml
« Reply #1 on: July 09, 2013, 10:25:07 PM »
You can edit your xref group as you would any other group and then just export it to a file.

Then any other command can use this exported group as an element of its phrasing.

Be warned that the xref group should contain only phrases, but it can contain multiple "commands" and those commands can have phrases that use aliases and multiple phrases strung together.  The commands are not really commands, but it is a convenient way to edit the group.  You don't need to have any actions for the commands that are exported to be used as an xref.xml

Also, I am not 100% sure it is 100% stable, but you can be my beta tester!

Attached, is an example xref group that you can place in your export folder.  You can open this group and edit it in the MDI editor of VoxCommando, just like your command tree.  Do not add a second group to it though.

Here is a small group of commands that use the xref.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="commands that use the xref" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="180" name="how are you" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>I am operating within normal parameters</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <xref>export\xrefme.xml</xref>
    <phrase>how are you</phrase>
    <phrase optional="true">feeling, doing</phrase>
    <phrase optional="true">today</phrase>
  </command>
  <command id="182" name="what time is it" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <cmdString>do I look like a clock to you?</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <xref>export\xrefme.xml</xref>
    <phrase>what time is it</phrase>
  </command>
</commandGroup>

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: xref.xml
« Reply #2 on: July 11, 2013, 02:40:00 AM »
So strange had it going and now it's not.. Can you tell me why this x-ref is not working. 

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands version="">
    <commandGroup open="True" name="x-ref group" enabled="True" prefix="" priority="0" requiredProcess="" description="">
        <command id="326" name="phrases" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <phrase>song, songs, track, tracks, tune, tunes, podcast, podcasts, programme, programmes, show, shows</phrase
        </command>
    </commandGroup>
</VoiceCommands>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: xref.xml
« Reply #3 on: July 11, 2013, 08:29:23 AM »
Possibly because this is malformed XML.  Your closing phrase tag is broken.  There may be other problems but that's what jumps out at me.

As I said, you don't need to edit the XML by hand.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: xref.xml
« Reply #4 on: July 11, 2013, 10:24:20 AM »
Yep, simple typo.. My issue now is that it is not honouring the "optional phrase" function in the tree editor for the X-ref groups. 

I'm using multiple x-ref groups in the one action.  Could this be causing the issue.  If I use a command from each reference of x-ref it works fine.. 

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="152" name="Something different" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>Input.ExecuteAction&amp;&amp;"action":"skipnext"</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <xref optional="true">C:\Users\Production\Desktop\phrase\question.xml</xref>
  <xref optional="true">C:\Users\Production\Desktop\phrase\content change.xml</xref>
  <phrase>next, another, something else, else, something different, different, not this, skip this, to this, skip</phrase>
  <xref optional="true">C:\Users\Production\Desktop\phrase\mixed content.xml</xref>
</command>

The following are the three xml files, questions.xml, content change.xml and mixed content.xml

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands version="">
<commandGroup open="True" name="x-ref group" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="997" name="question" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<phrase">um</phrase>
<phrase">okay</phrase>
<phrase">yeah, yes, nah, no, yeah nah</phrase>
<phrase">hi, hey, hello</phrase>
<phrase">pretty please, please</phrase>
</command>
</commandGroup>
</VoiceCommands>

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands version="">
<commandGroup open="True" name="x-ref group" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="999" name="content change" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<phrase">can, could, would</phrase>
<phrase">you, we, I, Im, I am</phrase>
<phrase">do not want to, dont want to, want to, wanting, need to, needing, would like, would like to, feel like, feeling like</phrase>
<phrase">lets, let us, go and, go ahead and</phrase>
<phrase">listen, put, play</phrase>
<phrase">me, me the, me on, on, on the, to, to the, the, this, a</phrase>
</command>
</commandGroup>
</VoiceCommands>

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands version="">
<commandGroup open="True" name="mixed content" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="998" name="phrases" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<phrase>song, songs, track, tracks, tune, tunes, podcast, podcasts, programme, programmes, show, shows</phrase>
</command>
</commandGroup>
</VoiceCommands>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: xref.xml
« Reply #5 on: July 11, 2013, 10:39:51 AM »
I really don't think you should be trying to edit these by hand, because you are creating invalid xml.  It cannot understand the tag:

Code: [Select]
<phrase">
Trying to use multiple xrefs in a single command is probably not a good idea.

I don't know if the xrefs themselves can be set as optional, but the phrases within an xref can be set to optional.

The xrefs you are using don't make sense to me because you are requiring the user to say something like:

"um okay yeah hi pretty please"

Why would someone say that?

At this point, it seems you want the user to be able to say just about anything, so you might as well just scrap the whole xref thing and use payloadDication.  Ultimately I think you are trying to force VC to work in a way that it does not want to work and I don't expect that you'll ever get really good results with this.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: xref.xml
« Reply #6 on: July 11, 2013, 10:51:47 AM »
James it works fine when I use the method in traditional ways, I was trying to introduce X-ref so I can globally make alterations with ease. 

Why I want to use multiple xrefs in a single command is so I can clearly have one dedicated for the opening of a sentence for example.  The three xrefs I merged together form a complete command quite effectively and very well allowing many variables.   system handles it well, in its traditional way, not the x-ref way. 

Also I'm aware of the " symbol, that was my mistake. I just missed that one.  Externally exporting whole groups is not what I want, and I am quite comfortable editing xmls manually as there is no internal editing option..

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: xref.xml
« Reply #7 on: July 11, 2013, 10:57:51 AM »
Quote
The xrefs you are using don't make sense to me because you are requiring the user to say something like:

"um okay yeah hi pretty please"

Why would someone say that?

<phrase>um</phrase>
<phrase>okay</phrase>
<phrase>yeah, yes, nah, no, yeah nah</phrase>
<phrase>hi, hey, hello</phrase>
<phrase>pretty please, please</phrase>

These are all optional obviously.  In the command I provided up top only one like has the required command, that is..

<phrase>next, another, something else, else, something different, different, not this, skip this, to this, skip</phrase>

I'm a little confused as to how "payload dictation" would work, could I essentially say any thing and it just focus for the key required phrase commands?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: xref.xml
« Reply #8 on: July 11, 2013, 10:58:36 AM »
I am quite comfortable editing xmls manually
Except that you keep saying it does not work and when I look at your xml it is broken and presumably that is why it does not work.

as there is no internal editing option...
That is incorrect, you can edit the xml in the editor.  Just use file open and edit it as you would any other group, then save.  I think you will make a lot less mistakes this way and save us both a lot of time.


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: xref.xml
« Reply #9 on: July 11, 2013, 11:00:40 AM »
<phrase>um</phrase>
<phrase>okay</phrase>
<phrase>yeah, yes, nah, no, yeah nah</phrase>
<phrase>hi, hey, hello</phrase>
<phrase>pretty please, please</phrase>

These are all optional obviously.  In the command I provided up top only one like has the required command, that is..

<phrase>next, another, something else, else, something different, different, not this, skip this, to this, skip</phrase>

I'm a little confused as to how "payload dictation" would work, could I essentially say any thing and it just focus for the key required phrase commands?

These are all NOT optional.  This is obvious because they are not marked as optional.  If they were they would look like this:

Code: [Select]
<phrase optional="true">please</phrase>

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: xref.xml
« Reply #10 on: July 11, 2013, 11:06:53 AM »
James I know what the "phase optional" is but I was under the belief that the phase was globally set in the main editor.  Also that xml was just a find and replace issue, which I fixed moments after posting the xmls. 

I had changed the "phase optional" to "phase" as to determine why it wasn't respecting it as "optional". 

Before using X-ref the way I had the functions laid out actually work really well.  Payload dictation is cool but doesn't allow any structure what so ever and is a little to bit of a whild card.  Still I'm going to look into it. 

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: xref.xml
« Reply #11 on: July 11, 2013, 11:10:00 AM »
This command for example works really quite well.  It doesn't have the "please" or "thankyou" or "hi" additions to it yet, hence why I was looking into the X-ref functionality to make this easier.. 

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="300" name="hush.fm - Music" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.SoftMute</cmdType>
    <cmdString>80</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PlayWav</cmdType>
    <cmdString>Z:\Library\Stings\sting.wav</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <cmdString>6000</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>Player.Open&amp;&amp;"item":{"file":"special://profile/playlists/music/hush.fm - Music.xsp"}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>GUI.ActivateWindow&amp;&amp;"window": "musicplaylist"</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType />
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">can, could, would</phrase>
  <phrase optional="true">you, we, I</phrase>
  <phrase optional="true">want to, need to, would like to</phrase>
  <phrase optional="true">lets, let us, go and, go, switch</phrase>
  <phrase optional="true">play me, play us, play, listen to, back to, feel like, go to, put on, want, hows about</phrase>
  <phrase optional="true">nothing but, everything, a</phrase>
  <phrase optional="true">just, just some, some, something</phrase>
  <phrase optional="true">about, to do with</phrase>
  <phrase>music, tune, tunes, song, songs</phrase>
  <phrase optional="true">content, programming, media, audio, stuff</phrase>
</command>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: xref.xml
« Reply #12 on: July 11, 2013, 11:25:05 AM »
Payload dictation is cool but doesn't allow any structure what so ever and is a little to bit of a whild card.

Yes, that is exactly what it is, a wild card.  But the way you are doing it, and it seems that you want to put all these long lists of optional phrases into every command, you are going to end up with problems and at the very least I can promise you that you will end up with a ton of false positives.

You might as well just use payload dictation and then check to see if it contains the word "next".  This is actually how most of the android recognition apps work because you can't define the language choices in advance, you can only get back a list of dictation strings.  If you are looking at doing this all on a mobile device anyway this is what you'll be needing to do, analyzing dictation strings to detect patterns.

Looking at your "Something different" command the user could say very clearly:  "No I do not want to skip" and the computer would respond by skipping.  In this case the xref could actually help you out a lot because you can create multiple commands, each of which addresses different sentence structures, but my concern here is that when you add this to a whole bunch of commands the system is going to melt down.

Maybe this will work if you are only looking at a very limited set of commands.
« Last Edit: July 11, 2013, 11:27:19 AM by jitterjames »

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: xref.xml
« Reply #13 on: July 11, 2013, 09:34:16 PM »
Thats pretty much it..  There's only about 15 to 20 commands in total.  And as I was saying, I've actually had no trouble as of yet, certainly no melt downs, things have worked really well, it was just the implementation of Xref that has caused me issues in regards to reliability but knowing what I know now I think I can fix it..

I simply did not realise that the x-ref honours the "phase optional" in the xml rather han honouring the the global "phanse optional" in the editor. 

I thin you give your system too little credit with this approach.  It handles it very well with very few false positives.  However I'm going to have some fun with payload dictation. 

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: xref.xml
« Reply #14 on: July 11, 2013, 10:17:39 PM »
Okay so I've fixed all the xml.s and they now contain <phrase optional="true"> instead of <phrase> and I have the x-refs in the tree-editor also higlighted yellow but having it highlighted or not gives the same result. 

The command effectively work if you include all three x-refs.  For instance I can say "Um Can Next Track" and it works fine.  "Um" from the 'question' x-ref "Can" from the 'content change' x-ref "Next" from my required command and "track" from the 'mixed content' x-ref.  So it realises from within the repsoitory of the x-ref that they are optional phrases but the xrefs them selves within the wider command are not accepting it. 

There are NO ISSUES with the complexity of the command its self.  It's just simply not honouring 'optional phrase' with in the wider command. 

Why would this be.  Before you think this is to convoluted, it's not, as I said earlier, my setup works great with a multitude of commands using ths layered language approach with barely any false positives.  I just want to integrate x-ref as it allows me to introduce sweeping changes to the setup.  Why I have seperated the x-refs is simple..

I have one x-ref for 'content description' for exampel.  "Track, song, single, tune, etc" this allows me to introduce this x-ref in to multiple commands and if I need to expand later I only need to alter the one file.  Same thing going for introduction phrasing.  So I have an x-ref for "hey, hi, hello, how are you' and I can expand later with "howdy" for example with ease.  It is really effective seperated the x-refs for the different segments of a sentence, it is more reliable than 'payload dictation' as there are not actually that many ways to say a sentence as you would think.  I would encourage you to try the following.  Keep in mind this doesn't have "Hey, Hi, Hello" or "Please" phrasing added to it. 

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="266" name="hush.fm - Technology" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.SoftMute</cmdType>
    <cmdString>80</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PlayWav</cmdType>
    <cmdString>Z:\Library\Stings\sting.wav</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <cmdString>6000</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>Player.Open&amp;&amp;"item":{"file":"special://profile/playlists/mixed/hush.fm - Technology.xsp"}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>GUI.ActivateWindow&amp;&amp;"window": "musicplaylist"</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.SoftUnMute</cmdType>
    <cmdString />
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase optional="true">can, could, would</phrase>
  <phrase optional="true">you, we, I</phrase>
  <phrase optional="true">want to, need to, would like to</phrase>
  <phrase optional="true">lets, let us, go and, go, switch</phrase>
  <phrase optional="true">play me, play us, play, listen to, back to, feel like, go to, put on, hows about</phrase>
  <phrase optional="true">nothing but, everything</phrase>
  <phrase optional="true">just, just some, some, something</phrase>
  <phrase optional="true">about, to do with</phrase>
  <phrase>technology, tech, techy, science, scientific, science and technology, intellectual</phrase>
  <phrase optional="true">content, programming, media, audio, stuff</phrase>
</command>

But if we could find out why it is insisting that one of each of the 'optional phrasing' is being required, that would be very good. 

Hope I've made myself a little clearer.  Thank you.