Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.41 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.41 KB

illinois-curator

The Curator acts as a central server that can annotate text using several annotators. With this package, we can connect to the Curator to get those annotations and build our own NLP-driven application. This package contains code for interacting with Curator, using the data structures from illinois-core-utilities.

To use, first create a CuratorAnnotatorService to use the pipeline:

AnnotatorService annotator = CuratorFactory.buildCuratorClient();
// Or alternatively to use the pipeline:
// AnnotatorService annotator = IllinoisPipelineFactory.buildPipeline();

and then create a TextAnnotation component and add the Views you need:

TextAnnotation ta = annotator.createBasicTextAnnotation(corpusID, taID, "Some text that I want to process.");

Of course the real fun begins now! Using AnnotatorService you can add different annotation Views using their canonical name:

annotator.addView(ta, ViewNames.POS);
annotator.addView(ta, ViewNames.NER_CONLL);

These Views as well as the TextAnnotation object are now locally cached for faster future access.

You can later print the existing views:

System.out.println(ta1.getAvailableViews());

or access the views them directly:

TokenLabelView posView = (TokenLabelView) ta.getView(ViewNames.POS);

for (int i = 0; i < ta.size(); i++) {
    System.out.println(i + ":" + posView.getLabel(i));
}