【发布时间】:2018-02-05 23:07:55
【问题描述】:
假设我在 IBM Watson 中配置了一个对话服务,可以识别以单词和片段形式给出的数字。例如,如果我有号码1320,则可以发送为thirteen twenty或thirteen two zero等。
在第一种情况下,我将从对话服务中获得类似的信息:
{
// ...
"entities": [
{
"entity": "sys-number",
"location": [
0,
5
],
"value": "13",
"confidence": 1,
"metadata": {
"numeric_value": 13
}
},
{
"entity": "sys-number",
"location": [
6,
12
],
"value": "20",
"confidence": 1,
"metadata": {
"numeric_value": 20
}
}
]
// ...
}
在第二种情况下(thirteen two zero):
{
// ...
"entities": [
{
"entity": "sys-number",
"location": [
0,
5
],
"value": "13",
"confidence": 1,
"metadata": {
"numeric_value": 13
}
},
{
"entity": "sys-number",
"location": [
6,
14
],
"value": "2",
"confidence": 1,
"metadata": {
"numeric_value": 2
}
}
]
// ...
}
这里最大的问题是:我的零在哪里?
我知道这个问题被问了不止一次,但我找到的答案都没有解决我当前的问题。 我见过可以使用正则表达式的示例,但这是针对实际数字的,这里我有单词,而 Watson 是真正猜数字的人。
有没有办法在我的实体中为那个零获取第三个条目?或其他工作?还是我可能缺少的配置?
【问题讨论】: