View on GitHub

Graphene

Coreference Resolution, Simplification and Open Relation Extraction Pipeline

Usage of Grapene-Core

The Graphene-Core library offers methods for the complete extraction, as well as for individual and composite steps of the information extraction process.
If you want to use Graphene inside your application, you first have to create a new instance of the Graphene class:

// create new Graphene instance
Graphene graphene = new Graphene();

Resolving Co-references

This will replace mentions of entities in the text that refer to the same entity in the world (e.g. pronouns and abbreviated names) by their full entity names.

Parameters:

CoreferenceContent cc = graphene.doCoreference("The text.");

// get result as a string
String substituted = cc.getSubstitutedText();

Discourse Simplification

This will transform complex input sentences into a simpler representation of semantically annotated and linked sentences.

Parameters:

SimplificationContent sc = graphene.doDiscourseSimplification("The text.", true, false);

// ### OUTPUT #####
// default
String defaultRep = sc.defaultFormat(false); // set **true** for resolved format

// flat 
String flatRep = sc.flatFormat(false); // set **true** for resolved format

// ### SERIALIZE & DESERIALIZE ###
SimplificationContent.serializeToJSON(new File("file.json"));
SimplificationContent loaded = SimplificationContent.deserializeFromJSON(new File("file.json"), SimplificationContent.class);

Open Relation Extraction

This will generate relational tuples (subject-predicate-object extractions) out of the simplified sentences that have been generated by Discourse Simplification.

Parameters: same as for Discourse Simplification

ExContent ec = graphene.doRelationExtraction("The text.", true, false);

// ### OUTPUT AS RDFNL #####
// default
String defaultRep = ec.defaultFormat(false); // set **true** for resolved format

// flat 
String flatRep = ec.flatFormat(false); // set **true** for resolved format

// ### OUTPUT AS PROPER RDF (N-Triples) ###
String rdf = ec.rdfFormat();

// ### SERIALIZE & DESERIALIZE ###
ExContent.serializeToJSON(new File("file.json"));
ExContent loaded = ExContent.deserializeFromJSON(new File("file.json"), ExContent.class);

Back to the home page