Re 2: I strongly recommend not trying to parse the raw input with regex in script nodes (and Kore.ai people, STOP recommending this!). There are far too many situations to handle for this to be effective, and actually is impossible to be perfect because a script node does not have enough information about how the utterance has been processed up to that point.
So the three alternatives I would suggest are:
- Have a second entity on the “did not find anything known” path that looks for other kinds of accounts, presumably there are words that could indicate an account.
- In a similar manner, use a trait that is trained for detecting potential accounts and you can test for the presence of that trait in the connections from the Account entity (after the specific match).
- Use a composite entity. There would be two sub entities associated with it, one for matching specific accounts (like now) and a second one for the fallback matching. Then you have two composite entity patterns, the first with just the specific sub entity, and the second with the fallback sub entity. The processing of a composite is such that it processes the composite patterns in order and will stop at the first successful match.