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
(Lakers, Kobe Brian, Pau 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