Let says my bot name is Eva. I have following utterances for GoodBye Intent.
-Bye Eva
-Cya Eva
-Goodbye
If I test with "Bye Eva!", the score is pretty low. How can I handle exclamation mark properly in this case?
Thanks
Punctuation does affect the predictions of the LUIS model. Sometimes it's a small difference, but I have seen the same discrepancies, and even incorrect predictions, when punctuation is added. I haven't tried to address this particular problem, but I do have a code snippet I use to intercept activities before they are sent to LUIS, which you could use to filter out punctuation that isn't likely to be relevant to intent prediction. Here is the code (nodejs):
async onTurn(context) {
if (context.activity.type === ActivityTypes.Message) {
context.activity.text = context.activity.text.replace(/!|\?|\./g,'')
const dc = await this.dialogs.createContext(context);
const results = await this.luisRecognizer.recognize(context);
In this case I've used regex to filter out "!", "?", and "." (? and . have to be escaped). You can, of course, remove any characters you want. This is based on core-bot sample, but whatever base code you're using, you should be able to insert a similar replace statement before the utterance is sent to LUIS.
Of course you can always just train the LUIS model with punctuation variations. I haven't done much of that myself, but I'm assuming once you've trained an intent with several examples including punctuation, it will increase the scoring of utterances with similar punctuation.
Note there is a slight chance this could affect sentiment analysis in LUIS if you're using it, though in some tests I just did on my own LUIS app, I never saw more than a 1% change in sentiment score.