AIML - think Tag وسم يفكر في لغة نمذجة الذكاء الاصطناعي

 AIML - <think> Tag وسم يفكر في لغة نمذجة الذكاء الاصطناعي

AIML - <think> Tag وسم يفكر في لغة نمذجة الذكاء الاصطناعي

تستخدم العلامة <think> في AIML لتخزين متغير بدون إخطار المستخدم.

بناء الجملة

قم بتخزين قيمة باستخدام علامة <think>

<think> 
   <set name = "variable-name"> variable-value </set>
</think>

على سبيل المثال ، ضع في اعتبارك المحادثة التالية.

Human: My name is Mahesh
Robot: Hello!
Human: Byeee
Robot: Hi Mahesh Thanks for the conversation!

مثال

قم بإنشاء think.aiml داخل C> ab> bots> test> aiml and think.aiml.csv داخل C> ab> bots> test> أدلة aimlif .

اعتقد

<?xml version = "1.0" encoding = "UTF-8"?>
<aiml version = "1.0.1" encoding = "UTF-8"?>
   <category>
      <pattern>My name is *</pattern>
      <template>
         Hello!<think><set name = "username"> <star/></set></think>
      </template>  
   </category>  
   
   <category>
      <pattern>Byeee</pattern>
      <template>
         Hi <get name = "username"/> Thanks for the conversation!
      </template>  
   </category>  
   
</aiml>

think.aiml.csv

0,My name is *,*,*, Hello! <think><set name = "username"> <star/></set></think>,think.aiml
0,Byeee,*,*, Hi <get name = "username"/> Thanks for the conversation!,think.aiml

تنفيذ البرنامج

افتح موجه الأوامر. انتقل إلى C> ab> واكتب الأمر التالي -

java -cp lib/Ab.jar Main bot = test action = chat trace = false

تحقق من النتيجة

سترى الناتج التالي -

Human: My name is Mahesh
Robot: Hello!
Human: Byeee
Robot: Hi Mahesh Thanks for the conversation!