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

Tagging arbitrary number of concepts in a sentence
 
 

Hi,

How do you spot any number of concepts in a sentence?

Sample input:

“the roses in Willy Wonka’s garden were red, blue, green, yellow and purple.”

Desired output:

A definition of 5 variables (say, color1, color2, ... , color 5) OR 5 facts (color1 value red) and so on.


Current approach:

u: SPOT_COLORS (_~colors * _~colors * _~colors * _~colors * _~colors)
    if(_0) {
^createfact(color1 value _0)
}
      .
      .
      .
    if(_4) {
^createfact(color5 value _4)
}
     

But this hack clearly isn’t scalable to cases where the number of concepts in the sentence is large (say, 100).

Is there a cleaner approach?

Thanks

 

 
  [ # 1 ]

while there is an internal limit to how many instances of the same concept can be represented in a sentence, the classic way you seek is:
u: (_~colors) .... ^retry(RULE) 
When a rule retries, it starts up again trying to match AFTER the word it first found on the last attempt to match

 

 
  [ # 2 ]

Thanks Bruce.

 

 
  login or register to react