We are currently developing an AI (for Alexa) which should be able to answer a wide variety of questions. It is very important that users are able to phrase complex questions which shall be analyzed in the backend. If Alexa drops them early on because of limited utterances and slot types, we can't provide such a service.
At the moment we are experimenting with the following approach. (Keep in mind that our experiment is based on German. Other languages might behave differently.)
1. Custom Slot Types per Word Class
We defined custom slot types for the following word classes:
- interrogation (what, who, when)
- item (cybersecurity, darknet, malware)
- verb (is, has, can)
- adjective (popular, inexpensive, insecure)
- pronoun (the, he, she)
2. Sample Utterances for Sentence Structure
Then we have defined possible structures for sentences with sample utterances:
QuestionIntent {Interrogation}
QuestionIntent {Item}
QuestionIntent {Verb}
QuestionIntent {Adjective}
QuestionIntent {Interrogation} {Verb} {Item}
QuestionIntent {Interrogation} {Verb} {Item} {Adjective}
QuestionIntent {Interrogation} {Verb} {Pronoun} {Item}
QuestionIntent {Interrogation} {Verb} {Pronoun} {Pronoun} {Item}
QuestionIntent {Interrogation} {Verb} {Pronoun} {Item} {Preposition} {Item}
QuestionIntent {Interrogation} {Verb} {Adjective} {Item}
QuestionIntent {Interrogation} {Verb} {Pronoun} {Adjective} {Item}
QuestionIntent {Interrogation} {Item} {Verb}
QuestionIntent {Interrogation} {Item} {Verb} {Adjective}
QuestionIntent {Interrogation} {Item} {Verb} {Pronoun} {Adjective}
QuestionIntent {Item} {Verb} {Interrogation}
QuestionIntent {Verb} {Item} {Verb}
QuestionIntent {Verb} {Adjective} {Item} {Verb}
3. NLP Analysis in Backend
Then we do an NLP analysis of the submitted words in the backend. The received data looks like this:
"intent": {
"name": "QuestionIntent",
"slots": {
"Item": {
"name": "Item",
"value": "darknet"
},
"Preposition": {
"name": "Preposition"
},
"Adjective": {
"name": "Adjective"
},
"Verb": {
"name": "Verb",
"value": "is"
},
"Interrogation": {
"name": "Interrogation",
"value": "what"
},
"Pronoun": {
"name": "Pronoun",
"value": "the"
}
}
}
Some words might be lost, some others might be misheard. In this case, we remember topics from earlier exchanges and "fill" the missing words with these. For example: What is {it}?
⇒ What is {Darknet}?
We were experimenting with a broad list of lists for slot types. But this increases the risk of mishearing something (a good example in English is write and right, luckily they are not assigned to the same word class). So we switched to a very narrow approach. The lists only contain words which can be handled by the AI and are stored in the knowledge base. For example, the list of items does not contain the words pony or unicorn. We expect this to come up with better results (less confusing answers).
Complex sentences not defined with a utterances structure are highly confusing to work with. For example, if a sentence contains more than 2 verbs (which might be necessary to build tense). But so far our approach leads to results with a good level of accuracy as long as the user behaves with some level of politeness.
But in the end: Unfortunately, at the moment, it is not possible to dictate something like a memo with an infinite amount of different words and sentence structures.