特殊字符的LUIS问题 [英] LUIS issues with special characters
问题描述
(TEXT)
在LUIS中将转换为( TEXT )
.
带有特殊字符的问题.
(TEXT)
is converted to ( TEXT )
in LUIS when we identify an entity name.
Issues with special characters.
请参考以下图片:
这里,每月智商仪表板hospitalists
在Entities
中转换为reportname --> "monthly iq dashboard ( hospitalists )"
.因此,当我们在bot框架中使用该实体时,在与存储在元数据(数据库)中的实际报告名称进行比较时会遇到问题.
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).
推荐答案
当我们确定实体名称时,
(TEXT)
在LUIS中将转换为( TEXT )
.带有特殊字符的问题.
(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
当我们在bot框架中使用此实体时,与存储在元数据(数据库)中的实际报告名称进行比较时,我们面临的问题
when we use this entity in bot framework we are facing issues while comparing to actual report name stored in Metadata (database)
要解决此问题,正如Nicolas R和NiteLordz在评论中提到的那样,您可以尝试在代码中进行处理.为了从( hospitalists )
中删除空格,以下正则表达式将很有帮助.
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
这篇关于特殊字符的LUIS问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!