LUIS:在一次话语中识别多个相同的复合实体
LUIS: recognizing more than one of the same composite entity in one utterance
我是 LUIS 的新手,我仍在尝试解决问题,我似乎无法弄清楚的一件事是如何让我的 LUIS 应用识别哪些实体属于同一复合实体在一个话语中有多个实例。我知道这令人困惑让我尝试更好地解释:
我的测试应用程序是关于订购东西的。
我有这句话:
purchase for me 2 red hot chilli pepper albuns and an amazing spiderman figure please
返回的 JSON 是这样的:
{
"query": "purchase for me 2 red hot chilli pepper albuns and an amazing spiderman figure please",
"topScoringIntent": {
"intent": "Order",
"score": 0.9981847
},
"intents": [
{
"intent": "Order",
"score": 0.9981847
},
{
"intent": "Read",
"score": 0.0023417694
},
{
"intent": "None",
"score": 0.00118408469
}
],
"entities": [
{
"entity": "red hot chilli pepper albuns",
"type": "Item.Description",
"startIndex": 18,
"endIndex": 45,
"score": 0.8821352
},
{
"entity": "amazing spiderman figure",
"type": "Item.Description",
"startIndex": 54,
"endIndex": 77,
"score": 0.9167113
},
{
"entity": "2",
"type": "Item.Quantity",
"startIndex": 16,
"endIndex": 16,
"score": 0.9843564
},
{
"entity": "an",
"type": "Item.Quantity",
"startIndex": 51,
"endIndex": 52,
"score": 0.948889554
}
]
}
它可以正确识别实体,但它不知道“2”对应于 "red hot chilli pepper albuns" 而 "an" 对应于 "the amazing spiderman figure"
我的实体是:
Item.Quantity - simple entity
Item.Description - simple entity
Item.Number - simple entity
Item - composite entity with the above as children
这甚至可以做到吗?
是的,这完全有可能。而且您在使用复合实体方面走在正确的轨道上,只是需要更改复合实体的培训。首先对于复合实体,应该添加和训练子实体(您已经完成)。
接下来是标记复合实体。转到订单意图,对于任何话语,我们可以说:
purchase for me 2 red hot chilli pepper albuns
select Item.Quantity
实体,然后 select 包裹在复合实体中 从列表中。文字下方会出现一条绿线,现在将光标向右移动直到红辣椒albuns(或直到任何你想包裹的实体),你会注意到绿色接下来的行表示一个复合实体。 Select 出现的列表中的复合名称 Item
。
对于同一话语中的多个复合实体,例如
purchase for me 2 red hot chilli pepper albuns and an amazing spiderman figure please
重复相同的过程,除了第一个复合实体将被包装和训练 2 red hot chilli pepper albuns
,下一个复合实体将被包装和训练 an amazing spiderman figure
不要忘记训练和发布 LUIS 应用。
要更深入地了解复合实体,请查看 Luis tutorial - composite entity
我是 LUIS 的新手,我仍在尝试解决问题,我似乎无法弄清楚的一件事是如何让我的 LUIS 应用识别哪些实体属于同一复合实体在一个话语中有多个实例。我知道这令人困惑让我尝试更好地解释:
我的测试应用程序是关于订购东西的。
我有这句话:
purchase for me 2 red hot chilli pepper albuns and an amazing spiderman figure please
返回的 JSON 是这样的:
{
"query": "purchase for me 2 red hot chilli pepper albuns and an amazing spiderman figure please",
"topScoringIntent": {
"intent": "Order",
"score": 0.9981847
},
"intents": [
{
"intent": "Order",
"score": 0.9981847
},
{
"intent": "Read",
"score": 0.0023417694
},
{
"intent": "None",
"score": 0.00118408469
}
],
"entities": [
{
"entity": "red hot chilli pepper albuns",
"type": "Item.Description",
"startIndex": 18,
"endIndex": 45,
"score": 0.8821352
},
{
"entity": "amazing spiderman figure",
"type": "Item.Description",
"startIndex": 54,
"endIndex": 77,
"score": 0.9167113
},
{
"entity": "2",
"type": "Item.Quantity",
"startIndex": 16,
"endIndex": 16,
"score": 0.9843564
},
{
"entity": "an",
"type": "Item.Quantity",
"startIndex": 51,
"endIndex": 52,
"score": 0.948889554
}
]
}
它可以正确识别实体,但它不知道“2”对应于 "red hot chilli pepper albuns" 而 "an" 对应于 "the amazing spiderman figure"
我的实体是:
Item.Quantity - simple entity
Item.Description - simple entity
Item.Number - simple entity
Item - composite entity with the above as children
这甚至可以做到吗?
是的,这完全有可能。而且您在使用复合实体方面走在正确的轨道上,只是需要更改复合实体的培训。首先对于复合实体,应该添加和训练子实体(您已经完成)。
接下来是标记复合实体。转到订单意图,对于任何话语,我们可以说:
purchase for me 2 red hot chilli pepper albuns
select Item.Quantity
实体,然后 select 包裹在复合实体中 从列表中。文字下方会出现一条绿线,现在将光标向右移动直到红辣椒albuns(或直到任何你想包裹的实体),你会注意到绿色接下来的行表示一个复合实体。 Select 出现的列表中的复合名称 Item
。
对于同一话语中的多个复合实体,例如
purchase for me 2 red hot chilli pepper albuns and an amazing spiderman figure please
重复相同的过程,除了第一个复合实体将被包装和训练 2 red hot chilli pepper albuns
,下一个复合实体将被包装和训练 an amazing spiderman figure
不要忘记训练和发布 LUIS 应用。
要更深入地了解复合实体,请查看 Luis tutorial - composite entity