public class AnnotationPipeline extends Object implements Annotator
Annotator.Requirement
Modifier and Type | Field and Description |
---|---|
protected static boolean |
TIME |
BINARIZED_TREES_REQUIREMENT, CLEAN_XML_REQUIREMENT, COLUMN_DATA_CLASSIFIER, DETERMINISTIC_COREF_REQUIREMENT, GENDER_REQUIREMENT, GUTIME_REQUIREMENT, HEIDELTIME_REQUIREMENT, LEMMA_REQUIREMENT, NER_REQUIREMENT, NUMBER_REQUIREMENT, PARSE_AND_TAG, PARSE_REQUIREMENT, PARSE_TAG_BINARIZED_TREES, POS_REQUIREMENT, QUANTIFIABLE_ENTITY_NORMALIZATION_REQUIREMENT, RELATION_EXTRACTOR_REQUIREMENT, SSPLIT_REQUIREMENT, STANFORD_CLEAN_XML, STANFORD_COLUMN_DATA_CLASSIFIER, STANFORD_DEPENDENCIES, STANFORD_DETERMINISTIC_COREF, STANFORD_GENDER, STANFORD_LEMMA, STANFORD_NER, STANFORD_PARSE, STANFORD_POS, STANFORD_REGEXNER, STANFORD_RELATION, STANFORD_SENTIMENT, STANFORD_SSPLIT, STANFORD_TOKENIZE, STANFORD_TRUECASE, STEM_REQUIREMENT, SUTIME_REQUIREMENT, TIME_WORDS_REQUIREMENT, TOKENIZE_AND_SSPLIT, TOKENIZE_REQUIREMENT, TOKENIZE_SSPLIT_NER, TOKENIZE_SSPLIT_PARSE, TOKENIZE_SSPLIT_PARSE_NER, TOKENIZE_SSPLIT_POS, TOKENIZE_SSPLIT_POS_LEMMA, TRUECASE_REQUIREMENT
Constructor and Description |
---|
AnnotationPipeline() |
AnnotationPipeline(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(Iterable<Annotation> annotations)
Annotate a collection of input annotations IN PARALLEL, making use of
all available cores.
|
void |
annotate(Iterable<Annotation> annotations,
java.util.function.Function<Annotation,Object> callback)
Annotate a collection of input annotations IN PARALLEL, making use of
all available cores.
|
void |
annotate(Iterable<Annotation> annotations,
int numThreads)
Annotate a collection of input annotations IN PARALLEL, making use of
threads given in numThreads.
|
void |
annotate(Iterable<Annotation> annotations,
int numThreads,
java.util.function.Function<Annotation,Object> 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(String[] args) |
Set<Annotator.Requirement> |
requirementsSatisfied()
Returns a set of requirements for which tasks this annotator can
provide.
|
Set<Annotator.Requirement> |
requires()
Returns the set of tasks which this annotator requires in order
to perform.
|
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.
|
protected static final boolean TIME
public void addAnnotator(Annotator annotator)
public void annotate(Annotation annotation)
public void annotate(Iterable<Annotation> annotations)
annotations
- The input annotations to processpublic void annotate(Iterable<Annotation> annotations, java.util.function.Function<Annotation,Object> 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(Iterable<Annotation> annotations, int numThreads)
annotations
- The input annotations to processnumThreads
- The number of threads to run onpublic void annotate(Iterable<Annotation> annotations, int numThreads, java.util.function.Function<Annotation,Object> 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 String timingInformation()
println()
.public Set<Annotator.Requirement> requirementsSatisfied()
Annotator
requirementsSatisfied
in interface Annotator
public Set<Annotator.Requirement> requires()
Annotator
public static void main(String[] args) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException