发布于 2016-08-05 15:02:42
不幸的是,目前还没有办法禁用它,但好消息是返回的预测将处理原始字符串,而不是您在示例标记过程中看到的标记字符串。
在如何理解JSON响应的文档中,您可以看到示例输出保留了原始的“查询”字符串,而提取的实体在原始字符串中有基于零的字符索引("startIndex", "endIndex");这将允许您处理索引而不是解析的实体短语。
{
"query": "Book me a flight to Boston on May 4",
"intents": [
{
"intent": "BookFlight",
"score": 0.919818342
},
{
"intent": "None",
"score": 0.136909246
},
{
"intent": "GetWeather",
"score": 0.007304534
}
],
"entities": [
{
"entity": "boston",
"type": "Location::ToLocation",
"startIndex": 20,
"endIndex": 25,
"score": 0.621795356
},
{
"entity": "may 4",
"type": "builtin.datetime.date",
"startIndex": 30,
"endIndex": 34,
"resolution": {
"date": "XXXX-05-04"
}
}
]}
https://stackoverflow.com/questions/38749246
复制相似问题