public class SentencePipeline extends BasicAnnotatorService
Annotator
members over one sentence at a time and splice their
outputs together. Ignore failure of Annotators on individual sentences. Current implementation
repeats the split/join process for each layer of annotation; a more efficient route would process
each sentence with all annotations, but requires some care as not all annotators will support
this mode (e.g. co-reference; and Wikification and NER benefit from more context. For components
like NER, expect a performance drop if you use this mode due to the reduced context for
decisions.annotationCache, disableCache, forceUpdate, textAnnotationBuilder, throwExceptionIfNotCached, viewProviders
Constructor and Description |
---|
SentencePipeline(TextAnnotationBuilder textAnnotationBuilder,
Map<String,Annotator> viewProviders,
ResourceManager rm)
constructor with ResourceManager properties for caching behavior
|
Modifier and Type | Method and Description |
---|---|
boolean |
addView(TextAnnotation textAnnotation,
String viewName)
DOES NOT CACHE THE ADDED VIEW!!!
|
void |
processBySentence(Annotator annotator,
TextAnnotation textAnnotation)
Process each sentence individually.
|
addAnnotator, addViewsAndCache, annotateTextAnnotation, createAnnotatedTextAnnotation, createAnnotatedTextAnnotation, createAnnotatedTextAnnotation, createAnnotatedTextAnnotation, createBasicTextAnnotation, createBasicTextAnnotation, getAvailableViews, throwNotCachedException
public SentencePipeline(TextAnnotationBuilder textAnnotationBuilder, Map<String,Annotator> viewProviders, ResourceManager rm) throws AnnotatorException
textAnnotationBuilder
- tokenizes and sentence splits input text.viewProviders
- Annotators that populate a View with the same name as the corresponding
Annotator key.rm
- A ResourceManager
containing cache configuration options.AnnotatorException
public boolean addView(TextAnnotation textAnnotation, String viewName) throws AnnotatorException
addView
in interface AnnotatorService
addView
in class BasicAnnotatorService
textAnnotation
- textAnnotation to be modifiedviewName
- name of view to be addedAnnotatorException
public void processBySentence(Annotator annotator, TextAnnotation textAnnotation)
annotator
- Annotator to applytextAnnotation
- TextAnnotation to augmentCopyright © 2017. All rights reserved.