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

Pattern matching priority
 
 

Hello, and thanks for the help on my last server query, which was very useful.

Today my issue is with pattern matching priority. In our codebase, sometimes a pattern set to trigger a topic will be overridden by ~emohello for example. In a related issue, where more than one concept in the ontology contains the same word, it is hard to predict which of the concepts will trigger first.

Looking through the manuals, my guess is that this has to do with the CS marking process. But I cannot see an explanation of how exactly priority works in CS where there are overlapping patterns among competing concepts and topics.

Similarly I wonder how to manipulate such priority to ensure a topic triggers ahead of an ontology concept or one concept triggers before another. Strategies I have explored include using rejoinders to step out of the flow; flagging prioritize on a topic, and possibly using narrowing techniques like pos and only specifications. But I feel I’m missing the overall logic and all my candidates are hacky.  Thanks in advance.

 

 
  [ # 1 ]

You are mixing apples with oranges.  Words will mark ALL concepts of which they are members (directly or indirectly).

Topics (when you use CS default topic selection mechanisms in keywords) select based on how many keywords and how long the keywords are.  You can alter a topics priority by adding topic flags PRIORITY or DEPRIORITIZE to significantly shift that computation. And you can just write your own ordering of topics by rewriting the control script not to use CS default ^keywordtopics function. For some applications, for example, I have a concept which is the list of topic names to try in order, and the control script walks thru that and calls ^respond or ^gambit on each entry until it gets a response.

 

 
  [ # 2 ]

Thanks a lot. Very helpful. My intuition was indeed I was mixing apples and oranges, but so was my original problem. My intended topic patterns were being redirected to patterns like ~emohello which were system defined and trumped the others in priority - delivering oranges instead of apples. This alerted me to the potential relevance of marking mechanisms . Then I found an example in the manuals that was closest to my problem:

“even after the sentence is transformed, you can use ^mark and ^unmark to mark concepts and words or to turn off marking on them, so you can use context to decide if “lie to me” is a tv show or not, or if you hate ‘good_day’ being considered ~emogoodbye you can do something like this: ` u: (_~emogoodbye) if (^original(_0) == good_day) { ^unmark(~emogoodbye _0)}”

I had a strong suspicion however that the above approach was missing some more straightforward CS logic and I shouldn’t need to dig as deep as marking to solve what is essentially a control issue. Your lead on a CS default ^keywordtopics function and the example concept you created as an alternative makes sense. It will certainly help me gain a better sense of CS as I work my way toward full fluency: which is my determined goal. Thanks for the hint.

 

 
  login or register to react