StanfordNLP Relation Extractor

Extracts relations triplets contained in sentences of a document by investigating relations of tagged named-entities.

The node can be used in two different ways by either checking the Apply preprocessing option or not. If the option is selected, the node takes care of part-of-speech (POS) and named-entity (NE) tagging as well as lemmatizing. Stanford CoreNLP standard settings are used in this case. However, tags are not applied to the documents, since the preprocessing is only applied internally. If the option is unchecked, it is necessary to provide a column with tagged documents (POS and NE) as well as a column containing lemmatized documents. Lemmatized documents consist of terms that were converted to their canonical, dictionary or citation form.
Note: Creating the same pipeline by using KNIME's Stanford nodes with default settings will not necessarily lead to the same results as using the Apply preprocessing option, since KNIME is using the Penn-Treebank (PTB) tag set. This tag set uses the SYM tag for any kind of punctuation and quotation marks. However, Stanford CoreNLP uses a modified version of the PTB tag set to distinguish these symbols, since they are important for dependency parsing and natural logic annotation.

The node creates four new columns: two object columns containing named-entities, one column containing the type of relation with the highest confidence and a column containing the confidence for this relation. The node handles classic named-entities like PERSON, LOCATION and ORGANIZATION.
Relation types that can be extracted are Live_In, OrgBased_In, Located_In, Work_For and _NR.
_NR specifies no relation between two entities. A detailed explanation of StanfordNLP's approach for relation extraction can be found in this article.

Note: Relation Extraction is a computationally expensive operation. For the usage of this node it is recommended to run KNIME with at least 4GB of heap space. To increase the heap space, change the -Xmx setting in the knime.ini file.

This node is based on Stanford CoreNLP 3.9.1.
For more information about StanfordNLP and Relation Extraction, click here.

Options

Document column
The document column to use.
Note: If the Apply preprocessing option is unchecked, the documents have to be tagged by a part-of-speech tagger and a named-entity tagger (optionally).
Lemmatized document column
The document column containing the lemmatized documents.
Note: If the Apply preprocessing option is checked, this option is not necessary.
Apply preprocessing
If checked, part-of-speech tagging, named-entity tagging and lemmatizing will be done by this node.
Number of threads
The number of threads to use.

Input Ports

Icon
The input table which contains the documents and lemmatized documents (if needed).

Output Ports

Icon
The output table which contains data from the input table, extracted relations and a relation confidence.

Views

This node has no views

Workflows

  • No workflows found

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.