public class AnnotationPipeline extends java.lang.Object implements Annotator
Modifier and Type | Field and Description |
---|---|
protected static boolean |
TIME |
DEFAULT_REQUIREMENTS, STANFORD_CDC_TOKENIZE, STANFORD_CLEAN_XML, STANFORD_COLUMN_DATA_CLASSIFIER, STANFORD_COREF, STANFORD_COREF_MENTION, STANFORD_DEPENDENCIES, STANFORD_DETERMINISTIC_COREF, STANFORD_DOCDATE, STANFORD_ENTITY_MENTIONS, STANFORD_GENDER, STANFORD_KBP, STANFORD_LEMMA, STANFORD_LINK, STANFORD_MWT, STANFORD_NATLOG, STANFORD_NER, STANFORD_OPENIE, STANFORD_PARSE, STANFORD_POS, STANFORD_QUOTE, STANFORD_QUOTE_ATTRIBUTION, STANFORD_REGEXNER, STANFORD_RELATION, STANFORD_SENTIMENT, STANFORD_SSPLIT, STANFORD_TOKENIZE, STANFORD_TOKENSREGEX, STANFORD_TRUECASE, STANFORD_UD_FEATURES
Constructor and Description |
---|
AnnotationPipeline() |
AnnotationPipeline(java.util.List<Annotator> annotators) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotator(Annotator annotator) |
void |
annotate(Annotation annotation)
Run the pipeline on an input annotation.
|
void |
annotate(java.lang.Iterable<Annotation> annotations)
Annotate a collection of input annotations IN PARALLEL, making use of
all available cores.
|
void |
annotate(java.lang.Iterable<Annotation> annotations,
java.util.function.Consumer<Annotation> callback)
Annotate a collection of input annotations IN PARALLEL, making use of
all available cores.
|
void |
annotate(java.lang.Iterable<Annotation> annotations,
int numThreads)
Annotate a collection of input annotations IN PARALLEL, making use of
threads given in numThreads.
|
void |
annotate(java.lang.Iterable<Annotation> annotations,
int numThreads,
java.util.function.Consumer<Annotation> callback)
Annotate a collection of input annotations IN PARALLEL, making use of
threads given in numThreads
|
protected long |
getTotalTime()
Return the total pipeline annotation time in milliseconds.
|
static void |
main(java.lang.String[] args) |
java.util.Set<java.lang.Class<? extends CoreAnnotation>> |
requirementsSatisfied()
Returns a set of requirements for which tasks this annotator can
provide.
|
java.util.Set<java.lang.Class<? extends CoreAnnotation>> |
requires()
Returns the set of tasks which this annotator requires in order
to perform.
|
java.lang.String |
timingInformation()
Return a String that gives detailed human-readable information about
how much time was spent by each annotator and by the entire annotation
pipeline.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exactRequirements, unmount
protected static final boolean TIME
public AnnotationPipeline(java.util.List<Annotator> annotators)
public AnnotationPipeline()
public void addAnnotator(Annotator annotator)
public void annotate(Annotation annotation)
public void annotate(java.lang.Iterable<Annotation> annotations)
annotations
- The input annotations to processpublic void annotate(java.lang.Iterable<Annotation> annotations, java.util.function.Consumer<Annotation> callback)
annotations
- The input annotations to processcallback
- A function to be called when an annotation finishes.
The return value of the callback is ignored.public void annotate(java.lang.Iterable<Annotation> annotations, int numThreads)
annotations
- The input annotations to processnumThreads
- The number of threads to run onpublic void annotate(java.lang.Iterable<Annotation> annotations, int numThreads, java.util.function.Consumer<Annotation> callback)
annotations
- The input annotations to processnumThreads
- The number of threads to run oncallback
- A function to be called when an annotation finishes.
The return value of the callback is ignored.protected long getTotalTime()
public java.lang.String timingInformation()
println()
.public java.util.Set<java.lang.Class<? extends CoreAnnotation>> requirementsSatisfied()
Annotator
requirementsSatisfied
in interface Annotator
public java.util.Set<java.lang.Class<? extends CoreAnnotation>> requires()
Annotator
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException