public class GenericWebServiceAnnotator extends WebServiceAnnotator
WebServiceAnnotator.PermanentlyFailedException, WebServiceAnnotator.ShouldRetryException
Modifier and Type | Field and Description |
---|---|
java.lang.String |
annotatorEndpoint |
java.util.Set<java.lang.Class<? extends CoreAnnotation>> |
annotatorProvides |
java.util.Set<java.lang.Class<? extends CoreAnnotation>> |
annotatorRequires |
protected ProtobufAnnotationSerializer |
serializer |
java.util.Optional<java.lang.String[]> |
startCommand |
java.util.Optional<java.lang.String[]> |
stopCommand |
everLive, serverWasActive
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 |
---|
GenericWebServiceAnnotator(java.util.Properties props) |
Modifier and Type | Method and Description |
---|---|
protected void |
annotateImpl(Annotation ann)
Actually annotate a document with the server.
|
protected boolean |
ready(boolean initialTest)
Check if the server is ready to accept annotations.
|
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.
|
protected java.util.Optional<java.lang.String[]> |
startCommand()
The command to run to start the server, if any.
|
protected java.util.Optional<java.lang.String[]> |
stopCommand()
An optional command provided to run to shut down the server.
|
annotate, ensureServer, live, main, ping, unmount
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exactRequirements
@ArgumentParser.Option(name="generic.endpoint") public java.lang.String annotatorEndpoint
@ArgumentParser.Option(name="generic.requires") public java.util.Set<java.lang.Class<? extends CoreAnnotation>> annotatorRequires
@ArgumentParser.Option(name="generic.provides") public java.util.Set<java.lang.Class<? extends CoreAnnotation>> annotatorProvides
@ArgumentParser.Option(name="generic.start") public java.util.Optional<java.lang.String[]> startCommand
@ArgumentParser.Option(name="generic.stop") public java.util.Optional<java.lang.String[]> stopCommand
protected ProtobufAnnotationSerializer serializer
public GenericWebServiceAnnotator(java.util.Properties props)
public java.util.Set<java.lang.Class<? extends CoreAnnotation>> requirementsSatisfied()
Annotator
public java.util.Set<java.lang.Class<? extends CoreAnnotation>> requires()
Annotator
protected java.util.Optional<java.lang.String[]> startCommand()
WebServiceAnnotator
startCommand
in class WebServiceAnnotator
Optional.empty()
if we don't want CoreNLP
to manage the server.protected java.util.Optional<java.lang.String[]> stopCommand()
WebServiceAnnotator
stopCommand
in class WebServiceAnnotator
protected boolean ready(boolean initialTest)
WebServiceAnnotator
ready
in class WebServiceAnnotator
initialTest
- testing a server that has just been started?protected void annotateImpl(Annotation ann) throws WebServiceAnnotator.ShouldRetryException, WebServiceAnnotator.PermanentlyFailedException
WebServiceAnnotator
annotateImpl
in class WebServiceAnnotator
ann
- The document to annotate.WebServiceAnnotator.ShouldRetryException
- Thrown if we could not annotate the document, but we could plausibly retry.WebServiceAnnotator.PermanentlyFailedException
- Thrown if we could not annotate the document and should not retry.