Creating entities and intents Victoria Alves June 06, 2022 16:45 Updated Index: How to create an entity Creating an intention Good practices for creating examples in knowledge bases In this article, we will teach you how to create entities and intentions for a good performance of artificial intelligence within your chatbot. How to create an entity To add a new entity to the portal, select your bot, click on the Artificial Intelligence module, and choose the Entities option on the left side menu. Click the Add Entity button, give your entity a name, register a value and define synonyms for each of your entity's values. Note: Don't forget to save your entity after registering all values. Creating an intention To add a new intention to the portal, select your bot, click on the Artificial Intelligence module, and choose the Intentions option on the left side menu. Click on the Add Intention button, give a name to your intention and register examples of phrases sent by users, related to the created intention. It is necessary to add a variety of examples to teach the AI model. Note: Don't forget to save your intention after registering all the examples. Good practices for creating examples in knowledge bases Based on studies by our AI team, shared knowledge and conversations with experts, we suggest good practices for developments and examples in knowledge bases and are presented in recommendations below. It is worth mentioning that in this article we will focus on intentions, due to the format of entities we will leave it to discuss them in another article. When creating your knowledge base it will be necessary to create a set of intentions and, optionally, a set of entities, and it is worth considering concepts of use and creation of a test file. Recommendations Users often tend to interact with the bot by asking questions, so writing examples in the form of questions would be a better practice. Use the most correct grammar possible. Avoid very short examples, with just one or two words. Ensure that examples of the same intention have the same semantic meaning (talk about the same thing). Ensure that the examples of the same intention have relevant variations in the wording. Avoid simple variations in the wording as much as possible (whether or not to include an article in the sentence). (Ex.: I want to receive the statement / I want to receive a statement) Try to create names of intentions that make sense and are related to the examples. Suggestion of a step by step to give names for intentions would be to read the registered examples trying to understand the main idea, explaining that idea in a sentence. Cut to 30 characters: OR cut to the first 30 characters, OR summarize the sentence in 3 words (up to 30 characters in the sum). Finally, use the result of this procedure as a new name for the intention. Also, a common recommendation from NLP providers is to have an average of 10 examples for each intention, since few examples hinder the generalization process, this number being just an estimate to be used as a reference, but the important thing is that the model is in good shape operation. Balance the number of examples in each intention. Intentions with many more examples than the others can: Be more recognized than the others. They may be incorrectly recognized and do not reach minimum levels of confidence. Intentions with far fewer examples than the others can: Behave unexpectedly. (Ex: Examples are recognized with very low reliability even though they are clearly of a certain intention, or examples of a certain intention being recognized as another with high reliability) Never be recognized in variations. Tips Thinking about improving the quality of the model we provide some tips Always go from content to example, not the other way around. Use the content as a source for generating new examples. When the input to generate the base is very large, try to prioritize the critical and most relevant issues. The fewer examples to evaluate, the better. Ensure that the examples are answered by the proposed content. The work is not linear, so it is important to emphasize the focus on constant and incremental work (do it little by little, but constantly) When evaluating syntactic variations, testing variations of the examples (the exact text of the example is always recognized by the provider) Exceptions Some expressions can be placed in the knowledge base even if they are not questions (statements, for example). If the client's vocabulary has slang or atypical mannerisms of speaking, it is not necessary to carry out "spelling correction". If the intention is on a very specific subject, identified by a simple word or expression, it can be added as an example in the model. The number of example rule should not be “set in stone”. The ideal is to seek a balance, avoiding as much as possible intentions with few examples. For more information, visit the discussion on the subject in our community or the videos on our channel. 😃 Related articles How to configure Dialogflow as your AI provider How to configure Watson Assistant as your AI provider Using the AI tool inside Builder How to configure LUIS as your AI provider What is AI (Artificial Intelligence) anyway?