Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Finally, we set the keyword items to tag each match with for both the matching entity (the salesperson) and the matching parent entity (the salesperson's manager). In this case, we tag each document with the name and position of the matching entity in facets called 'name' and 'position' respectively, while we tag each document with the name and position of the matching parent entity in facets called 'manager name' and 'manager position' respectively.

Testing a KEE project

Once we have our list of entities to extract and our initial configuration file, we can begin testing the KEE project and adjusting the settings for our specific use case. 

Compiling the lookup database

The first step in testing our KEE project is to compile our lookup database for the entities using the KEE command line tool. This is accomplished by running the following command (with the present working directory set to the folder for our KEE project):

Code Block
kee compile

After running this command, a db/ folder will be present within our KEE project, which includes the lookup database used to identify known entities. 

It is important to remember that any time we make changes to the config.json file, we have to rerun "kee compile" for those changes to take affect. 

Creating and using fixtures

Once we have our lookup database compiled, we can begin testing the KEE project by running example squirro items, or "fixtures" through it. Generally, we store the fixtures that we use for testing in a folder within the KEE project called fixtures/. Each document within the fixtures folder is a JSON document which includes an example squirro item that we want to use to test the KEE, and a list of all the tags that we expect to be added to that item as a result of the KEE process. 

An example of a fixture is shown below:

Code Block
languagejs
titleExample Fixture
{
    "item": {
        "body": "I spoke with Adrian Fox on the phone earlier this morning..."
    },
    "keywords": {
        "name": ["Adrian Fox"],
        "position": ["District Representative"],
        "manager name": ["Jane Doe"],
        "manager position": ["District Manager"]
    }
}

 

In addition to creating fixtures manually using a tool such as a text editor, fixtures can be created automatically from existing squirro items by running:

Code Block
languagebash
kee get_fixture

 

Deploying a KEE project