AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

what is the <pattern> for identifying a time such as 11AM or 11PM?
 
 

I can take in either ‘2 hours’ or ‘11AM’ as a time.

However, I don’t know how to match the equivalent of ‘*AM’.  The wildcard doesn’t seem to accept partial strings, it only accepts ‘* AM’ to match me with ‘11 AM’ with a space in the middle.

How do I allow for the case where the user treats it all as one word?

 

 
  [ # 1 ]

<srai> to it. 11AM srais to 11 AM and so on.

You could also use the explode tag to break 11AM into 1 1 A M. This is useful for working out times.

 

 
  [ # 2 ]

But what if someone write 10AM?  12:34AM?

 

 
  [ # 3 ]

You would use explode to make 1 2 3 4 A M and deal with that input. That’s how we made the alarm function in the android app CallMom.

 

 
  [ # 4 ]

Hmmm…I see….but then it would also explode ‘2 hours’ into ‘2 H O U R S’?  Would it be done <explode>* to explode the input?

If that were the case, then if I wanted to allow both, just put the * HOURS category ahead of the explode?

Do I need to re-compose it somehow or would <star> still be ‘12:34AM’ in the <template>?

Thanks for this!

 

 
  [ # 5 ]

Could you give me an example of the conversation you are trying to deal with please?

 

 
  [ # 6 ]

You bet!  Here is an example:

Bot: When do you want me to reach back out to you?
Me: In 11 minutes.
Bot: Okay….when do you want me to follow up with you?
Me: At 11:34 PM
Bot: Okay….when do you want me to send a reminder to you?
Me: 7AM
Bot: Okay…when do you want to meet?
Me: This afternoon
Bot:  Okay….

On my backend, I can convert all of those strings: “11 minutes”, “11:34PM”, “7am” can all be translated into epoch_time.

The challenge is the minutes…if it is minutes, it needs to say “11 minute from now”—which the user may not do, so I check if “minutes” or “hours” is there to add.

oh, wait….I think if I just let *</pattern> after first checking if there is MINUTES or HOURS—my backend knows the difference….

Let me see - I may need to rephrase the problems statement….

 

 
  [ # 7 ]

Yes, if the pattern ends with “MINUTES” <srai> it out to “* MINUTES FROM NOW”

 

 
  login or register to react