Any Slots are catch-all placeholder slots that allow you to match keyphrases of arbitrary length outside of your Lexicons. You enclose an Any Slot name of your choosing with two pointy brackets, e.g. <<my_any_slot>>, in example sentences. If user input matches the placeholder slot exactly it will populate a Cognigy Slot with the matched content. The result is the same as if the matched user input had been added to an attached Lexicon as a keyphrase.
An example sentence with Any Slot "author_query" such as...
...will dynamically add user input that matches the pattern exactly to the slot author_query:
Say your bot helps the user find a certain book or document. A user might ask
"Who is the author of the hitchhiker's guide to the galaxy?"
To provide a well crafted response you want to search a database of books. The database can be queried by book title. In order to parse the book title you use an Any Slot:
Create a Machine Learning Intent with example sentences. Simply enclose your desired slot name inside pointy brackets <<my_any_slot>>. You can choose your slot name freely as long as it is alphanumeric with underscores and it must start with a letter.
Slot names must be alphanumeric and start with a letter
Not only do Any Slots match any arbitrary user input. You can pick almost any name of your choosing as the Any Slot name with the following limitations:
You cannot start the placeholder slot name with a number and must use alphanumeric characters or underscores (A-Z a-z 0-9 _) throughout.
You can use up to four Any Slots in the same sentence - but each Any Slot must have a different name.
Invalid Any Slot names will presently be ignored. Please note blue highlighting in the example sentence field.
Any input content that matches the pattern of an Any Slot in your example sentences exactly will be populated as a new Cognigy Slot. The result will be the same as if you had populated a Lexicon with the tag of your placeholder Any Slot and a keyphrase identical to the matched user input.
- Up to 4 different Any Slots per sentence
- Up to 500 example sentences with Any Slots per Flow
- Example sentences with Any Slots must be less than 400 characters long
- Any Slot patterns are interpreted literally and exact matching. Lexicon Synonyms or Square bracket ML Tags are not interpreted for the purpose of any slot extraction.
Updated over 3 years ago