Versions Compared

Key

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

...

Code Block
{
    "sources": {
        "salespeople": {
            "dsn": "csv:///salespeople.csv"
			"hierarchy": "manager -> name"
        }
    }
}

What the above code does is create a new source of known entities called "salespeople", and for this source we set the data source name ("dsn") to point to the csv file salespeople.csv which is located in the same folder as the config.json file. The code also indicates that there is a hierarchy within the entities in the csv file, where the value in the 'manager' field of one entity points to the name of a parent entity.

Creating a strategy

Once we have the KEE project pointed to the list of known entities, we want to create our first strategy for recognizing known entities within the texteach document.

We do this by adding an entry to the "sources" section of the config.json file, as shown below:

Code Block
{
    "sources": {
        "salespeople": {
            "dsn": "csv:///salespeople.csv",
			"hierarchy": "manager -> name",
            "strategy": "salesperson_strategy"
        }
    },
    "strategies": {
        "salesperson_strategy": {
            "min_score": "0.8",
            "keywords": [
                "name",
                "position"
                ],
            "parent_keywords": [
                "name -> parentmanager name",
                "position -> parentmanager position",
                ]
        }
    }
}

 

The code added above creates a strategy called 'salesperson_strategy' for identifying entities and applies it to the source 'salespeople'. 

We also set a few basic parameters for this new strategy, such as the minimum score required to produce a match, which we set to 0.8. 

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

Deploying a KEE project