Search code examples
javascriptnode.jsibm-watsonwatson-conversation

extracting alpha numeric string from customer speech


I am working on a voice bot at the moment. I am having difficulty in extracting pan card number (hazwr2312g). Customer can give it in many different ways. for example they can say my pan id is (hazwr2312g).

I have created a regex based on pan rules, which is working fine /[a-z]{3}[abcfghljpte][a-z][0-9]{4}[a-z]/i and extract pan number.

However, when the customer is giving pan number via voice then "g" is often replaced by "ji" (hazwr2312 ji) in the end of sentence.

various utterances:

1) my pan number is hazwr2312 ji 2) hazwr2312 ji is my pan number 3) it is hazwr2312 ji 4) hmm ahem my id is hazwr2312 ji

so-forth

how can I tackle this? Please guide me

Regards Meet


Solution

  • you can try by using regex or you also opt split, indexOf etc, if you having particular type of keyword that coming all the time or common.