rossanez / KGen

Knowledge graphs generation from unstructured text.
Other
69 stars 27 forks source link

KGen

Knowledge Graphs Generation from unstructured text

Running instructions:

1. Start CoreNLP server:

$ python3 common/stanfordcorenlp/server.py

(syntax: python3 common/stanfordcorenlp/server.py -h)

2. With the server started, run the pipeline in another shell, e.g.:

$ python3 pipeline.py text.txt -p senna -s -k cso -ng

(syntax: python3 pipeline.py -h)

Alternatively, each stage may be executed outside the pipeline, e.g.:

2.1. Preprocessing:

$ cd preprocessor
$ python3 preprocessor.py text.txt

(syntax: python3 preprocessor.py -h)

2.2. Facts extractor:

$ cd facts_extractor
$ python3 extractor.py text_preprocessed.txt -p senna -s

(syntax: python3 extractor.py -h)

2.3. Ontology linker (Optional stage, used to obtain ontology links):

$ cd kb_linker
$ python3 linker.py text_preprocessed.txt -k cso

(syntax: python3 linker.py -h)

2.4. RDF maker:

$ cd rdf_maker
$ python3 maker.py text_preprocessed_triples.txt -l text_preprocessed_links.txt

(syntax: python3 maker.py -h)

2.5. PNG generator (Optional stage, used to obtain a PNG image representing the KG):

$ cd graph_generator
$ python3 generator.py text_preprocessed_kg.ttl

(syntax: python3 generator.py -h)

3. When done, stop the server

$python3 common/stanfordcorenlp/server.py -k

(or simply Ctrl+C in its shell)

Citing KGen