机智训练提取机智/数字和机智/ amountOfMoney它正确解释后面的句子为3.03磅: 1)花了3磅和3便士 2)花了3美分 3)花了3英镑:
但失败了: 1)花了3便士 2)花了3p
问题: 1)这是一个错误/新功能? 2)有解决方法吗? 参考:https://en.wikipedia.org/wiki/Pound_sterling 花费3磅和3美分的WIT.AI API响应
{
"msg_id": "XXXXXXXXXXXXXXXXXXX",
"_text": "spent 3 pounds and 3 cent",
"entities": {
"amount_of_money": [
{
"_body": "3 pounds and 3 cent",
"confidence": 1,
"_start": 6,
"_end": 25,
"_entity": "amount_of_money",
"type": "value",
"value": 3.03,
"unit": "£"
}
],
"intent": [
{
"confidence": 0.9873680621152465,
"_entity": "intent",
"value": "expense"
}
]
}
}
“Spent 3p”的WIT.AI API响应:
{
"msg_id": "XXXXXXXXXXXXXXXXXXX",
"_text": "spent 3p",
"entities": {
"number": [
{
"_body": "3",
"confidence": 1,
"_start": 6,
"_end": 7,
"_entity": "number",
"type": "value",
"value": 3
}
],
"intent": [
{
"confidence": 0.9928105550766221,
"_entity": "intent",
"value": "expense"
}
]
}
}
答案 0 :(得分:1)
wit/number
和wit/amount-of-money
实体依赖Duckling进行解析。
以下是定义英语金额的规则:https://github.com/wit-ai/duckling/blob/master/resources/languages/en/rules/finance.clj
正如你所看到的,没有任何规则可以使用"便士"也不是" p"。 小鸭是开源的,你可以contribute做拉取请求。