public class NERCombinerAnnotator extends SentenceAnnotator
CoreAnnotations.SentencesAnnotation.class as
List<? extends CoreLabel>} or a
List<List<? extends CoreLabel>> under Annotation.WORDS_KEY
and adds NER information to each CoreLabel,
in the CoreLabel.NER_KEY field. It uses
the NERClassifierCombiner class in the ie package.| Modifier and Type | Class and Description |
|---|---|
static class |
NERCombinerAnnotator.TokenMergeCountAnnotation
Helper class for aligning merged tokens and original tokens, stores number of merged tokens
this merged token contains (e.g.
|
SentenceAnnotator.AnnotatorProcessor| Modifier and Type | Field and Description |
|---|---|
static java.util.function.Function<CoreLabel,java.lang.Boolean> |
afterIsEmpty
Check that after() is not null and the empty string
|
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 |
|---|
NERCombinerAnnotator() |
NERCombinerAnnotator(boolean verbose) |
NERCombinerAnnotator(boolean verbose,
java.lang.String... classifiers) |
NERCombinerAnnotator(NERClassifierCombiner ner,
boolean verbose) |
NERCombinerAnnotator(NERClassifierCombiner ner,
boolean verbose,
int nThreads,
long maxTime) |
NERCombinerAnnotator(NERClassifierCombiner ner,
boolean verbose,
int nThreads,
long maxTime,
int maxSentenceLength) |
NERCombinerAnnotator(NERClassifierCombiner ner,
boolean verbose,
int nThreads,
long maxTime,
int maxSentenceLength,
boolean fineGrained,
boolean entityMentions) |
NERCombinerAnnotator(java.util.Properties properties) |
| Modifier and Type | Method and Description |
|---|---|
void |
annotate(Annotation annotation)
Given an Annotation, perform a task on this Annotation.
|
void |
doOneFailedSentence(Annotation annotation,
CoreMap sentence)
Fills in empty annotations for trees, tags, etc if the annotator
failed or timed out.
|
void |
doOneSentence(Annotation annotation,
CoreMap sentence)
annotation is included in case there is global information we care about
|
protected long |
maxTime()
The maximum time to run this annotator for, in milliseconds.
|
static void |
mergeTokens(CoreLabel token,
CoreLabel nextToken)
Helper method for creating NER-specific tokenization
|
protected int |
nThreads() |
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.
|
static void |
transferNERAnnotationsToAnnotation(Annotation nerTokenizedAnnotation,
Annotation originalAnnotation)
Copy NER annotations from the NER-tokenized annotation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexactRequirements, unmountpublic static java.util.function.Function<CoreLabel,java.lang.Boolean> afterIsEmpty
public NERCombinerAnnotator(java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionpublic NERCombinerAnnotator()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic NERCombinerAnnotator(boolean verbose)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic NERCombinerAnnotator(boolean verbose,
java.lang.String... classifiers)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic NERCombinerAnnotator(NERClassifierCombiner ner, boolean verbose)
public NERCombinerAnnotator(NERClassifierCombiner ner, boolean verbose, int nThreads, long maxTime)
public NERCombinerAnnotator(NERClassifierCombiner ner, boolean verbose, int nThreads, long maxTime, int maxSentenceLength)
public NERCombinerAnnotator(NERClassifierCombiner ner, boolean verbose, int nThreads, long maxTime, int maxSentenceLength, boolean fineGrained, boolean entityMentions)
protected int nThreads()
nThreads in class SentenceAnnotatorprotected long maxTime()
SentenceAnnotatormaxTime in class SentenceAnnotatorpublic static void mergeTokens(CoreLabel token, CoreLabel nextToken)
public static void transferNERAnnotationsToAnnotation(Annotation nerTokenizedAnnotation, Annotation originalAnnotation)
nerTokenizedAnnotation - originalAnnotation - public void annotate(Annotation annotation)
Annotatorannotate in interface Annotatorannotate in class SentenceAnnotatorpublic void doOneSentence(Annotation annotation, CoreMap sentence)
SentenceAnnotatordoOneSentence in class SentenceAnnotatorpublic void doOneFailedSentence(Annotation annotation, CoreMap sentence)
doOneFailedSentence in class SentenceAnnotatorannotation - The whole Annotation object, in case it is needed for context.sentence - The particular sentence to processpublic java.util.Set<java.lang.Class<? extends CoreAnnotation>> requires()
Annotatorpublic java.util.Set<java.lang.Class<? extends CoreAnnotation>> requirementsSatisfied()
Annotator