【发布时间】:2018-03-02 17:02:12
【问题描述】:
我正在与 LUIS 合作,我想管理和处理的不仅是最高得分意图,还包括所有其他意图。在这种特定情况下,当有人在同一个短语中询问两件事时,就会发生这种情况。
例如:“我想买苹果”(“买”意图)和“我想卖香蕉”(“卖”意图)与“我想买香蕉卖苹果”(“买”和“销售”的意图相同的话语)。
这个想法是定义一个阈值,该阈值将接受高于此置信度数的任何意图得分为“有效”。
在一些测试中,我发现如果我们对同一个话语的意图很少,这可以工作。
但是,如果我们增加同一话语的意图数量,结果会迅速下降。
我提供了一些示例来阐明我的意思:下面的输出示例是在具有 4 个意图(“购买”、“销售”、“无”和“恶作剧”)和 1 个实体(“水果”)的 LUIS 上生成的
我想买苹果 ==>
{
"query": "i want to buy apples",
"topScoringIntent": {
"intent": "Buy",
"score": 0.999846
},
"intents": [
{
"intent": "Buy",
"score": 0.999846
},
{
"intent": "None",
"score": 0.2572831
},
{
"intent": "sell",
"score": 2.32163586e-7
},
{
"intent": "prank",
"score": 2.32163146e-7
}
],
"entities": [
{
"entity": "apples",
"type": "Fruit",
"startIndex": 14,
"endIndex": 19,
"resolution": {
"values": [
"apple"
]
}
}
]
}
我想卖香蕉 ==>
{
"query": "i want to sell bananas",
"topScoringIntent": {
"intent": "sell",
"score": 0.999886036
},
"intents": [
{
"intent": "sell",
"score": 0.999886036
},
{
"intent": "None",
"score": 0.253938943
},
{
"intent": "Buy",
"score": 2.71893583e-7
},
{
"intent": "prank",
"score": 1.97906232e-7
}
],
"entities": [
{
"entity": "bananas",
"type": "Fruit",
"startIndex": 15,
"endIndex": 21,
"resolution": {
"values": [
"banana"
]
}
}
]
}
我想吃披萨 ==>
{
"query": "i want to eat a pizza",
"topScoringIntent": {
"intent": "prank",
"score": 0.997353
},
"intents": [
{
"intent": "prank",
"score": 0.997353
},
{
"intent": "None",
"score": 0.378299
},
{
"intent": "sell",
"score": 2.72957237e-7
},
{
"intent": "Buy",
"score": 1.54754474e-7
}
],
"entities": []
}
现在有两个意图……每个意图的分数开始急剧下降
我想买苹果卖香蕉 ==>
{
"query": "i want to buy apples and sell bananas",
"topScoringIntent": {
"intent": "sell",
"score": 0.4442593
},
"intents": [
{
"intent": "sell",
"score": 0.4442593
},
{
"intent": "Buy",
"score": 0.263670564
},
{
"intent": "None",
"score": 0.161728472
},
{
"intent": "prank",
"score": 5.190861e-9
}
],
"entities": [
{
"entity": "apples",
"type": "Fruit",
"startIndex": 14,
"endIndex": 19,
"resolution": {
"values": [
"apple"
]
}
},
{
"entity": "bananas",
"type": "Fruit",
"startIndex": 30,
"endIndex": 36,
"resolution": {
"values": [
"banana"
]
}
}
]
}
如果我们包含第三个意图,LUIS 似乎崩溃了:
我想买苹果,卖香蕉,吃披萨 ==>
{
"query": "i want to buy apples, sell bananas and eat a pizza",
"topScoringIntent": {
"intent": "None",
"score": 0.139652014
},
"intents": [
{
"intent": "None",
"score": 0.139652014
},
{
"intent": "Buy",
"score": 0.008631414
},
{
"intent": "sell",
"score": 0.005520768
},
{
"intent": "prank",
"score": 0.0000210663875
}
],
"entities": [
{
"entity": "apples",
"type": "Fruit",
"startIndex": 14,
"endIndex": 19,
"resolution": {
"values": [
"apple"
]
}
},
{
"entity": "bananas",
"type": "Fruit",
"startIndex": 27,
"endIndex": 33,
"resolution": {
"values": [
"banana"
]
}
}
]
}
您是否知道/推荐我应该用来训练 LUIS 以缓解此问题的任何方法?在同一个话语中处理多个意图是我的案例的关键。
非常感谢您的帮助。
【问题讨论】:
-
每个领域意图应至少有 10 个话语,其中每个意图的话语与其他意图话语不同。 none 意图不应包含任何与域相关的意图,并且应包含至少 10% 的总话语数。
-
在此处查看我对 1 个 LUIS 查询中的多个意图的回答:stackoverflow.com/questions/48703996/…
标签: nlp microsoft-cognitive azure-language-understanding