|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.stanford.nlp.pipeline.AnnotationPipeline
public class AnnotationPipeline
This class is designed to apply multiple Annotators to an Annotation. The idea is that you first build up the pipeline by adding Annotators, and then you take the objects you wish to annotate and pass them in and get back in return a fully annotated object. Please see the package level javadoc for sample usage and a more complete description.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.stanford.nlp.pipeline.Annotator |
|---|
Annotator.Requirement |
| Field Summary | |
|---|---|
protected static boolean |
TIME
|
| Constructor Summary | |
|---|---|
AnnotationPipeline()
|
|
AnnotationPipeline(java.util.List<Annotator> annotators)
|
|
| Method Summary | |
|---|---|
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,
Function<Annotation,java.lang.Object> 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,
Function<Annotation,java.lang.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(java.lang.String[] args)
|
java.util.Set<Annotator.Requirement> |
requirementsSatisfied()
Returns a set of requirements for which tasks this annotator can provide. |
java.util.Set<Annotator.Requirement> |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final boolean TIME
| Constructor Detail |
|---|
public AnnotationPipeline(java.util.List<Annotator> annotators)
public AnnotationPipeline()
| Method Detail |
|---|
public void addAnnotator(Annotator annotator)
public void annotate(Annotation annotation)
annotate in interface Annotatorannotation - The input annotation, usually a raw documentpublic void annotate(java.lang.Iterable<Annotation> annotations)
annotations - The input annotations to process
public void annotate(java.lang.Iterable<Annotation> annotations,
Function<Annotation,java.lang.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(java.lang.Iterable<Annotation> annotations,
int numThreads)
annotations - The input annotations to processnumThreads - The number of threads to run on
public void annotate(java.lang.Iterable<Annotation> annotations,
int numThreads,
Function<Annotation,java.lang.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 java.lang.String timingInformation()
println().
public java.util.Set<Annotator.Requirement> requirementsSatisfied()
Annotator
requirementsSatisfied in interface Annotatorpublic java.util.Set<Annotator.Requirement> requires()
Annotator
requires in interface Annotator
public static void main(java.lang.String[] args)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||