Suba
Suba

Reputation: 21

LUIS issues with special characters

(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).

Upvotes: 2

Views: 877

Answers (1)

Fei Han
Fei Han

Reputation: 27825

(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

Upvotes: 1

Related Questions