假设我在IBM中配置了一个会话服务,可以识别出一个以文字和片段形式给出的数字。例如,如果我有号码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实际上是猜测数字的人。
有没有办法在我的实体中为这个零获得第三个条目?还是别的工作?或者我可能缺少的配置?
发布于 2018-11-19 13:20:04
我刚在沃森助手那里试了一下,现在它得到了零。在启用@sys-numbers后,我的话语是thirteen two zero,我得到这些实体:
entities: [
0: {
entity: "sys-number",
location: [0, 8],
value: "13",
confidence: 1,
metadata: {numeric_value: 13}
}
1: {
entity: "sys-number",
location: [9, 12],
value: "2",
confidence: 1,
metadata: {numeric_value: 2}
}
2: {
entity: "sys-number",
location: [13, 17],
value: "0",
confidence: 1,
metadata: {numeric_value: 0}
}
]可能是匹配的实体已经改进了。
https://stackoverflow.com/questions/45923072
复制相似问题