1
votes

In Dialogflow, I am trying to detect an alphanumeric sequence that matches this regular expression: [A-Za-z][0-9]{7}[0-9A-Za-z] (one letter + 7 digits + 1 alphanumeric), but although it works with text tests, when I try to do it using speech it fails.

I have followed the process described at the end of this documentation (English language): https://cloud.google.com/dialogflow/docs/speech-adaptation

So, I have created my entity using a regular expression, and then an intent with 20 training phrases that match the code. Finally, I have enabled the Auto Speech Adaptation in the agent configuration.

Here you have my test to detect this code: V31701923

Thank you!

1
Hi @asmartin , Did you found any to accomplish this ? , I'm facing the same in this moment - Ivan Fontalvo
Hi @IvanFontalvo. No, I have not found any solutions for this yet. - asmartin
I tried this regex for : letter + numbers [ A-Za-z ]{1,3}[ 0-9]{5,10} , is working pretty well now the tricks is on the spaces because dialog flow in voice process some times put and spaces beetwen digist or letter spoken.Let me know if works to put as answer :D - Ivan Fontalvo

1 Answers

0
votes

Auto speech adaptation alone in this case would not help.

Use speech contexts to make the speech to text engine understand that the users will be spelling out alphanumeric characters one by one.

Speech contexts can be added to Dialogflow streaming detect intent requests like this:-

"config": {
      "sampleRateHertz": 8000,
      "languageCode": "en-US",
      "model": "phone_call",
      "useEnhanced": true,
      "speechContexts": [{
        "phrases": ["$OOV_CLASS_ALPHANUMERIC_SEQUENCE"],
        "boost": 15.0
        }],
  }
}

The phrases hint "$OOV_CLASS_ALPHANUMERIC_SEQUENCE" is what tells dialogflow and speech to text engine to accept a sequence of spelled out characters. The boost value helps the engine understand how much precedence to give to spelled out characters over similar-sounding words (Eg: c over "see"). A positive value of 15+ should be good for your use case as you're almost always expecting a series of characters and not words (The boost value range is from 0 to 20).

Couple this with the regex entity and the training phrases you've already configured, and it should work pretty well.

Refer this for the available class types: https://cloud.google.com/speech-to-text/docs/class-tokens