petergtz / alexa-wikipedia

A Wikipedia skill for Amazon Alexa
https://www.amazon.de/Peter-Götz-Wikipedia/dp/B07BKRT478
MIT License
7 stars 4 forks source link

Add more intuitive way to directly start an article #68

Closed claell closed 4 years ago

claell commented 4 years ago

Currently one has to say something like "Alexa, frage Meine Enzyklopädie nach suche nach Käsekuchen". Intents like "Alexa, frage Meine Enzyklopädie nach Käsekuchen" don't work. Maybe that functionality can be added.

petergtz commented 4 years ago

It's kind of hard to do that, unfortunately. As https://developer.amazon.com/de/docs/custom-skills/understanding-how-users-invoke-custom-skills.html#cert-invoke-specific-request explains, Alexa can map a "Alexa, frage Meine Enzyklopädie nach Käsekuchen phrase, but:

Käsekuchen in this case is a so-called SearchQuery or PhraseType slot. And the sample utterance would consist of only that SearchQuery slot and nothing else. And when you try building that, you get a:

Sample utterance "{word}" in intent "DefineIntent" must include a carrier phrase. Sample intent utterances with phrase types cannot consist of only slots. Error code: MissingCarrierPhraseWithPhraseSlot

There are other slot types with a pre-defined set of values. That would work. But you wouldn't be able to find anything with that pre-defined set of words.

petergtz commented 4 years ago

What does work is:

suche nach Käsekuchen bei meine enzyklopädie

or even:

suche nach käsekuchen in meiner enzyklopädie

But it's still somewhat unsatisfying that your examples do not work.

claell commented 4 years ago

Thanks for the explanation, that makes sense. One thought would be to have the word "nach" as the "carrier phrase", maybe that works and Alexa maps that correctly?

Also thanks for the other example phrases, I guess I will use them for now. That way it is already pretty convenient.

petergtz commented 4 years ago

It's already there :-) https://github.com/petergtz/alexa-wikipedia/blob/f191f3a1ce3eeda603c980890bd2e5bc66a72746/models/de-DE.json#L37

Doesn't help though :-(

claell commented 4 years ago

Too bad.

I created an detailed issue for this now, seems that there are also other devs with this problem: https://gitlab.com/clel/amazon-alexa-issue-tracker/issues/15

So, I guess this is again an "upstream" issue and possible workarounds are also not ideal. I mean, one could create a custom slot with all Wikipedia article titles, I guess (but there might be a limit for the amount of values).

So let me know what you think about this. If you don't see much potential, I think this can be closed.

petergtz commented 4 years ago

I mean, one could create a custom slot with all Wikipedia article titles, I guess (but there might be a limit for the amount of values).

Thought about that too. But while it is also a maintenance nightmare, I don't think it would work very well either. Specifially, because currently, you can also ask this skill "Wie hoch ist der Eiffelturm" and it will come up with a proper response. And in general, I don't think Alexa's slot matching will work as reliably as Wikipedia's search engine. And you're right, there is also a limit for the number of values.

Closing for now. Let's re-open in case we've got new ideas.