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

Finite state machine options with AIML
 
 

I would like a bot to go through a deliberate sequence of asking questions to collect information from the user. Keeping AIML simple is very important to me (prefer not to have complex and spaghetti conditional statements).

I plan to do this is to use AIML <topic> and would like to have separate AIML files for each of these topics (for readability). Once one topic is complete, I would to move to the next topic.. Eg, collect first name and last name is one topic, and then collect favorite color is the next topic etc.

Can I set topic externally? I plan to use pyAIML and was wondering if I can set this using set predicate.

In order to move to the next topic, I am thinking about a specific response from pyAIML and then manually set a different topic. I will have a wrapper around the pyAIML kernel so I can process the string going in and coming out of the pyAIML engine.

Wanted to get your feedback and if you thought the above approach was reasonable.

 

 
  [ # 1 ]

You can use a “garden path” form of input/response pairs, with the last bot response within the topic setting the new topic for the next section. Setting the topic in AIML is as simple as this:

<set name="topic">{put TOPIC value here}</set

Of course, this will also generate an output to the chatbot, so in order to silence that output, just wrap it with a <think> tag, like so: (this example sets the topic to “GETADDRESS”)

<think><set name="topic">GETADDRESS</set></think

 

 

 
  [ # 2 ]

Thank you Dave!

 

 
  [ # 3 ]

Glad to help. smile Best of luck with your project.

 

 
  login or register to react