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

Rule Matching
 
 

concept: ~subscription_type (yearly weekly daily)
topic: ~test (~subscription_type)


# yearly subscription cost for books
u: ( _{[~subscription_type]} [subscription ] [for] _*1 > ) ^keep() ^repeat()  $$type = ^original(_0) $product = ^original(_1)
  if ( $$type == yearly ) {
Yearly subscription cost for $product is call_service
}

  else if ( $$type == weekly ) {
weekly subscription cost for $product is call_service
}

  else if ( $$type == daily ) {
daily subscription cost for $product is call_service
}


# subscription
u: ( _{[monday tuesday ]} [subscription]) ^keep() ^repeat() $$type = ^original(_0)

  $$type subscription cost is call_service

In both cases it executes the second rule and gives output as Yearly subscription cost is 2500, how can I make the rules more efficient to identify the patterns

 

 
  [ # 1 ]

I copied your script into my test bot and gave it these two inputs successfully:

yearly subscription for elephant

weekly subscription for lion

So I dont know what input you gave, but neither of mine had any problem, and you stated that the output of your test was “yearly subscription cost is 2500”  which is NOT what can come out of the second rule, so I dont know what really is happening for you

 

 
  login or register to react