|
|||||||||
| 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 takes the objects you wish to annotate and pass them in and get in return a fully annotated object. Please see package level javadocs for sample usage and a more complete description.
At the moment this mainly serves as an example of using the system and actually more complex annotation pipelines are in their own classes that don't extend this one.
| 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.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 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 | ||||||||