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..

Auto Topics
 
 

One of the defects in the AIML language is that the trigger of the topic is outside the topic of the code itself. Let us call this “manual activation of the topic”.

A strategy to pursue by the AIML developer would be to have certain categories activating and before any sensitive input select a topic to do one of these things:
[ul]
[li] - Have all the categories previously charged and activate the name=“topic”> <Set topic by topic name </ set>[/li]
[li] - Load the AIML file that contains the categories of that topic by <learn> and activate it.[/li][/ul]

The answer might be:
[ul]
[li] - A generic response in that category activator[/li]
[li] - A specific response contained in that topic, for this it would be logical to perform a recursive query of the user by <srai> <star> </ srai> or a slight variation of this method.[/li][/ul]

One problem is that you can only have activated a topic, and general topic. To avoid this you can perform a little trick.
One way to classify the subjects may be by categories or themes. On the one hand we have the general theme or *, which is a container of entries when no active topic or being an active container there will be no agreement on the topic active.

If we classify the subjects as follows:

* - General
 Topic_1 
*
 
Topic_2 *
 
Topic_1 SubTopic_1 *
 
Topic_1 SubTopic_2 

For example:

*
Entertainment *
Culture *
Entertainment Sports *
Entertainment Shows *
Entertainment Sports Basketball *
Entertainment Sports Soccer 

Thus if for example we talk about basketball and have turned the topic: “Sports Entertainment Basketball *” will seek a match to a category of this topic and if found not to be sought on a topic that covers this topic in this case “Sports Entertainment *“and so on until the general topic.

This is not quite correct because we have to assume a number of assumptions, that no topic that is not the general have a category with the pattern “* ” and that would match any entry. And that would be refined question would be that there would not have to refine the wildcard *. Because what I would assume that * accepts inputs from 0 to n elements.

So here is above the standard options on the topics.

If the AIML program has the capacity for self activation of these topics could be activated without the user having to manually manage this.

The implementation would be something like this:
[ol][li] 1) Process input and identify possible words that trigger a topic.[/li]
[li] 2) Turn on the topics and not be charged for classes, load the AIML files.[/li]
[li] 3) Process the input normally.[/li][/ol]

Would have to manage the priority of topics (perhaps the most active words a topic) and when disable or remove priority (maybe when some time passes since the last activation).

Using the not standard technique (discussed in another thread, library AIMLMultibot) could handle this by set of categories.
In the previous example could do the following: (in XML format in the example above)

#Entertainment -> AIML file Entretenimiento.aiml
      #Sports: Deportes.aiml
            #soccer: Futbot.aiml
            #basketball
                   #Boston Celtics
                   #Los Angeles Lakers
                                 
(LakersKobe BrianPau Gasol)
       
#Show
              #Movies
                      #comedy
                      #drama
              #Theatre
#culture
       #books
       #comics 

So before a user asks: “Do you know Pau Gasol?”

Recursively activated (highest priority to lowest) the following topics:

# Los Angeles Lakers
# Basketball
# Sports
# Entertainment 
 

 
  [ # 1 ]

Topics in AIML are used to group certain phrases together. You would not want to set them outside of the topic.

For example: “DO YOU LIKE IT” would provide a different answer if the topic was “TV” than if the topic was “PIZZA”.

If a user asked, “Do you know Pau Gasol?” you would set the topic at that point to something like “Basketball” or “Sport” and then group any further AIML categories under those topics.

 

 
  [ # 2 ]
Steve Worswick - Apr 16, 2011:

If a user asked, “Do you know Pau Gasol?” you would set the topic at that point to something like “Basketball” or “Sport” and then group any further AIML categories under those topics.

This post is precisely this issue.
The activation of a topic is a category related to the topic.
This post talks about incorporating the active category in the topic as it pertains to the topic really.

<topic name="basketball">
   <
category> <pattern> Do you know Pau Gasol </patern>....
</
topic

1) Program analyzes the input and recognizes the name “Pau Gasol” and automatically activates the topic “basketball. ” If the file was not loaded into memory AIML set him and would add new categories.
2) The program processes the input and find the category you have mentioned.


- The activation of the topic is automatic.
- All categories are related within the same file.

 

 
  [ # 3 ]

“Do you know Pau Gasol” Would not need to be in a topic as it isn’t ambiguous.

The only time you need topics is when the question isn’t clear like “Do you go there a lot?” or “Where is your nearest one?” This would give a different answer if the topic was CINEMA or if the topic was BOWLING ALLEY.

DO YOU KNOW PAU GASOL will only have one answer depending on whether the bot knows him. It doesn’t matter what the current topic is. You could set the topic to BASKETBALL after the bot had replied but the question itself should not be in a <topic>

 

 
  [ # 4 ]

Thanks for the clarification, sometimes one is shown as a novice in this field.
I wonder then why the topics only serve to distinguish this type of ambiguous phrases?
Should be used for something else, because if they do not, we would not need more than one category for this pattern because a variable might view the topic is being discussed and therefore respond differently.

<category>
   <
pattern>Do you like doing in your free time</pattern>
   <
template
          <
random>
              <
li>I like cinema  <set name="like">cimema</set></li>
              <
li>I like Bowling Alley  <set name="like">bowling</set></li>
   </
template>
</
category>

<
category>
   <
pattern>Do you go there a lot</pattern>
   <
template>
       <
condition name="like">
            <
li value="cinema">.....</li>
            <
li value="bowling">.....</li>
            <
li>...</li>
        </
condition>
   </
template>
</
category
 

 
  [ # 5 ]

I agree with your viewpoint regarding topics here, Leo. It’s far less coding to have one category with a condition tag that includes a dozen or so condition tests than to have a dozen or so identical categories within different topics. However, rather than use the variable “like”, you can still use “topic” for your condition tag in the example you cited above.

 

 
  [ # 6 ]
Dave Morton - Apr 16, 2011:

However, rather than use the variable “like”, you can still use “topic” for your condition tag in the example you cited above.

Not if you are using Pandorabots. You can’t check a topic as you would any other variable.
Something like:

<category>
   <
pattern>DO YOU GO THERE</pattern>
   <
template>
       <
condition name="topic">
            <
li value="cinema">YesI like movies.</li>
            <
li value="bowling">Yes but I never get a strike.</li>
        </
condition>
   </
template>
</
category

will not work.

 

 
  [ # 7 ]

Really? My bad. well, I tried. smile Can you at least access the current topic through <get name=“topic” >?

 

 
  [ # 8 ]

Ah yes, now that you can do.

 

 
  [ # 9 ]

Then it’s still possible to use the topic in the way that I described, with a minor alteration:

<category>
   <
pattern>DO YOU GO THERE</pattern>
   <
template>
     <
think><set name="this_condition"><get name="topic" /></set></think>
       <
condition name="this_condition">
            <
li value="cinema">YesI like movies.</li>
            <
li value="bowling">Yes but I never get a strike.</li>
        </
condition>
   </
template>
</
category

Granted, it’s an extra line of code, but that’s better than a lot of categories for the same question. smile

 

 
  [ # 10 ]

True. And this functionality already exists in standard AIML.

 

 
  login or register to react