简体   繁体   English

试图让Alexa处理包含一些相同单词的不同插槽类型

[英]Trying to make Alexa address different slot types that contain some of the same words

I'm having difficulty right now having Alexa address different slot types that contain some of the same words. 我现在很难让Alexa处理包含一些相同单词的不同插槽类型。 I'm building this on the how-to tutorial skill https://github.com/alexa/skill-sample-nodejs-howto Let me explain what I'm trying to do: -At present you can say "Alexa, what are the ingredients for french toast"? 我正在构建这个如何教程技巧https://github.com/alexa/skill-sample-nodejs-howto让我解释一下我正在尝试做什么: - 目前你可以说“Alexa,什么是法国吐司的成分“? This will return ingredients from a recipe.js file that is included in the above tutorial, which I have slightly modified. 这将返回上面教程中包含的recipe.js文件中的成分,我稍作修改。 The words for these are built off a slot type, LIST_OF_ITEMS 这些单词是基于插槽类型LIST_OF_ITEMS构建的

-However, I want to be able to say "Alexa, how do I make french toast" and I want this to return the process of making french toast, which I also wrote up. - 但是,我希望能够说“Alexa,我如何制作法式吐司”,我希望这能让我重新开始制作法式吐司的过程,我也写了这篇文章。 These words are contain in a different slot, LIST_OF_STEPS 这些单词包含在不同的插槽中, LIST_OF_STEPS

A sample of two intents I have are: 我有两个意图的样本是:

RecipeIntent what ingredients do I need for {Item}

StepIntent how to make a {Step}

In this example, {Item} and {Step} are the same thing(french toast) but are listed in different slots. 在此示例中,{Item}和{Step}是相同的东西(法式吐司),但列在不同的插槽中。

In my recipe.js file I have two languages being loaded at once. 在我的recipe.js文件中,我有两种语言一次加载。 I've cut out most of this for clarity 为了清晰起见,我已经删除了大部分内容

"RECIPE_EN_GB" : {

//...

"french toast": "To make french toast, you will need 30g of unsalted butter, two eggs, milk 160g,

//..

},

"RECIPE_EN_GBTEST" : {

//...

"french toast": "Test test Lorem ipsum"

//...

},

When I say "What are the ingredients for french toast" it will give me back RECIPE_EN_GB french toast, as desired. 当我说“法国吐司的成分是什么”时,它会根据需要给我回RECIPE_EN_GB法式吐司。 When I ask how it's made, it will still give me RECIPE_EN_GB and not RECIPE_EN_GBTEST. 当我问它是如何制作的时候,它仍然会给我RECIPE_EN_GB而不是RECIPE_EN_GBTEST。 Infact if I just use 'french toast' it will give me back RECIPE_EN_GB , I don't even need to use an utterance. 事实上,如果我只是使用'法式吐司'它会给我回RECIPE_EN_GB,我甚至不需要使用话语。 I did at one point put in "testfood": "Testfood Lorem ipsum" in, and it called it fine when I said testfood. 我做了一次“testfood”:“Testfood Lorem ipsum”,当我说testfood时它称之为罚款。 I'm aware this is unclear but it's a hard problem to try explain correctly, and I'm sorry. 我知道这个还不清楚,但尝试正确解释是个难题,我很抱歉。 If anyone has experience extended the how_to tutorial please let me know 如果有人有经验扩展了how_to教程,请告诉我

It is important to ensure that your intents are different enough that Alexa can tell the difference. 重要的是要确保您的意图足够不同,以便Alexa可以区分它们。 Alexa uses a fuzzy comparison algorithm, not just exact matching to decide which intent the user has spoken. Alexa使用模糊比较算法,而不仅仅是精确匹配来决定用户说出的意图。

So for example, two intents with these utterances: 1. you give me {slot_name} 2. he gave me {slot_name} would cause Alexa to have a very hard time decided which is correct when a user says "got me {slot_name}". 例如,两个意图与这些话语:1。你给我{slot_name} 2.他给我{slot_name}将导致Alexa有一个非常艰难的时间决定哪个是正确的,当用户说“得到我{slot_name}” 。

Try changing your utterances to something very unique in each intent, get those working, then add additional utterances. 尝试将你的话语改为每个意图中非常独特的东西,让那些工作,然后添加额外的话语。 The design of your utterances is really the most important part of designing an Alexa skill. 你的话语设计确实是设计Alexa技能最重要的部分。 I recommend giving it a lot of time. 我建议给它很多时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM