Writing good examples
Much of the performance of your bot depends on how well it recognizes user inputs. Writing good examples for classes and conditions is crucial for training the bot. These examples can be written inside the flow and used to generate a Match. Doing this will help the development in the Quality Assurance (QA) stage as the examples inside a flow are used for testing with Auto-test.
After completing this chapter, you will know how to write good examples for your flows.
Learning examples for classes
One of the biggest advantages of using machine learning algorithms is that you can use them without needing linguistic skills. When using a classifier, for example, you don't need to understand the exact characteristics that define what an input is about. You can focus on collecting example inputs for the subjects you want to cover and, once you have trained a model using that data, you let the model do its magic. That makes it relatively easy to train a system to understand natural language without needing linguistic skills.
Classes in Teneo are built based on training examples. This is a very common approach when building triggers. Generally, the classes are dependant on one structure. Here is a list for things to think of when creating learning examples for Classes.
- Use natural language.
- Formulate complete sentences, as if you are addressing a human being. Some fluff is alright, but try to avoid it and do not overdo it.
- Make ample use of synonyms for verbs and nouns.
- This is important as a variety of words used will help the bot to correctly respond to more varied input.
- Do not use very short examples (keyword-like inputs).
- Short examples are better covered by conditions. Instead, try to write long examples, which our classes excel at working with.
- Do not use context-dependent examples.
- Replace occurrences of pronouns by nouns or verbs. For example, avoid the use of the word 'it'.
- Use different sentence structures to create as much variation as possible.
- For example, the user ordering coffee can be written as, 'I'd like a coffee' and 'Can you make me a coffee?'. This is mainly so the class covers a much broader range of inputs.
- Stay focused: all examples should lead to the same answer.
- While trying to come up with training examples, think of whether it would make sense to give the same answer text to several different inputs. Multiple sentences are allowed but keep in mind all of the above.
- Create at least 10 training examples to start with.
- The optimal level is 20 training examples, but it is good practice to keep adding new examples to further educate the model based on its performance.
Classes can be found and managed inside the Class Manager.