|
ConceptNetworkModule
Functionalities of the ConceptNetwork module
IntroductionVersion 0.1 of pyECTOR has only one module usable: ConceptNetwork.py. Let's see what it can do. Run itsrc/ConceptNetwork.py is a import module, and is aimed to be used by Ector.py, but it can also be run as a autonomous program. If you are in a shell, in the root directory of the project, you can type: python src/ConceptNetwork.py Use itWhen started, it loads an optional concept network from a file named conceptnetwork.pkl. But the first time you run it, the ConceptNetwork is empty. Add nodeYou can add a basic node using the @addnode command, like that: @addnode from Node "from" added All the text after the command becomes the symbol of the new node. Add linkTo create a link, you need at least two nodes. So, let's create another one: @addnode to Node "to" added Note: you could add a node which symbol contains a space, but you would not be able to link it to another node, as the separator of the @addlink's parameters is space. @addlink from to <__main__.Link instance at 0x01356440> This command creates a link from the "from" node to the "to" node. The command displays the representation of the python object created, so you can know it has succeeded. Display nodesYou can always display all nodes in the ConceptNetwork: @shownodes from (basic): 1 to (basic): 1 The @shownodes command displays one node per line:
Activate a nodeIn order to enable the ActivationPropagation, one needs to activate at least one node (setting its ActivationValue to 100 or less): @activate from In version 0.1, this command does not yield any output. Display the activation values of the nodesTo see the state of the ConceptNetwork, use @showstate: @showstate oldav av age Node 100 13 1 from(basic) 0 63 0 to(basic) This command displays only the state of the nodes which have been active in less than 50 ActivationPropagations:
Online helpExcept this page, you can use the @help command, which displays a list of the available commands: @help @help give this help @addnode name: add the node given @addlink node1 node2 [label]: add a link from node1 to node2 @activate name [activation value]: activate a node from its name @propagate [nb]: propagate the activation nb times @shownodes: show the nodes in the ConceptNetwork @showlinks: show the links in the ConceptNetwork @showstate: show the state of the nodes @save: save the Concept Network and its state @quit: quit without saving |
Sign in to add a comment