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

Simple pattern matching fails
 
 

I am not getting the pattern matching concept of chat script properly . I was moving my project form AIML to chatscript. A small example i tried and dint worked .

topic: ~introductions keep []

t: Hi, I am bot
u: (~emohello) [Hello][Hi][Hey]
u: (a) ^respond(~a)
u: (b) ^respond(~b)
u: (c) ^respond(~c)
u: (when will you go home) ^respond(~d)

topic: ~a nostay []
t: a
topic: ~b nostay []
t: b
topic: ~c nostay []
t: c
topic: ~d nostay []
t: d

when I type hi/hello/hey, every time it will hit u: (~emohello) [Hello][Hi][Hey]
But when i type “a” , it is randomly hiting any of responders, then erase , then next one.
When i type “a” , it is supposed to take u: (a) ^respond(~a) only rt ? But taking randomly one after other.
For “when will you go home” ; that is also taking randomly not hiting the last one exactly.

Whether my concept on pattern matching is wrong ? Even if i elaborate this pattern in each responders I am not getting expected result.

Can I get some good sample project that covers all chatscript features so that i can study and develop my bot?

 

 
  [ # 1 ]

You have a topic: ~a which has a gambit.  YOU call that topic with ^respond which tries to match responders, so it will do nothing. You should probably say ^gambit(~a).

What is happening for you is that when you match (a) and call respond, nothing happens. So then the system is free to find a topic that it can gambit from, and it picks one.

 

 
  [ # 2 ]

Thanks Bruce.

topic: ~a keep nostay []
u: (a) a
topic: ~b keep nostay []
u: (b) b
topic: ~c keep nostay []
u: (c) c
topic: ~d keep nostay []
u: (when will you go home) d

This got worked.
I still have one doubt that it is hitting at topic ~introduction first. rt ?? wether the responders in ~introduction do matching ?
Or topic selection is random based on gambit,responders,keywords and hitting at other topics ?

 

 
  login or register to react