Using Canadian French Speech Recognition

The Tellme Voice Application Network supports speech recognition for canadian french language. This article demonstrates how to access this functionality.

This example demonstrates how to do recognition of 'hello' in canadian french using inline grammar. Comments have been provided in the example vxml.

<?xml version="1.0" encoding="UTF-8" ?>
<vxml version="2.1"
  xmlns="http://www.w3.org/2001/vxml">

  <!--
    Description:
     Simple recognition with fr-ca.dnn (Input - Bonjour)
   -->

  <catch>
    <log>failure expression: <value expr="'caught unexpected event: ' + _event" /></log>
    <prompt> <value expr="'caught unexpected event: ' + _event" /> </prompt>
    <exit />
  </catch>

  <form id="test">
    <field name="f1">
    <!-- Setting acoustic model to fr-ca.dnn -->
      <property name="tellme.acousticmodel" value="fr-ca.dnn" />
      <property name="confidencelevel" value="0.20" />

    <!-- Ask user to say Bonjour(hello) -->
      <prompt>Say <voice name="claude">Bonjour</voice></prompt>

    <!-- Inline grammar that can recognize Bonjour (hello) -->
      <grammar mode="voice" version="1.0" xml:lang="fr-ca"  root="main" tag-format="semantics/1.0">
        <rule id="main" scope="public">
           <one-of>
              <item weight="1.0">
                  Bonjour  
                  <tag>out = "hello";</tag>
              </item>
           </one-of>
        </rule>
      </grammar>

      <filled>
        <log>f1.utterance: <value expr="f1$.utterance" /></log>

        <!-- Check result for recognition is a match with input (Bonjour) -->
        <if cond="f1$.utterance=='Bonjour'  &amp;&amp; f1$.interpretation=='hello'">
            <prompt><voice name="claude"> Bienvenue dans votre banque</voice></prompt>
        </if>

      </filled>
    </field>
  </form>
</vxml>

Check account balance is one of the most commonly used type of recognition.

This example demonstrates how to do recognition of 'check account balance' in canadian french using internal grammar. Comments have been provided in the example vxml.

<?xml version="1.0" encoding="UTF-8" ?>
<vxml version="2.1"
  xmlns="http://www.w3.org/2001/vxml">

  <!--  
  Description:
    Recognition of "check account balance" with fr-ca asr (Input - vérifier le solde du compte)
  -->

  <catch>
    <log>failure expression: <value expr="'caught unexpected event: ' + _event" /></log>
    <prompt> <value expr="'caught unexpected event: ' + _event" /> </prompt>
    <exit />
  </catch>

  <form id="test">
    <field name="f1">
     <!-- Setting acoustic model to "fr-ca.dnn" -->
      <property name="tellme.acousticmodel" value="fr-ca.dnn" />
      <property name="recordutterance" value="true" />
      <property name="confidencelevel" value="0.20" />
      <property name="tellme.endseconds" value="0.2" />

       <!-- Ask user to say - vérifier le solde du compte meaning(check account balance) -->
       <prompt> Say <voice name="isabelle"> vérifier le solde du compte </voice> </prompt>

       <!-- Inline grammar that can recognize - vérifier le solde du compte(check account balance) -->
       <grammar mode="voice" version="1.0" xml:lang="fr-ca"  root="main" tag-format="semantics/1.0">
        <rule id="main" scope="public">
           <one-of>
             <item weight="1.0">
   	        	vérifier le solde du compte	
           	<tag>out = "check account balance";</tag>
             </item>
           </one-of>
        </rule>
       </grammar>

      <filled>
        <log>f1.utterance: <value expr="f1$.utterance" /></log>
       <!-- This shows checking interpretation (instead of utterance) which could be a simple english text -->
        <if cond="f1$.interpretation=='check account balance'">
          <prompt> <voice name="isabelle"> vous avez un solde de compte de
			<say-as type="currency"> 24,00 € </say-as>
	  </voice></prompt>
        </if>
      </filled>
    </field>
  </form>
</vxml>

DTMF recognition is still a commonly used way to enter credit card number of last 4 digits of social.

This example demonstrates how to do recognition of last four digits of social using internal DTMF grammar. Comments have been provided in the example vxml.

<?xml version="1.0"?>
<vxml version="2.1"
  xmlns="http://www.w3.org/2001/vxml"
  update="srgs_dtmf_fixes">

    <!-- Description:
         Get last 4 digits of social through DTMF
     -->

  <catch>
    <log>failure expression: <value expr="'caught unexpected event: ' + _event" /></log>
    <prompt> <value expr="'caught unexpected event: ' + _event" /> </prompt>
    <exit />
  </catch>

  <form id="form0">
    <field name="f1">

     <!-- Ask user to input last 4 digits of social.  Using 1234 as an example  -->
      <prompt>Say<voice name="isabelle"> Veuillez utiliser le clavier et entrez les 4 derniers chiffres de votre numéro de sécurité sociale</voice></prompt>

      <grammar version="1.0" type="application/srgs+xml" xml:lang="fr-ca" mode="dtmf" root="test">
        <rule id="test" scope="public">
          <item repeat="4">
            <one-of>
              <item>0</item>
              <item>1</item>
              <item>2</item>
              <item>3</item>
              <item>4</item>
              <item>5</item>
              <item>6</item>
              <item>7</item>
              <item>8</item>
              <item>9</item>
            </one-of>
          </item>
        </rule>
      </grammar>
      <filled>
       <!-- Using 1234 as an example press -->
        <if cond="f1=='1234'">
        <prompt><voice name="isabelle"> Les 4 derniers chiffres de Social ont été vérifiés avec succès </voice></prompt>
        </if>
      </filled>
    </field>
  </form>
</vxml>

Another DTMF input example:

<?xml version="1.0"?>
<vxml version="2.1"
  xmlns="http://www.w3.org/2001/vxml"
  update="srgs_dtmf_fixes">


  <!-- Description:
        Using DTMF to go through different options 
    -->
  <catch>
    <log>failure expression: <value expr="'catch-all caught ' + _event" /></log> 
    <prompt> <value expr="'catch-all caught ' + _event" /> </prompt>
    <exit />
  </catch>

  <form>
    <field name="f1">
     <!-- Ask user to 
            Press 1 to check account balance. 
            Press 2 to make a payment -->

      <prompt><voice name="claude">
           Appuyez sur <say-as type="number:digit">1</say-as> pour vérifier le solde du compte. 
	   Appuyez sur <say-as type="number:digit">2</say-as> pour effectuer un paiement
      </voice></prompt>

     <!-- Inline grammar to select the option -->
      <grammar mode="dtmf" version="1.0" xml:lang="fr-CA" root="rootrule" tag-format="semantics/1.0">
        <rule id="rootrule" scope="public">
          <one-of>
            <item>1
            <tag>out = "vérifier le solde du compte";</tag></item>
            <item>2
            <tag>out = "effectuer un paiement";</tag></item>
          </one-of>
        </rule>
      </grammar>

      <filled>
        <log>f1$.utterance: <value expr="f1$.utterance" /></log>
        <log>f1$.interpretation : <value expr="f1$.interpretation" /></log>
        <audio><voice name="claude">vous avez sélectionné<value expr="f1$.interpretation"/></voice></audio>
      </filled>

    </field>
  </form>
</vxml>

One of the most common use case is recognition of currency and number, most commonly used towards credit card payment.

This example demonstrates how to do recognition of a number and currency. Comments have been provided in the example vxml.

<?xml version="1.0" encoding="UTF-8" ?>
<vxml version="2.1"
  xmlns="http://www.w3.org/2001/vxml">

   <!-- Description:
        Recognize a currency
    -->

  <catch>
    <log>failure expression: <value expr="'caught unexpected event: ' + _event" /></log>
    <prompt> <value expr="'caught unexpected event: ' + _event" /> </prompt>
    <exit />
  </catch>

  <form id="test">
    <field name="f1">
      <property name="tellme.acousticmodel" value="fr-ca.dnn" />
      <property name="confidencelevel" value="0.20" />
 
     <!-- Asking how much money you need to transfer to savings account. Say cinq euros , meaning 5€ -->
      <prompt> Say <voice name="isabelle"><say-as type="currency">5€</say-as></voice></prompt>

      <grammar mode="voice" version="1.0" xml:lang="fr-ca" root="main" tag-format="semantics/1.0">
        <rule id="main" scope="public">
          <one-of>
            <item weight="1.0">5€
            <tag>out = "cinq euros";</tag></item>
          </one-of>
        </rule>
      </grammar>

      <filled>
        <!-- Check if recognition matches with speech -->
        <if cond="f1$.utterance=='5€'">
           <audio>Transfering <voice name="isabelle"><value expr="f1$.utterance"/> </voice>to savings account</audio>
        </if>
      </filled>
    </field>
  </form>
</vxml>

This example demonstrates how to do recognition of a boolean i.e. yes and no. Comments have been provided in the example vxml.

<?xml version="1.0" encoding="UTF-8" ?>
<vxml version="2.1"
  xmlns="http://www.w3.org/2001/vxml">

  <!-- Description
       Recognize boolean yes or no
  -->

  <catch>
    <log>failure expression: <value expr="'caught unexpected event: ' + _event" /></log>
    <prompt> <value expr="'caught unexpected event: ' + _event" /> </prompt>
    <exit />
  </catch>

  <form id="test">
    <field name="f1">
      <property name="tellme.acousticmodel" value="fr-ca.dnn" />
      <property name="confidencelevel" value="0.20" />

     <!-- Ask user to say yes or no -->
      <prompt>Say <voice name="claude">oui ou non</voice></prompt>

      <grammar mode="voice" version="1.0" xml:lang="fr-ca" root="main" tag-format="semantics/1.0">
        <rule id="main" scope="public">
                <one-of>
                    <item>
                      oui 
                       <tag>out = "yes";</tag>
                     </item>
                    <item>
                       non 
                        <tag>out = "no";</tag>
                    </item>
                </one-of>
        </rule>
      </grammar>

      <filled>
            <audio><voice name="claude">You said<value expr="f1$.utterance"/></voice></audio>
      </filled>
    </field>
  </form>
</vxml>

[24]7 Inc.| Terms of Service| Privacy Policy| General Disclaimers