entity-graph – Entity Graph#

Description#

The entity-graph is the command line utility provided by the eot-wowool-sdk Python package allowing you to easily use the functionality of the Entity Graph application.

The Entity Graph application produces a list of links between entities. These links represent relations between the entities that have been found in the document. For instance, between a Person and their Position or Pathology and symptoms.

Example#

Create a test.lnk file that will generate a relation between a Person and a Company.

test.lnk#
{
    "links":[
        {
            "from":{"uri":"Person","attributes":["gender"]},
            "to":{"uri":"Company"},
            "relation":{"label":"works_for"}
        }
    ]
}
entity_graph -p 'english,entity' \
              -i "John Smith works for EyeOnText. He works also for IBM." \
              -x test.lnk

yielding:

[
    {
        "from": {"label": "Person", "name": "John Smith", "attributes" : { "gender":"male" }},
        "relation": {"label": "works_for", "name": "works_for"},
        "to": {"label": "Company", "name": "EyeOnText"}
    },
    {
        "from": {"label": "Person", "name": "John Smith"},
        "relation": {"label": "works_for", "name": "works_for"},
        "to": {"label": "Company", "name": "IBM"}
    }
]

For more information, refer to the JSON schema.

Usage#

usage: entity-graph [-h] [-f FILE] [-i TEXT] [--lxware LXWARE] [-x LINKS]
                    [-p PIPELINE] [-o OUTPUT_FILE] [--server SERVER]
                    [--namespace NAMESPACE] [-u USER] [--password PASSWORD]
                    [-s]

Named Arguments#

-f, --file

folder or file

-i, --text

The input text to process

--lxware

location of the language files

-x, --links

A json config file with the different arguments, Entity Graph Configuration

-p, --pipeline

pipeline to use.

-o, --output_file

save to cvs format

--server

neo4j server use example: ‘bolt://localhost:7687’

--namespace

namespace in the dataset, default empty

Default: “”

-u, --user

user name

Default: “test”

--password

password for the given connection

Default: “test”

-s, --silent

Do not print individual rows.

Default: False