Examples
Overview
In this section, we explain the concept of examples and how they are used in BotStudio to enhance chatbot recognition.
What Are Examples?
Examples provide the chatbot with variations of user queries for specific nodes, helping it recognize different expressions of the same intent. For example:
- "I forgot my password"
- "Cannot remember my password"
- "Lost my password"
Using examples allows for quick setup, but they are generally outperformed by classifiers in understanding user intent. If available, classifiers should be the preferred option for matching queries to a node. Read more about classifiers in the relevant section.
However, examples are a simple and effective way to provide basic language understanding for nodes further along in a conversation, where buttons are used to guide user responses.
Adding Examples to a Node
Important: You cannot use both a classifier and examples on the same node. If both are present, the classifier takes precedence, and examples will be ignored.
Steps to Add Examples:
- Navigate to the desired node.
- Go to the Matching section and select the Text Matching tab.
- Ensure Use Examples is selected.
- Enter your example phrases.
Pro Tip: If you have a large number of examples (e.g., in a text file), you can copy-paste them directly into the example input field—each example should be on a separate line.
How Are Examples Used for Matching?
Examples are used to train a lightweight Natural Language Understanding (NLU) model that performs well when only a few keywords indicate the user’s intent. However, unlike full-fledged NLU models, example-based matching does not provide deep semantic understanding.
Key Technical Details:
- Case-Insensitive Matching: "reset" and "Reset" are considered the same.
- Limited Generalization: The chatbot does not apply advanced semantic understanding; users should manually add synonyms, abbreviations, or common variations.
- Sibling Node Distinction: Examples are used to train an NLU model that differentiates between sibling nodes (nodes with the same parent).
Best Practices for Using Examples
Examples work best in scenarios where:
- The node is several steps into a conversation.
- There is limited training data available.
- The parent node uses buttons to guide user input (e.g., in smart nodes).
Tips for Effective Example Creation:
- Use real user input whenever possible.
- If real input is unavailable, create full sentences that mimic what users might say.
- Include variations of nouns, verbs, and adjectives relevant to the flow.
Example variations:
- Nouns: Printer, printers, ink toner
- Verbs & Adjectives: Out of, no more, needs, empty
- Contractions & Negations: Cannot, can’t, won’t let me
Example of list of examples for a node that should match "lack of printer-toner"
- The printer needs toner
- The printer is out of toner
- The printer has no more toner
- The printer needs ink
- The printer is out of ink
- The printer has no more ink
- Where can I find toner for the printer?
- Where can I find toner for our printers?
- Printer toner is empty
- I need toner for the printer
- I need ink for the printer
- Can I replace toner myself?
- The printer won’t let me print, it’s out of ink
- I cannot print, there’s no more ink.
- I can’t print, there’s no more ink.