2

(TEXT) is converted to ( TEXT ) in LUIS when we identify an entity name. Issues with special characters.

Refer the image in below:

Special_charater_Issue.PNG

Here monthly iq dashboard hospitalists is converted to reportname --> "monthly iq dashboard ( hospitalists )" in Entities. So when we use this entity in bot framework we are facing issues while comparing to actual report name stored in Metadata (database).

sid8491
  • 6,622
  • 6
  • 38
  • 64
Suba
  • 21
  • 3
  • "... with special characters" just means this case, or there exists any other case? – OmG Jan 08 '18 at 11:59
  • 2
    Not sure if this is an issue or the "normal" behaviour of LUIS. If you have a look to utterances with punctuation, there are always spaces added. Can't you handle that in your code ? – Nicolas R Jan 09 '18 at 08:45
  • 1
    as @NicolasR has said, this is "normal" behaviour from my experience. I have a method that takes in the utterance, and "sanitizes" this type of phrases. I have seen this experience with commas and parens. Depending on how your entities break down, you may just need to do a regex type replace to remove the whitespaces. – NiteLordz Jan 09 '18 at 18:07

1 Answers1

1

(TEXT) is converted to ( TEXT ) in LUIS when we identify an entity name. Issues with special characters.

The issue you reported seems be that whitespace is added when some special characters are using, I reproduced the issue on my side, and I find similar issues are reported by others:

when we use this entity in bot framework we are facing issues while comparing to actual report name stored in Metadata (database)

To solve it, as Nicolas R and NiteLordz mentioned in comments, you can try to handle that in your code. And to remove whitespace from ( hospitalists ), the following regex would be helpful.

Regex regex = new Regex(@"\(\s\w*\s\)");

input = Regex.Replace(input, regex.ToString(), c => c.Value.Replace(" ", ""));

Note: can reproduce the issue, and same issue will appear when we process something like URL that contains / and . etc

enter image description here

Fei Han
  • 26,415
  • 1
  • 30
  • 41