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:

DiscourseSimplificationContent dsc = graphene.doDiscourseSimplification("The text.", true, false);

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

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

// ### SERIALIZE & DESERIALIZE ###
DiscourseSimplificationContent.serializeToJSON(new File("file.json"));
DiscourseSimplificationContent loaded = DiscourseSimplificationContent.deserializeFromJSON(new File("file.json"), DiscourseSimplificationContent.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

RelationExtractionContent rec = graphene.doRelationExtraction("The text.", true, false);

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

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

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

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

Back to the home page