The following guide walks you through the end-to-end process of designing machine learning Intents for your conversation. The topic is closely intertwined with general conversation design using Cognigy. Here, we want to focus on the best practices for Machine Learning Intents.
We recommend a step-by-step process for your project:
- Conversation design and intent identification
- Seed intents
- Train your intents
- Deployment and unsupervised learning
Walking you through the whole process of designing great intents will help you anticipate any issues before they arise. Of course, requirements can change at any time. Thanks to Cognigy's flexible, resourceful and modular approach you will be able to adapt quickly. If you encounter issues at any stage during the process do not hesitate to contact Cognigy Support.
Let's get started!
Every great Conversational AI starts at the drawing board!
Plan your flow and identify possible intents. The fewer intents you need to accomplish your use case the better. Fewer, more distinct intents work better than many potentially overlapping intents.
If you're new to the Cognigy platform you will soon discover that it offers extremely rich environment to deliver next-level conversational experiences. ML Intents may not be the most effective and efficient means to deliver the best conversational experience so make sure you are also familiar with the following concepts:
- Rule Intents are often a more simple and powerful alternative to ML Intents.
- Rich Flow Logic that can react to anything from simple keyphrase detection, to data written in your Context or provided by the user
- Processes to obtain structured information in your conversation
- Cognigy's in-built User profile management, why ask for data you may already have?
- Access external API and Databases within your conversation to enrich your data or for example, deliver state-of-the-art conversational search experiences. Ask our support if you want to learn more about your integration options!
- With Code Nodes and Modules you can easily adapt and expand the capabilities of your Flow to handle even the most complex and demanding requirements with ease.
To illustrate how to work with intents in Cognigy, we play through an example. We are an enterprise software company and want to offer a customer service bot where prospects can schedule a product demo. They can can also ask frequently asked questions on specific products.
After meeting with the team, we came up with following: Customers would call asking for help, if we identified the intent to schedule a demo we would close the transaction in a Cognigy Process.
The basic conversation flow required the following intents
- Handover to Cognigy's Handover integration
In addition, the team wanted to create tailored responses to answer frequently asked questions about the various products on offer.
With hundreds of products to choose from and often only minute differences in name, a range of professional, enterprise versions etc. the expressions of intents were hard to distinguish. Furthermore, to create as many intents also posed a huge workload.
Fortunately, we anticipated common design issues with our knowledge of Advanced ML Intent design concepts which you can familiarize yourself with at the end of this guide. In this case, we may run into issues with overlapping product categories. Overlapping intents are two or more intents hat are too similar to each other and difficult to distinguish.
Therefore it was decided to first create a general Intent ProductQuestion that captures a user's inquiry for more product information. Secondly, to create a Lexicon of all products and a separate Flow that answers product specific FAQ questions with keyphrase based logic. Once the general ProductQuestion Intent is found we execute a product FAQ flow that answers FAQ questions and disambiguates overlapping products.
It was a matter of minutes to draw up a proof of concept in Cognigy. Importantly, the initial stages of development are the place to experiment and research your design. Designing a conversational AI is a creative process and it is important to try out your ideas to make your user experience the best experience possible.
Here's a checklist to tell you're ready to move on to building your Flow:
- Developed a draft design idea for you flow
- Identified all intents in your conversation
- Resolved any design issues before they arise
Great, let's get started to build the flow!
With the conversation design in hand the Flow was developed.
Using Cognigy's CSV Upload feature the marketing executive himself could contribute his experience with customer queries using his favorite spreadsheet tool and a first set of intents was ready for testing the next day.
Here's what to keep in mind when writing and curating Intents:
Create relevant, varying Example Sentences
The intent is
orderFood. Example Sentences could include.
- I want to order pizza
- Do you have ice cream? I'll have some of that.
- Bill wants to eat cake
- Get me a large salad please
Do not add too few example sentences
For optimal performance, we recommend 8-15 example sentences per intent. We recommend 5 sentences at the very minimum to start with - if you only want to recognise small scope of specific utterances do explore whether Rule Intents may instead serve your purpose more effectively.
Do not add too many example sentences either, with more than about 30 sentences per intent you should look into simplifying the content instead - otherwise maintenance, debugging overhead and the potential for degraded recognition increases.
Do use lexicons and tags appropriately
Refer to our documentation on using Tags in intents and heed our tip to 'translate' rare words into common, popular utterances with synonyms.
Do not use uninformative or repetitive example sentences
For example, avoid repetitive sentences that only differ marginally:
- I want pizza
- I want salad
- I want cake
Here you might rather use a tag and represent more varied ways users might ask for a food.
To illustrate these best practices, you can download the CSV file used to seed the flow here.
As a rule of thumb, provide a representative sample of example sentences of the exact same data that your Flow receives from its users.
We also recommend for all linguistic features such as stop words, capitalization, verbosity, writing style etc. to simply match the expected user input. However, in order to create relevant example sentences you may absolutely use simplified, unnatural utterances to strip information and generic fluff from example sentences (e.g., "want eat pizza" could be a valid example sentence). The important thing is to be consistent across intents.
For larger projects, however, because of the requirement for consistency and a balanced usage of wordings and phrases across intents can be a burden. Here, it can is perfectly fine and can pay off to use a more sparse, choppy style when writing example sentences. E.g., "want pizza" instead of "I would like to eat a pizza". As long as you well capture the core meaning of the Intent using simpler, dumbed down sentences the NLU will be able to fill in the blanks.
Once you are done seeding your intents and your flow works as desired, stop! Thanks to Cognigy's world class Conversation design capabilities and Natural Language Understanding you should not need tons of existing training data or weeks of curation and training to get your conversation off the ground.
Before you move on, here is a checklist to tell you where you are ready to move on to the next phase:
- You have populated all of your Intents with 5+ relevant, varied example sentences
- All intents pass basic tests in the Intent Tester
- You can successfully navigate your conversation
Before you want to let your AI out in the wild you want test it. Thanks to Cognigy's Intent Trainer you can kill two birds with one stone and immediately use your work done in testing to improve your intents. This is called supervised learning, your AI will be grateful for it!
Let's talk to our flow and ask it for help:
Let's try something more difficult
Wow, this still works even though we did not explicitly add any example sentence involving assistance. However, even if it works well this is not the result of human level intelligence with a reliable, real world concept of meaning but merely the result of clever machine learning algorithms. This score is not particularly high, we should add this input as a new example sentence!
After every test iteration of your Flow, go to the Intent Trainer and make sure to review all sentences. Confirm understood sentences to make them additional training fodder for your intents. Correct any misunderstood sentences and reject inputs that are out of scope.
Note for input sentences that should be out of scope of your Intents add them to the Reject Intent.
As you test and develop your flow, you accumulate training data. It is realistic to expect virtually perfect accuracy in normal, expected conversations the AI is designed for.
Here is a checklist to tell you when you are ready to move on to production:
- Review in the Intent Trainer has been completed
- Your intents consistently deliver close to perfect accuracy
- Outside user testers use your bot with high satisfaction
Thanks to Cognigy's ease of use we hope you're ready to move to production rapidly! It is reassuring to know that Cognigy never stops learning. Thanks to Cognigy's unsupervised learning capability with reconfirmation and learned sentences your intents will be extended automatically.
To monitor the performance of your Conversation you can use Cognigy Analytics. In particular, you want to keep track of Misunderstood messages. Note that input sentences that are mapped to the wrong intent, false positives, would not show up in this KPI. This is why it is important to also regularly review the Intent Trainer to identify any issues that may arise.
If you encounter blockers or issues at any time during this process do not hesitate to contact Cognigy support. If you have any feedback to this guide do leave a suggestion, thank you!
Updated about 2 years ago