- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我刚刚训练了我的 LUIS 应用程序并将其发布到生产环境。如果我对一个话语进行测试,我可以看到该结果与已发布版本的比较结果,并查看 JSON 结果。问题是我得到的 JSON 结果与通过 URL 查询 API 时得到的结果完全不同。这是测试结果 JSON:
{
"query": "please show me *johnson*",
"prediction": {
"normalizedQuery": "please show me *johnson*",
"topIntent": "Show",
"intents": {
"Show": {
"score": 0.985523641
}
},
"entities": {
"ShowObject": [
"*johnson*"
],
"$instance": {
"ShowObject": [
{
"type": "ShowObject",
"text": "*johnson*",
"startIndex": 15,
"length": 9,
"score": 0.8382344,
"modelTypeId": 1,
"modelType": "Entity Extractor",
"recognitionSources": [
"model"
]
}
]
}
}
}
}
这是API查询结果:
{
"query": "please show me *johnson*",
"topScoringIntent": {
"intent": "Show",
"score": 0.985523641
},
"intents": [
{
"intent": "Show",
"score": 0.985523641
}
],
"entities": [
{
"entity": "* johnson *",
"type": "ShowObject",
"startIndex": 15,
"endIndex": 23,
"score": 0.8382344
}
]
}
API 查询结果的问题在于它没有返回有关实体的足够信息,并且返回与测试结果不同的实体。注意上面测试结果返回的是*johnson*
,星号附近没有空格,这就是原始查询的样子,但是API查询结果返回的是*johnson*
,其中有空格星号附近。我不希望它放入空格,所以我更喜欢测试结果而不是 API 查询结果。
为什么它们不同,以及如何让 API 查询返回与测试类似的结果,即不修改输入字符串以在星号附近添加空格。
以下是包含参数的 API 查询 URL:
https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/[应用 ID 已删除]?q=please+show+me+*johnson*&timezoneOffset=0&verbose=true&spellCheck= false&staging=false
最佳答案
哦,我现在明白了 - 这可能代表通配符搜索,对吗?如果是这样,我个人并不知道如何从 LUIS 响应中删除此内容,而且我认为,当其中也有@提及时,我也看到过类似的情况。但是,如果这是为了方便搜索,这样您就知道在“ShowObject”实体之前和/或之后很有可能有一个 *,那么测试这一点应该很容易替换,字符串或正则表达式(用空格替换“星号加空格”,我的意思是 - 我意识到你需要星号本身)。基本上,您可以将“[start][space]”替换为“[start]”,最后也是如此。不漂亮,但可行且易于实现......
出于兴趣,您是否也期望 * 出现在字符串中间?
关于json - 测试话语 : comparison to "published" produces JSON string completely different from results obtained by querying the API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60231755/
我知道这不是 Stack Overflow 的正确问题类型(请原谅我),但我花了几个小时试图让 Discourse 在我的机器上运行。它以前可以工作,但我升级到 Ruby 2.0 和 Rails 4,
我是一名优秀的程序员,十分优秀!