gpt4 book ai didi

azure - LUIS 未返回正确的实体值

转载 作者:行者123 更新时间:2023-12-03 04:16:35 27 4
gpt4 key购买 nike

我正在尝试学习如何使用 LUIS 来训练使用 NLP 在数据库中搜索数据的意图。我创建了一个 Intent UIM.Search 并添加了以下 Utterance ,其 token View 如下:

enter image description here

我将它们映射到实体,以便我可以获得基于 API 的查询的实际用户值,如下所示

enter image description here

问题当我使用测试面板并输入如下文本时遇到的问题:

向巴黎客户展示 Chocolatemagic 它返回的实体如下

enter image description here

当我输入用于训练的确切短语时,我会得到正确的结果,例如:

向我展示来自类加罗尔的 cakemagic 客户

返回

enter image description here

有人可以帮助我理解我在这里缺少什么,将用户查询转换为实际意图,然后将查询参数作为实体转换为 SQL 查询。

编辑1:

添加模型详细信息,但这次包括短语,实际上有效。但这不是我想要做的事情,因为那时我必须添加可在查询中使用的所有可能的单词组合

    {
"luis_schema_version": "3.1.0",
"versionId": "0.1",
"name": "UIM",
"desc": "",
"culture": "en-us",
"intents": [
{
"name": "None"
},
{
"name": "UIM.Search"
}
],
"entities": [
{
"name": "address.city",
"roles": []
},
{
"name": "address.country",
"roles": []
},
{
"name": "count",
"roles": []
},
{
"name": "search.order",
"roles": []
},
{
"name": "search.type",
"roles": []
},
{
"name": "subsidiary",
"roles": []
}
],
"composites": [
{
"name": "address",
"children": [
"address.city",
"address.country"
],
"roles": []
}
],
"closedLists": [],
"patternAnyEntities": [],
"regex_entities": [],
"prebuiltEntities": [
{
"name": "number",
"roles": []
}
],
"model_features": [
{
"name": "company Names",
"mode": true,
"words": "honeywell,chocolatemagic,boeing,jeppesen,cakemagic",
"activated": true
},
{
"name": "City Names",
"mode": true,
"words": "bangalore,paris,london,bellevue,berlin,amsterdam,rome,new york,madrid,moscow,sydney,tokyo,kirkland,redmond,frankfurt,barcelona,milan,vienna,prague,brussels,athens,lisbon,stockholm,munich,zurich,budapest,warsaw,copenhagen,dublin,hamburg,istanbul,oslo,bucharest,venice,helsinki,shanghai,geneva,beijing,zagreb,malaga,luxembourg,sofia,kiev,manchester,buenos aires,bangkok,singapore,tallinn,riga,seoul,melbourne,vilnius,toronto,cairo,dubai,los angeles,san francisco,montreal,vancouver,chicago,boston,mumbai,johannesburg,rio de janeiro,miami,seattle,new orleans,san diego,las vegas,houston,philadelphia,atlanta,dallas,denver,orlando,tampa,jacksonville,washington,detroit,phoenix,memphis,cleveland,pittsburgh,portland,baltimore,richmond,madison,nashville,san antonio,sacramento,charlotte,austin,indianapolis,minneapolis,columbus,buffalo,oakland,louisville,cincinnati,newark,milwaukee,san jose,birmingham,raleigh",
"activated": true
},
{
"name": "Country Names",
"mode": true,
"words": "india,usa,uk,france,australia,germany,u.s.a.,u.k.,ireland,austria,finland,denmark,spain,netherlands,sweden,italy,poland,norway,greece,cyprus,belgium,belfast,switzerland,russia,malta,romania,hungary,slovenia,croatia,portugal,european,iceland,slovakia,bulgaria,prague,serbia,estonia,lithuania,latvia,ukraine,albania,armenia,moldova,belarus,kazakhstan,ghana,uruguay,azerbaijan,moscow,paraguay,montenegro,eurovision,venezuela,algeria,burkina,cameroon,tunisia,guatemala,honduras,lesotho,angola,bolivia,nicaragua,grenada,liberia,tanzania,ecuador,cuba,tobago,zimbabwe,ethiopia,rwanda,trinidad,fiji,mozambique,guyana,namibia,belize,haiti,barbados,cambodia,mauritania,mauritius,uganda,maldives,nigeria,kenya,botswana,bahamas,vanuatu,seychelles,africa",
"activated": true
},
{
"name": "Entity Names",
"mode": true,
"words": "customers,suppliers,fleets,transactions,companies,services,employees,retailers,manufacturers,partners,fleet,products,transaction,events,contact,projects,clients,programs,facilities,client,consultant",
"activated": true
},
{
"name": "Services Names",
"mode": true,
"words": "parts,services,planes,applications,components,systems,subsystems,sensors,software,equipment,accessories,electronics,cakes",
"activated": true
}
],
"regex_features": [],
"patterns": [
{
"pattern": "show me {subsidiary} from {search.type} in {address.city}",
"intent": "UIM.Search"
},
{
"pattern": "show me {count} {search.type} from {address.city} in {address.country}",
"intent": "UIM.Search"
},
{
"pattern": "show me all {search.type} from {address.city}",
"intent": "UIM.Search"
}
],
"utterances": [
{
"text": "show 4 customers who bought cakes",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 7,
"endPos": 15
},
{
"entity": "search.order",
"startPos": 28,
"endPos": 32
}
]
},
{
"text": "show 5 customers who bought cakes from bangalore",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 7,
"endPos": 15
},
{
"entity": "search.order",
"startPos": 28,
"endPos": 32
},
{
"entity": "address.city",
"startPos": 39,
"endPos": 47
}
]
},
{
"text": "show all customers form bangalore",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 9,
"endPos": 17
},
{
"entity": "address.city",
"startPos": 24,
"endPos": 32
}
]
},
{
"text": "show customers in bangalore for cakemagic",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 5,
"endPos": 13
},
{
"entity": "address.city",
"startPos": 18,
"endPos": 26
},
{
"entity": "subsidiary",
"startPos": 32,
"endPos": 40
}
]
},
{
"text": "show me all indian customers for cakemagic",
"intent": "UIM.Search",
"entities": [
{
"entity": "address.country",
"startPos": 12,
"endPos": 17
},
{
"entity": "search.type",
"startPos": 19,
"endPos": 27
},
{
"entity": "search.order",
"startPos": 33,
"endPos": 41
}
]
},
{
"text": "show me cakemagic customers from bangalore",
"intent": "UIM.Search",
"entities": [
{
"entity": "subsidiary",
"startPos": 8,
"endPos": 16
},
{
"entity": "search.type",
"startPos": 18,
"endPos": 26
},
{
"entity": "address.city",
"startPos": 33,
"endPos": 41
}
]
},
{
"text": "show me customers from bangalore who liked our cakes",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 8,
"endPos": 16
},
{
"entity": "address.city",
"startPos": 23,
"endPos": 31
},
{
"entity": "search.order",
"startPos": 47,
"endPos": 51
}
]
},
{
"text": "show me customers from usa",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 8,
"endPos": 16
},
{
"entity": "address.country",
"startPos": 23,
"endPos": 25
}
]
},
{
"text": "show me customers who have ordered cake",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 8,
"endPos": 16
},
{
"entity": "search.order",
"startPos": 35,
"endPos": 38
}
]
},
{
"text": "show me customers who likes our cake",
"intent": "None",
"entities": [
{
"entity": "search.type",
"startPos": 8,
"endPos": 16
},
{
"entity": "search.order",
"startPos": 32,
"endPos": 35
}
]
},
{
"text": "show me top 3 customers from bangalore in india",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 14,
"endPos": 22
},
{
"entity": "address.city",
"startPos": 29,
"endPos": 37
},
{
"entity": "address.country",
"startPos": 42,
"endPos": 46
}
]
},
{
"text": "show me top 3 customers from india",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 14,
"endPos": 22
},
{
"entity": "address.country",
"startPos": 29,
"endPos": 33
}
]
},
{
"text": "show top 3 customers form bangalore who have ordered cakes in last 3 months",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 11,
"endPos": 19
},
{
"entity": "address.city",
"startPos": 26,
"endPos": 34
},
{
"entity": "search.order",
"startPos": 53,
"endPos": 57
}
]
},
{
"text": "which customers from usa bought cakes from me",
"intent": "UIM.Search",
"entities": [
{
"entity": "search.type",
"startPos": 6,
"endPos": 14
},
{
"entity": "address.country",
"startPos": 21,
"endPos": 23
},
{
"entity": "search.order",
"startPos": 32,
"endPos": 36
}
]
}
],
"settings": []
}

问候基兰

最佳答案

Kiran,问题是您的应用程序中只有两个包含附属实体的话语。除此之外,“cakemagic”这个词不是一个真正的词,因此,LUIS 不知道如何处理该词。选项是包含更多可用于训练 LUIS 的话语(即更多上下文示例,实体可以在话语中显示,或者子公司可以是不同的值),使用 LUIS 自然识别的真实单词,或者构建短语列表以包含您想要包含的所有单词。

关于azure - LUIS 未返回正确的实体值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52464106/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com