We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

slot confidence

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
jonbprime
Posts: 3
Joined: Thu Oct 23, 2014 1:18 pm

slot confidence

Post by jonbprime »

How do I form my grammars such that the confidence value for each slot is returned individually? For example:

Pseudo grammar: "from <from city> to <to city>"

I need to get back in the results the unique confidence score the ASR got for the from city AND the to city, not just one score for the entire utterance.

Thanks,
-J

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: slot confidence

Post by support »

Hi,

You can use the $.confidence shadow variable to get the confidence value for your grammars. For example:

grammarexample.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

<form id="initial_name">
  <grammar src="from_to_city.grxml" root="from_to_city" type="application/srgs+xml" mode="voice"/>

  <block>
    <prompt bargein="false">
      Welcome to the Driving Directions By Phone.
    </prompt>
  </block>

  <initial name="init1">
    <prompt>
      Where do you want to drive from and to?
    </prompt>
    <nomatch count="1">
       Please say something like "from Orlando Florida to Dallas Texas".
    </nomatch>
    <nomatch count="2">
      I'm sorry, I still don't understand.
      I'll ask you for information one piece at a time.
      <assign name="init1" expr="true"/>
      <reprompt/>
    </nomatch>
  </initial>

  <field name="from_city" modal="true">
    <grammar src="from_to_city.grxml" root="from_city" type="application/srgs+xml" mode="voice"/>
    <prompt>From which city are you leaving?</prompt>
  </field>

  <field name="to_city" modal="true">
    <grammar src="from_to_city.grxml" root="to_city" type="application/srgs+xml" mode="voice"/>
    <prompt>Which city are you going to?</prompt>
  </field>

  <filled>
    <prompt bargein="false">
      I think you said. From <value expr="from_city"/> to <value expr="to_city"/>. The confidence of the from city is <value expr="from_city$.confidence"/> and the confidence of the to city is <value expr="to_city$.confidence"/>.
    </prompt>
  </filled>
</form>
</vxml>
from_to_city.grxml:

Code: Select all

<rule id="from_to_city">
  <item repeat="0-1"><ruleref uri="#from_city"/><tag>from_city=from_city.from_city</tag></item>
  <item repeat="0-1"><ruleref uri="#to_city"/><tag>to_city=to_city.to_city</tag></item>
</rule>

<rule id="from_city">
  <item repeat="0-1">from</item>
  <one-of>
    <item>
      New York <item repeat="0-1">New York</item> <tag>from_city='New York, NY';</tag>
    </item>
    <item>
      Orlando <item repeat="0-1">Florida</item> <tag>from_city='Orlando, FL';</tag>
    </item>
    <item>
      Syracuse New York <tag>from_city='Syracuse, NY';</tag>
    </item>
    <item>
      Los Angeles <item repeat="0-1">California</item> <tag>from_city='Los Angeles, CA';</tag>
    </item>
    <item>
      ELLAY <tag>from_city='Los Angeles, CA';</tag>
    </item>
    <item>
      San Francisco <item repeat="0-1">California</item> <tag>from_city='San Francisco, CA';</tag>
    </item>
    <item>
      Denver <item repeat="0-1">Colorado</item> <tag>from_city='Denver, CO';</tag>
    </item>
    <item>
      Seattle <item repeat="0-1">Washington</item> <tag>From_city='Seatle, WA';</tag>
    </item>
    <item>
      Washington D C <tag>from_city='Washington D.C.';</tag>
    </item>
    <item>
      Dallas <item repeat="0-1">Texas</item> <tag>from_city='Dallas, TX';</tag>
    </item>
    <item>
      Houston <item repeat="0-1">Texas</item> <tag>from_city='Houston, TX';</tag>
    </item>
  </one-of>
</rule>

<rule id="to_city">
  <item repeat="0-1">to</item>
  <one-of>
    <item>
      New York <item repeat="0-1">New York</item> <tag>to_city='New York, NY';</tag>
    </item>
    <item>
      Orlando <item repeat="0-1">Florida</item> <tag>to_city='Orlando, FL';</tag>
    </item>
    <item>
      Syracuse New York <tag>to_city='Syracuse, NY';</tag>
    </item>
    <item>
      Los Angeles <item repeat="0-1">California</item> <tag>to_city='Los Angeles, CA';</tag>
    </item>
    <item>
      ELLAY <tag>to_city='Los Angeles, CA';</tag>
    </item>
    <item>
      San Francisco <item repeat="0-1">California</item> <tag>to_city='San Francisco, CA';</tag>
    </item>
    <item>
      Denver <item repeat="0-1">Colorado</item> <tag>to_city='Denver, CO';</tag>
    </item>
    <item>
      Seattle <item repeat="0-1">Washington</item> <tag>to_city='Seatle, WA';</tag>
    </item>
    <item>
      Washington D C <tag>to_city='Washington D.C.';</tag>
    </item>
    <item>
      Dallas <item repeat="0-1">Texas</item> <tag>to_city='Dallas, TX';</tag>
    </item>
    <item>
      Houston <item repeat="0-1">Texas</item> <tag>to_city='Houston, TX';</tag>
    </item>
  </one-of>
</rule>
Hope this helps.

Regards,
Plum Support

jonbprime
Posts: 3
Joined: Thu Oct 23, 2014 1:18 pm

Re: slot confidence

Post by jonbprime »

This example works, but the confidence score for both the from and to city is always the same. I say: "new york to gobbledygook"

And the result is:

I think you said. From New York, NY to Orlando, FL. The confidence of the from city is 0.738 and the confidence of the to city is 0.738.

I would have expected a high value for "new york" and a low value for "gobbledygook" but it was .738 for both?

-J

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: slot confidence

Post by support »

Hi,

We apologize for the earlier confusion. You would only be able to do this by capturing the confidence level of the "from city" separately from the "to city". You wouldn't be able to get a different confidence level if the user said the "from city" and "to city" together.

The following example demonstrates how you would be able to capture the confidence level of the "from city" separate from the "to city":

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">

<form id="initial_name">

  <block>
    <prompt bargein="false">
      Welcome to the Driving Directions By Phone.
    </prompt>
  </block>

  <field name="from_city">
    <grammar src="from_to_city.grxml" root="from_city" type="application/srgs+xml" mode="voice"/>
    <prompt>From which city are you leaving?</prompt>
  </field>

  <field name="to_city">
    <grammar src="from_to_city.grxml" root="to_city" type="application/srgs+xml" mode="voice"/>
    <prompt>Which city are you going to?</prompt>
  </field>

  <filled>
    <prompt bargein="false">
      I think you said. From <value expr="from_city"/> to <value expr="to_city"/>. The confidence of the from city is <value expr="from_city$.confidence"/> and the confidence of the to city is <value expr="to_city$.confidence"/>.
    </prompt>
  </filled>
</form>
</vxml>
Regards,
Plum Support

jonbprime
Posts: 3
Joined: Thu Oct 23, 2014 1:18 pm

Re: slot confidence

Post by jonbprime »

Nuance supports slot level confidence. Is this something you will add in the future? We probably can't use your platform without it.

-J

Post Reply