问题
(TEXT)
is converted to ( TEXT )
in LUIS when we identify an entity name.
Issues with special characters.
Refer the image in below:
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).
回答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:
- LUIS inserts whitespace in utterances when punctuation present causing entity getting incorrectly parsed
- LUIS cannot take care of special characters
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
来源:https://stackoverflow.com/questions/48145790/luis-issues-with-special-characters