我为Alexa技能设置了两个意图,NextTrainIntent
和TrainArrivalIntent
。在我的示例话语中,我将它们映射为:
NextTrainIntent what is the next train to {DestinationCity}
NextTrainIntent what's the next train to {DestinationCity}
NextTrainIntent when is the next train to {DestinationCity}
NextTrainIntent when is the next train from {OriginCity}
NextTrainIntent when is the next train from {OriginCity} to {DestinationCity}
NextTrainIntent when is the next train
TrainArrivalIntent when does train {TrainNumber} arrive at {DestinationCity}
TrainArrivalIntent when does train {TrainNumber} arrive
TrainArrivalIntent when does train {TrainNumber} get in
...
当我使用亚马逊的服务模拟器测试时,如果我输入以下话语作为文本:“何时列车9306到达”, 服务请求json显示它已将话语映射到NextTrainIntent,即使它与TrainArrivalIntent的示例话语完全匹配:
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.ccafa51d-38de-4500-b17b-f94bbee1ad93",
"intent": {
"name": "NextTrainIntent",
但是,如果我测试话语:“火车9305什么时候进入”,它会正确映射到TrainArrivalIntent。
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.7a415e55-14b3-4789-9a83-0f6cf2f16a6c",
"intent": {
"name": "TrainArrivalIntent",
这里有什么问题?在这种情况下,单词“到达”的存在对于辨别两个意图是至关重要的。然而,Alexa似乎忽略了它。如何让它“到达”使用?
答案 0 :(得分:0)
我删除了"什么是"和"何时是"我的样本中的陈述开始起作用。
NextTrainIntent next train from {OriginCity} to {DestinationCity}
NextTrainToFromIntent next train to {DestinationCity} from {OriginCity}
TrainArrivalIntent train {TrainNumber} arrive at {DestinationCity}
TrainArrivalIntent train {TrainNumber} arrive
TrainArrivalIntent train {TrainNumber} get in
TrainArrivalIntent train {TrainNumber} arrive at {DestinationCity}
TrainArrivalIntent train {TrainNumber} get in to {DestinationCity}
TrainArrivalIntent train number {TrainNumber} arrive at {DestinationCity}
TrainArrivalIntent train number {TrainNumber} get in to {DestinationCity}
TrainArrivalIntent train number {TrainNumber} arrive
TrainArrivalIntent train number {TrainNumber} get in
由于上面的语音示例还有其他一些变化,我并不认为删除问题前缀是解决问题的原因。与机器学习一样,您通常无法得到答案"为什么"有事有用。无论是什么原因,上述样本话语确实使问题中的话语得到了恰当的认可。