-
Notifications
You must be signed in to change notification settings - Fork 135
Tutorial Topic
Keith Sterling edited this page Dec 20, 2017
·
4 revisions
The topic tag is used as a way to group categories into related 'topics' typically to allow conversations to maintain a context of the topic being discussed and therefore to allow duplicates patterns with different responses depending upon the topic under discussions.
You set the topic
that using a set
tag as follows
<category>
<pattern>HELLO</pattern>
<template>
<think>
<set name="topic">GREETINGS</set>
</think>
Hello there!
</template>
<category>
And you can retrieve the current topic using get
<category>
<pattern>SHOW TOPIC</pattern>
<template>
The current topic is <get name="topic" />
</template>
<category>
However, the primary use of topic
is as a tag to group cateegories together.
<category>
<pattern>I AM BORED</pattern>
<template>
OK, do you want to talk about sport?
<think><set name="topic">SPORT</set></think>
</template>
</category>
<topic name="SPORT">
<pattern>YES</pattern>
<template>
What kind of sports do you like to play?
</template>
<pattern>NO</pattern>
<template>
OK, how about you choose a topic to talk about
</template>
<pattern>*</pattern>
<template>
Is there something else you'd like to talk about?
</template>
</topic>
Email: keiffster@gmail.com | Twitter: @keiffster | Facebook: keith.sterling | LinkedIn: keithsterling | My Blog
- Home
- Background
- Guiding Principles
- Reporting an Issue
- Installation
- You And Your Bot
- Bots
- Clients
- Configuration
- AIML
- Sentence Splitting
- Natural Langauge Processing
- Normalization
- Spelling
- Sentiment Analysis
- Translation
- Security
- Hot Reload
- Logging
- Out of Band
- Multi Language
- RDF Support
- Rich Media
- Asynchronous Events
- Triggers
- External Services
- Dynamic Sets, Maps & Vars
- Extensions
- Pre & Post Processors
- Custom Nodes
- The Brain Tree
- Utilities
- Building It Yourself
- Creating Your Own Bot
- Contributing
- Performance Testing
- FAQ
- History
- Website