我正在建立一个机器人使用微软机器人框架在C#和路易斯。使用预先构建的实体datetime.V2,我能够正确地捕获“上周”、“下个月”等术语。然而,当涉及到以下内容时,我感到震惊:
"Get me all products which has expiry life greater than 2 years",
"greater than today",
"> today" etc.,我是否使用LUIS复合实体?如果是这样,"Greater than“和"today”是否会成为名为"DateComparer“的复合实体的子级?有没有什么github示例可以让我参考一下,以了解复合实体是如何解析的?
提前感谢您的帮助和时间。
发布于 2017-09-16 03:38:24
我根据米斯科夫的建议创建了一个ComparerList。
"composites": [
{
"name": "DateComparer",
"children": [
"ComparerList",
"datetimeV2"
]
}
],
"closedLists": [
{
"name": "ComparerList",
"subLists": [
{
"canonicalForm": "gt",
"list": [
"greater than",
"larger than",
"more than",
"over",
"exceeding",
"higher than",
">"
]
},
{
"canonicalForm": "lt",
"list": [
"<",
"less than"
]
},
{
"canonicalForm": "eq",
"list": [
"=",
"equal to"
]
},
{
"canonicalForm": "le",
"list": [
"<=",
"less than or equal to"
]
},
{
"canonicalForm": "ge",
"list": [
">=",
"greater than or equal to"
]
}
]
}
],
"bing_entities": [
"datetimeV2"
],我能够训练Luis根据诸如“给我所有过期时间大于昨天的项目”之类的语句来返回以下json。在测试时,我得到了下面的json。
"entities": [
{
"entity": "greater than",
"type": "ComparerList",
"startIndex": 33,
"endIndex": 44,
"resolution": {
"values": [
"gt"
]
}
},
{
"entity": "greater than yesterday",
"type": "DateComparer",
"startIndex": 33,
"endIndex": 54,
"score": 0.6950233
},
{
"entity": "yesterday",
"type": "builtin.datetimeV2.date",
"startIndex": 46,
"endIndex": 54,
"resolution": {
"values": [
{
"timex": "2017-09-14",
"type": "date",
"value": "2017-09-14"
}
]
}
}从这里,我检索"gt“解析并在代码中使用它。
https://stackoverflow.com/questions/46226658
复制相似问题