LUIS 提取数字有困难
Difficulty in LUIS extracting numbers
我有一个用于预订音频通话的 LUIS 模型说 "BookAcall",我有如下话语”
我使用预建实体 Number 从句子中提取任何数字实体。
预订 2 个地点 5 人的音频通话
现在,从 LUIS json 我得到了两个实体作为数字。
- 5 和其他是 2 但在 LUIS 中无法理解 5 没有人,2 没有地点
需要建议。
谢谢
下面是utterance和Entity的截图,No of users我使用了List类型的entity。
{
"query": "book a call tomorrow for 5 people for 2 location",
"topScoringIntent": {
"intent": "BookACall",
"score": 0.9560004
},
"intents": [
{
"intent": "BookACall",
"score": 0.9560004
},
{
"intent": "CryptoTrading",
"score": 0.0283502769
},
{
"intent": "None",
"score": 0.00855541
}
],
"entities": [
{
"entity": "tomorrow",
"type": "builtin.datetimeV2.date",
"startIndex": 12,
"endIndex": 19,
"resolution": {
"values": [
{
"timex": "2018-06-15",
"type": "date",
"value": "2018-06-15"
}
]
}
},
{
"entity": "location",
"type": "NoOfLocation",
"startIndex": 40,
"endIndex": 47,
"resolution": {
"values": [
"Location"
]
}
},
{
"entity": "people",
"type": "NoOfUsers",
"startIndex": 27,
"endIndex": 32,
"resolution": {
"values": [
"People"
]
}
},
{
"entity": "5",
"type": "builtin.number",
"startIndex": 25,
"endIndex": 25,
"resolution": {
"value": "5"
}
},
{
"entity": "2",
"type": "builtin.number",
"startIndex": 38,
"endIndex": 38,
"resolution": {
"value": "2"
}
}
]
}
添加一个包含模式中数字的模式
Book audio call for 5 people for 2 location
因为人和位置是实体。您可以通过检查实体的 start index and end index 来尝试跟踪哪个数字对应于人和位置。
场景可能是:
预订 2 个地点的 5 人语音通话
为 5 人预订 2 个地点的音频通话
因此,如果您获得 2 个数字类型实体和一个位置类型,则人员类型检查哪个数字先出现,然后检查哪个实体是人还是位置先出现。这样你就可以做一个映射。
按照 DFBerry 在此 , you can create a composite entity 中的建议,将用户的数字实体和列表类型实体作为子实体。然后您可以从返回的响应中提取该复合实体中的用户数。
创建一个复合实体,如下所示:
从该复合实体中提取用户数:
我有一个用于预订音频通话的 LUIS 模型说 "BookAcall",我有如下话语” 我使用预建实体 Number 从句子中提取任何数字实体。
预订 2 个地点 5 人的音频通话
现在,从 LUIS json 我得到了两个实体作为数字。
- 5 和其他是 2 但在 LUIS 中无法理解 5 没有人,2 没有地点
需要建议。 谢谢
下面是utterance和Entity的截图,No of users我使用了List类型的entity。
{
"query": "book a call tomorrow for 5 people for 2 location",
"topScoringIntent": {
"intent": "BookACall",
"score": 0.9560004
},
"intents": [
{
"intent": "BookACall",
"score": 0.9560004
},
{
"intent": "CryptoTrading",
"score": 0.0283502769
},
{
"intent": "None",
"score": 0.00855541
}
],
"entities": [
{
"entity": "tomorrow",
"type": "builtin.datetimeV2.date",
"startIndex": 12,
"endIndex": 19,
"resolution": {
"values": [
{
"timex": "2018-06-15",
"type": "date",
"value": "2018-06-15"
}
]
}
},
{
"entity": "location",
"type": "NoOfLocation",
"startIndex": 40,
"endIndex": 47,
"resolution": {
"values": [
"Location"
]
}
},
{
"entity": "people",
"type": "NoOfUsers",
"startIndex": 27,
"endIndex": 32,
"resolution": {
"values": [
"People"
]
}
},
{
"entity": "5",
"type": "builtin.number",
"startIndex": 25,
"endIndex": 25,
"resolution": {
"value": "5"
}
},
{
"entity": "2",
"type": "builtin.number",
"startIndex": 38,
"endIndex": 38,
"resolution": {
"value": "2"
}
}
]
}
添加一个包含模式中数字的模式
Book audio call for 5 people for 2 location
因为人和位置是实体。您可以通过检查实体的 start index and end index 来尝试跟踪哪个数字对应于人和位置。
场景可能是:
预订 2 个地点的 5 人语音通话 为 5 人预订 2 个地点的音频通话
因此,如果您获得 2 个数字类型实体和一个位置类型,则人员类型检查哪个数字先出现,然后检查哪个实体是人还是位置先出现。这样你就可以做一个映射。
按照 DFBerry 在此
创建一个复合实体,如下所示:
从该复合实体中提取用户数: