Instructions for Creating a Runnable Demo using The Verb or Noun Algorithm

Modified: 05/22/02

;;; Reset the network
(resetnet t)

;;; Don't trace infer
^(setq snip:*infertrace* nil)

;;; Load all valid relations
(intext "/projects/rapaport/CVA/mkb3.CVA/rels/rels")

;;; Compose necessary paths, so that the Noun/Verb Algorithm
;;; functions correctly
(intext "/projects/rapaport/CVA/mkb3.CVA/paths/paths")

;;; Load Karen Ehrlich's Noun/Verb Algorithm
^(load "/projects/rapaport/CVA/mkb3.CVA/src/fast.code")

;;; Load Knowledge Base
(intext "/projects/rapaport/CVA/mkb3.CVA/kbs/cat.base")

The above is a sample "header block" that must be present at the beginning of a .demo file in order to successfully run a demo using the verb or noun algorithm. Note that the three semicolons (;;;) denote a comment and not a SNePSUL or Lisp command. The header block contains six statements, where some are mandatory and some are optional.

The first thing that the user should do is reset the network, "(resetnet t)." This removes all previously built nodes and clears all previous user-entered relations (defaults back to pre-defined SNePS relations only). This statement is optional, but is highly recommended. This will ensure that the user is starting with a clean slate, and facilitates discovering possible errors more easily. Other nodes that have been previously built during other demos can influence the validity of the dictionary-like definition produced by the verb and noun algorithms.

Next, the SNIP variable *infertrace* is set to nil (thus disabling infertrace). This statement is optional. However, I usually choose to set this variable to nil (it is set to true by default), since it makes a longer demo more easily readable. For a further explanation of this SNIP variable, refer to the SNePS 2.5 User Manual at http://www.cse.buffalo.edu/~jsantore/snepsman.

The next thing that must be done is to load all relations that are specific to the verb or noun algorithm. This is accomplished by using the "intext" command above. The "intext" command simply reads a sequence of SNePSUL commands from a specified file (in our case, the paths file) and executes each of them. As it reads each of the SNePSUL commands, it doesn't echo them. Note that your path to Ehrlich specific relations may differ from above, depending on the location of the rels file. The rels file can be found in my CVA directory at /projects/rapaport/CVA/mkb3.CVA/rels/rels. This statement is mandatory for the verb and noun algorithms to properly function.

In addition to loading the rels, it is also mandatory to load certain paths that will be used for path-based inference within the verb and noun algorithms. Similarly to loading the relations, we use the "intext" command to load the paths. These paths are important since loading them will ensure that the verb and noun algorithms are correctly functioning. Again, note that your path to Ehrlich specific paths may differ from above, depending on the location of the paths file. The paths file can be found in my CVA directory at /projects/rapaport/CVA/mkb3.CVA/paths/paths.

Next, it is absolutely mandatory to load the verb or noun algorithm. This is done with the Lisp "load" function. Since the demo is running inside SNePS, we can initiate a Lisp call by preceding the "load" function with a carat (^). It is also recommended that the new fast KE verb or noun algorithm be used (fast.code), as opposed to the slower, original verb or noun algorithm (code).

Finally, if a knowledge base is needed for the demo, you can use the "intext" command to load it. This is optional and depends on whether you require a knowledge base with your demo. Note that your path to the knowledge base may differ from above, depending on the location of your knowledge-base file. All knowledge-base files are appended with a .base (indicating that it is a knowledge-base file). I suggest that, if your demo is called "cat.demo" and you require a knowledge base, you call it "cat.base". The knowledge-base files for our sample demos can be found in my CVA directory at /projects/rapaport/CVA/mkb3.CVA/kbs/<filename> (where <filename> is the name of the knowledge-base file).
After the "header block," you can begin representing your passage containing some unknown word. As an example, look at the cat.demo in my CVA directory at /projects/rapaport/CVA/mkb3.CVA/demos/cat.demo.

You will find many other demos in here as well.