public class WikidictAnnotator extends SentenceAnnotator
SentenceAnnotator.AnnotatorProcessor
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 |
---|
WikidictAnnotator(java.util.Properties properties) |
WikidictAnnotator(java.lang.String name,
java.util.Properties properties)
Create a new WikiDict annotator, with the given name and properties.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doOneFailedSentence(Annotation annotation,
CoreMap sentence)
Fills in empty annotations for trees, tags, etc if the annotator
failed or timed out.
|
protected void |
doOneSentence(Annotation annotation,
CoreMap sentence)
annotation is included in case there is global information we care about
|
java.util.Optional<java.lang.String> |
link(CoreMap mention)
Link the given mention, if possible.
|
static void |
main(java.lang.String[] args)
A debugging method to try entity linking sentences from the console.
|
protected long |
maxTime()
The maximum time to run this annotator for, in milliseconds.
|
static java.lang.String |
normalizeTimex(java.lang.String timex)
Try to normalize timex values to the form they would appear in the knowledge base.
|
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.
|
annotate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exactRequirements, unmount
public WikidictAnnotator(java.lang.String name, java.util.Properties properties)
public WikidictAnnotator(java.util.Properties properties)
WikidictAnnotator(String, Properties)
public static java.lang.String normalizeTimex(java.lang.String timex)
timex
- The timex value to normalize.public java.util.Optional<java.lang.String> link(CoreMap mention)
mention
- The mention to link, as given by EntityMentionsAnnotator
protected int nThreads()
nThreads
in class SentenceAnnotator
protected long maxTime()
maxTime
in class SentenceAnnotator
protected void doOneSentence(Annotation annotation, CoreMap sentence)
doOneSentence
in class SentenceAnnotator
protected void doOneFailedSentence(Annotation annotation, CoreMap sentence)
doOneFailedSentence
in class SentenceAnnotator
annotation
- 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>> requirementsSatisfied()
public java.util.Set<java.lang.Class<? extends CoreAnnotation>> requires()
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException