Have you heard? New tips and tricks! |
Collection Projection
The projection operator is denoted by an exclamation mark ("!") and can be used as follows:{ "text": "<? entities['myentity'].![value] ?>"}
The above would print array of all the detected entity values for "myentity". For a message like "I am looking forward to an ice-cold beer and some pizza after work" the output could be as follows, listing the detected meal categories:
["drink", "food"]
The projection operator comes handy when applied together with the string join function or to preprocess data coming from a database like Db2 (see this tutorial on a database-driven chatbot). Find out more by visiting the collection of tips and tricks and the linked references.
If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or LinkedIn.