AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

How long topic is active?
 
 

Let’s consider this example:

<category>
    <
pattern>_ MOVIES *</pattern>
    <
template>
        
Coollet us talk about movies. <think><set name="topic">movies</set></think>
    </
template>
</
category>

<
topic name="movies">
    <
pattern>{other pattern}</pattern>
    <
template>...</template>
    <
pattern>*</pattern>
    <
template>
        
{ some text }
    
</template>
</
topic

Wouldn’t this go forever as * is there to match any pattern and topic movies was set? Is there a way to interrupt this, something like return directive in functions? If * isn’t present and there’s no matching pattern in that topic, it will look for categories outside of it, right?

 

 

 

 
  [ # 1 ]

I see now that I forgot to add categories in topics… Nevermind, question is the same.

 

 
  [ # 2 ]

With AIML, it’s important to have a “breakout” category that removes the topic in order to change the topic if the user’s input doesn’t match anything within the topic being discussed. Usually, they look like this:

<topic name="cooking">
  <
category>
    <
pattern>*</pattern>
    <
template>
      <
think><set name="topic"></set></think>
      <!-- 
response content here -->
    </
template>
  </
category>
</
topic

Now bear in mind that this isn’t the only way to get out of a given topic, just the most common way. The use of topics in AIML can be a powerful and useful way to direct the flow of a conversation, but it can be tricky to implement properly. However, I think that it’s worth the effort. smile

 

 
  [ # 3 ]

Did topics behave that way in Alicebot Program D? I seem to remember that they weren’t as “binding” (I was used to the AIML implementation used by RunABot where a user is trapped in a topic unless the topic is explicitly set to something else via a tag in a reply somewhere).

 

 
  [ # 4 ]

I’m not really sure, Noah. I never used Program D, to be honest. I’ve used Program E and O (of course), and both of those were that way from the start.I think that Pandorabots is also like that, if memory serves (though Steve would be the one to ask there).

 

 
  [ # 5 ]

Yes, that is correct. If you want to get out of a topic, you need to set it to something else (or blank it out as in Dave’s example)

 

 
  login or register to react