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 to make AIML remember the content and continue chatting
 
 

I am writing a chatbot with AIML in JAVA, I google many websites and still don’t know how to make AIML continue chatting.

<category><pattern>* CHANGE APPOINTMENT</pattern>
<
template>SurePlease tell me your name,ID and BOD</template>
</
category

For example, the patient wants to change his appointment, and the robot will ask his name, ID, and BOD. But after the patient type his information, how can the robot understand and memorize this information is to change an appointment and will help the patient change his appointment time?

Many thanks!

 

 
  [ # 1 ]

Hello, Shin-Yu Wu, and welcome to chatbots.org! smile

What it seems that you’re looking for is a pair of tags, called <set> and <get>. you can see how it would work in the following example:

<category>
    <
pattern>* CHANGE APPOINTMENT</pattern>
    <
template>SurePlease tell me your nameso that we can get started.</template>
</
category
<
category>
    <
pattern>MY NAME IS *</pattern>
    <
that>* please tell me your name *</that> <!-- this is an important part of the processto make sure the proper context is used -->
    <
template>
        <
set name="clientname"/> <!-- this stores the information for later -->
        
GreatI got your namenow what is your IDplease?
    </
template>
</
category>

<
category>
    <
pattern>MY ID IS *</pattern>
    <
that>* WHAT IS YOUR ID *</that>used -->
    <
template>
        <
set name="clientid"/> <!-- this stores the information for later -->
        
ThanksNow I just need your BOD.
    </
template>
</
category>

<
category>
    <
pattern>MY BOD IS *</pattern>
    <
that>* NEED YOUR BOD *</that>used -->
    <
template>
        <
set name="clientbod"/> <!-- this stores the information for later -->
        
Thank you for thatNow which appointment did you wish to change?
    </
template>
</
category>

<!-- 
now for a simple category to demonstrate how to obtain the stored data: -->

<
category>
    <
pattern>GETBOD</pattern>
    <
template>Your BOD is <get name="clientbod"/>.</template>
</
category

That’s all I have time for, now. If you have any questions, please feel free to ask. smile

 

 
  [ # 2 ]

Thank you for replying me so promptly! It really helps!!

I have one question about AIML: Is it possible to produce a document that can remember the user input data?
For example, the patient makes an appointment, then it will store the appointment time and patients data into a file in java, next time when the patient wants to search or change his appointment, the chatbot can call the previous data and search for the patient’s information.

 

 
  [ # 3 ]

That sort of functionality isn’t something that AIML was designed for, and the vast majority of AIML interpreters/chatbot engines don’t support anything of that nature at all. Program O does support the creation of such functionality, but that requires knowledge and experience in PHP and database access, and the learning curve is a bit steep, so may not be a viable option. I used to offer paid support for such script creation, but my current health issues make that impossible for the moment. It may change in the future, but not anytime soon.

 

 
  [ # 4 ]

OK! Thank you for your reply!

Hope you get well soon smile

 

 
  login or register to react