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

Bad build or misunderstanding?
 
 

In my build, if I [ul]
[li]:testpattern (~noun) car (I match)[/li]
[li]:testpattern (~noun_singular) car (I match)[/li][/ul]
but, if I test for a match using[ul]
[li]car ? ~noun (I match)[/li]
[li]car ? ~noun_singular (I DO NOT match)[/li][/ul]

Note also a ^query(direct_svo car member ‘~noun_singular) misses too.  Any ideas why I can’t match to ~noun_singular in code but can in :testpattern?  Note that in code I’m:

@= ^burst( $$inputsentence)
$
$wordCount = ^length(@1)
Loop ($$wordCount{
 
$$word = ^first(@1)
 if ( $
$word ? ~noun_singular { MATCHED } 

 

 

 
  [ # 1 ]

Probably because ~noun_singular is a dynamic concept set based on parsing the input—- there are no permanent members and since your attempt to match was not coming from input per se, the system cannot tell.
Why are you doing matches for words in the sentence against this concept as you do, instead of using normal patterns on input.  :testpattern worked becase it takes your data as an input and properly analyzes it.

 

 
  [ # 2 ]

Welcome back Bruce! Just getting back to this question, and I wanted to ask a follow-up. Is there anyway to burst and query each word in an input to determine if a say a noun was singular or plural since we can’t match against a dynamic concept? Obviously checking for an “s” at the end will not work (geese, mice, children, people, etc.).  I suppose I could ^pos(noun word plural) the word and check to see if the plural form matches the original form and if so call it Plural and if not call it singular, but is there a more direct way? Ideally, I would love to access the dynamic concepts and get access to the same data that :prepare generates.

 

 
  [ # 3 ]

Yes, you can use ^pos as you described. But really the question is, why do you want to burst and access words when ORIGINALLY they were there in the input and all ready for you to access their characteristics.

How is it that you LOST the data from the input in the first place?  You could reacquire it using ^analyze, but your use case escapes me.

 

 
  [ # 4 ]

The basic issue is that with ^pos, you are declaring the type and having the system generate a conjugation.
But nothing says your word is the pos you claim, since that is a property of input words which have been analyzed.
“swim” may or may not be a noun or a verb (of various flavors) depending on the sentence it is found in. That is why the various parse concepts are dynamically run from the input preparation.

 

 
  login or register to react