|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Annotator
This is an interface for adding annotations to a fully annotated
Annotation. In some ways, it is just a glorified Function, except
that it explicitly operates on Annotation objects. Annotators
should be given to an AnnotationPipeline in order to make
annotation pipelines (the whole motivation of this package), and
therefore implementers of this interface should be designed to play
well with other Annotators and in their javadocs they should
explicitly state what annotations they are assuming already exist
in the annotation (like parse, POS tag, etc), what field they are
expecting them under (Annotation.WORDS_KEY, Annotation.PARSE_KEY,
etc) and what annotations they will add (or modify) and the keys
for them as well. If you would like to look at the code for a
relatively simple Annotator, I recommend NERAnnotator. For a lot
of code you could just add the implements directly, but I recommend
wrapping instead because I believe that it will help to keep the
pipeline code more manageable.
An Annotator can also provide a description of what it produces and
a description of what it requires to have been produced by using
the Requirement objects. Predefined Requirement objects are
provided for most of the core annotators, such as tokenize, ssplit,
etc. The StanfordCoreNLP version of the AnnotationPipeline can
enforce requirements, throwing an exception if an annotator does
not have all of its prerequisite met. An Annotator which does not
participate in this system can simply return Collections.emptySet()
for both requires() and requirementsSatisfied().
| Nested Class Summary | |
|---|---|
static class |
Annotator.Requirement
The Requirement is a general way of describing the pre and post conditions of an Annotator running. |
| Method Summary | |
|---|---|
void |
annotate(Annotation annotation)
Given an annotation, perform a task on this annotaiton. |
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. |
| Field Detail |
|---|
static final java.lang.String STANFORD_TOKENIZE
static final java.lang.String STANFORD_CLEAN_XML
static final java.lang.String STANFORD_SSPLIT
static final java.lang.String STANFORD_POS
static final java.lang.String STANFORD_LEMMA
static final java.lang.String STANFORD_NER
static final java.lang.String STANFORD_REGEXNER
static final java.lang.String STANFORD_GENDER
static final java.lang.String STANFORD_NFL_TOKENIZE
static final java.lang.String STANFORD_NFL
static final java.lang.String STANFORD_TRUECASE
static final java.lang.String STANFORD_PARSE
static final java.lang.String STANFORD_DETERMINISTIC_COREF
static final Annotator.Requirement TOKENIZE_REQUIREMENT
static final Annotator.Requirement CLEAN_XML_REQUIREMENT
static final Annotator.Requirement SSPLIT_REQUIREMENT
static final Annotator.Requirement POS_REQUIREMENT
static final Annotator.Requirement LEMMA_REQUIREMENT
static final Annotator.Requirement NER_REQUIREMENT
static final Annotator.Requirement GENDER_REQUIREMENT
static final Annotator.Requirement NFL_TOKENIZE_REQUIREMENT
static final Annotator.Requirement NFL_REQUIREMENT
static final Annotator.Requirement TRUECASE_REQUIREMENT
static final Annotator.Requirement PARSE_REQUIREMENT
static final Annotator.Requirement DETERMINISTIC_COREF_REQUIREMENT
static final Annotator.Requirement GUTIME_REQUIREMENT
static final Annotator.Requirement SUTIME_REQUIREMENT
static final Annotator.Requirement HEIDELTIME_REQUIREMENT
static final Annotator.Requirement STEM_REQUIREMENT
static final Annotator.Requirement NUMBER_REQUIREMENT
static final Annotator.Requirement TIME_WORDS_REQUIREMENT
static final Annotator.Requirement QUANTIFIABLE_ENTITY_NORMALIZATION_REQUIREMENT
static final java.util.Set<Annotator.Requirement> TOKENIZE_AND_SSPLIT
static final java.util.Set<Annotator.Requirement> TOKENIZE_SSPLIT_POS
static final java.util.Set<Annotator.Requirement> TOKENIZE_SSPLIT_NER
static final java.util.Set<Annotator.Requirement> TOKENIZE_SSPLIT_PARSE
static final java.util.Set<Annotator.Requirement> TOKENIZE_SSPLIT_PARSE_NER
static final java.util.Set<Annotator.Requirement> TOKENIZE_SSPLIT_POS_LEMMA
static final java.util.Set<Annotator.Requirement> PARSE_AND_TAG
| Method Detail |
|---|
void annotate(Annotation annotation)
java.util.Set<Annotator.Requirement> requirementsSatisfied()
java.util.Set<Annotator.Requirement> requires()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||