ElliotTheRobot / LILACS-mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform - LILACS Fork
https://mycroft.ai
GNU General Public License v3.0
4 stars 1 forks source link

Connecting Concepts #3

Closed JarbasAI closed 7 years ago

JarbasAI commented 7 years ago

Some structure will be needed to keep track of current concepts and update connections

this structure must:

creating a new concept with childs needs to:

creating a new concept with parents need to:

question: parents of parents could also be updated with new concept as child (if human is a mammal and mammal is an animal, human is also an animal), how far up should this go?

Work started in commit https://github.com/HeinzSchmidt/LILACS-mycroft-core/commit/add04885018546589a200e292360b4840bf117d7

JarbasAI commented 7 years ago

Initial Tests seem to be working:

in case of Joana everything here except human was deduced

output:

joana can be: wife

joana is: human animal mammal

Code


    name = "human"
    child_concepts = ["male", "female", "name"]
    parent_concepts = ["animal", "mammal"]
    knowledge.create_concept(name, parent_concepts=parent_concepts, child_concepts=child_concepts)

    name = "joana"
    child_concepts = ["wife"]
    parent_concepts = ["human"]
    knowledge.create_concept(name, parent_concepts=parent_concepts, child_concepts=child_concepts)

    name = "animal"
    child_concepts = ["dog", "cow", "frog", "cat", "spider", "insect"]
    parent_concepts = ["alive"]
    knowledge.create_concept(name, parent_concepts=parent_concepts, child_concepts=child_concepts)

    # lets see what concept connector can deduce from here
    key = "joana"
    childs = knowledge.concepts[key].child_concepts
    parents = knowledge.concepts[key].parent_concepts