LUIS issues with special characters

孤人 提交于 2019-12-07 21:37:09

问题


(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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!