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

think of a parameter for ^respond
 
 

Now, ^respond will pick the topic and try to respond without filtering the topic’s keyword list.

This is useful, but some times I would like to pick the topic and try to respond only when the input satisfy the keyword list.

I understand I can achieve this by using ^keywordtopics(). However, I really would like to control the order of topics when it’s called. It looks like ^keywordtopics() could accommodate three different priorities “normal priority deprioritize”.  What if I need more of priority levels?

Maybe there is already a better way to sort the fact sets. Could you please point out some example? If I can control the order of matched topics, I might not need ^respond with filtering keyword list.

 

 
  [ # 1 ]

if your number of topics is not too large, you can just enumerate them in order and match a keyword list
u: (~topic1) ^respond(~topic1)
u: (~topic2) ^responsd(~topic2)
...

 

 
  [ # 2 ]

This is a good idea.

But I do have a large number of topics which are wikis. These wikis are generated by my script. Maybe what I really need is a way to sort the fact sets.

 

 
  [ # 3 ]

You could probably do something like have a set of facts, one for each of your topics, with a priority. Perhaps built from a table.

Query all those priorities into a fact set and put the ^keywordtopics() into another fact set.

Then use ^intersectfacts() to keep the common topics, use the fact set with the priorities as the from set.

Now you can ^sort() that result set based on the priorities and iterate through them and try ^respond() on each one.

 

 
  [ # 4 ]

Thanks, Andy. That shall solve my problem.

 

 
  login or register to react