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

Inheriting fact properties - modifying the queries.txt file
 
 

I would like to be able to inherit properties of parent subjects.  So for example, abilities of subjects are defined with the verb “can”.  Given the facts:
CREATURE CAN BREATHE
BIRD IS CREATURE
BIRD CAN FLY
ROBIN IS BIRD
ROBIN CAN SING

I want to ask “Can a robin sing”, “Can a robin fly” and “Does a robin breathe?”

My pattern is:

#! Can a robin fly?
?: ([can do does] {a an the} _*1 _*1 _0?~NOUN _1?~VERB) ^noerase() ^repeat()
    if(query(direct_s<vo _0 can _1)) {Yes} else {No}

My custom search is:

#1: tag member/is as 1. tag all words up from subject with 2. Queue the verb tagged 3. Queue the objects tagged 4.
#2: Use verb and object field facts from queued words.
#3: If the subject field of fact is taged with 2, the verb with a 3 and the object with a 4, we have a winner.

direct_s<vo 1’is.t_1’member.t_2s<1e_3vq_4oq:vo:s2_v3_o4

It seems to work generally but once in a while it seems to not work.  I just wanted confirmation that the query seemed correctly formed and that there was not already a predefined query that might do what I explained above.  It seems to work for the case “ROBIN CAN SING” but i would have expected to have to use ^query(direct_SVO _0 can _1) since the verb and object are not “up from” the subject.  Can someone explain the “2s<1e” in my custom query expression?  It means to queue everything “up from” the subject?  Does the “1” mean everything up from the facts tagged with “1” or only go “up from” the tagged facts by “1 level”? 

Being able to define custom queries is very powerful and sets Chatscript apart from other chatbot scripting platforms.  I appreciate any feedback anyone has on using queries for deductive reasoning or for inferring specific facts from general facts. 

 

 

 
  [ # 1 ]

A couple of questions and observations…

The system has a built-in use of the verb IS and MEMBER to represent WordNet ontology hierarchy and concept membership.
When you say “BIRD IS CREATURE”, are you saying you create your own fact (bird is creature), in which case you are in a sense tampering with the wordnet ontology and would be safer using a custom verb rather than one dedicated for system use in a particular way.

You can also do a :trace all   and then watch the query process and see what it does (once you learn how to interpret the trace).  Which may answer your questions. 

Currently I’m traveling in Europe, due to return to US this weekend, and until then may not have much cycles for analyzing your stuff in more detail.

 

 
  [ # 2 ]

Thanks Bruce.  I modified by creation of facts to use “iz” instead of “is”  and I have less overlap of WordNet hierarchies affecting my results.  In the future if I want to combine my facts and word net facts together in a search I suppose I can just use something like:

direct_s<vo 1’iz.t_1’is.t_1’member.t_2s<1e_3vq_4oq:vo:s2_v3_o4

The :trace command was helpful (once I reviewed the output several times to get used to what I was seeing.)  It was also helpful to output the _0, _1, _2 and ‘_0, ‘_1, ‘_2 forms of the subject verb and object for the facts I was creating because sometimes the word that gets stored in the fact may not be the form I was expecting (I was trying to store singular canonicle forms of facts).

Do you have any recommendations on references to coding facts in triple stores?  I have reviewed the RDF and OWL specifications but I guess I am looking for something more pragmatic and approachable with simple suggestions as to the types of predicates used to store facts possible beyond just a resource hierarchy.

The english word “is” can mean “is a type of”, “is a member of”, “has the property of” etc.  Other useful predicates might be “can”/“is able to”, “is used for”, “is part of”. 

The resources I have found seem to have xml wrappers and some coded functions and seem to gloss over how some of the actual data looks or is represented as a triple store.  In addition to how facts are represented in a triple store I am interested in how facts can be stored for inferencing.  There are reasoners that can be used against huge triple stores but I guess I am more interested in the logic that can be applied to a small set of facts to perform very basic reasoning similiar to the example you supplied in the end of the users guide.

 

 
  [ # 3 ]

I don’t know of any explanations of how to organize triples. Give me an example of what you want to encode, and I’ll tell you how I would do it.  I make no guarantees of my expertise in the matter.

 

 
  login or register to react
‹‹ Python wrapper?      Server keeps saying hi ››