/** * Get a {@link ResourceManager} with non-default properties. Overloaded to merge the properties * of {@link AnnotatorServiceConfigurator}. * * @param nonDefaultRm The non-default properties * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getConfig(ResourceManager nonDefaultRm) { ResourceManager pipelineRm = super.getConfig(nonDefaultRm); return new AnnotatorServiceConfigurator().getConfig(pipelineRm); } }
/** * constructor that uses AnnotatorServiceConfigurator default configuration * * @param textAnnotationBuilder object that will build basic TextAnnotation objects * @param viewProviders annotators that will populate views in new TextAnnotation objects * @throws AnnotatorException */ public BasicAnnotatorService(TextAnnotationBuilder textAnnotationBuilder, Map<String, Annotator> viewProviders) throws AnnotatorException { this(textAnnotationBuilder, viewProviders, (new AnnotatorServiceConfigurator()) .getDefaultConfig()); }
/** * get a ResourceManager object with the default key/value pairs for this configurator * * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] props = {CACHE_DIR, THROW_EXCEPTION_IF_NOT_CACHED, CACHE_HEAP_SIZE_MB, CACHE_DISK_SIZE_MB, SET_CACHE_SHUTDOWN_HOOK, DISABLE_CACHE, FORCE_CACHE_UPDATE}; return new ResourceManager(generateProperties(props)); } }
/** * get a ResourceManager object with the default key/value pairs for this configurator * * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] props = {CACHE_DIR, THROW_EXCEPTION_IF_NOT_CACHED, CACHE_HEAP_SIZE_MB, CACHE_DISK_SIZE_MB, SET_CACHE_SHUTDOWN_HOOK, DISABLE_CACHE, FORCE_CACHE_UPDATE}; return new ResourceManager(generateProperties(props)); } }
/** * Get a {@link ResourceManager} with non-default properties. Overloaded to merge the properties * of {@link AnnotatorServiceConfigurator}. * * @param nonDefaultRm The non-default properties * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getConfig(ResourceManager nonDefaultRm) { ResourceManager pipelineRm = super.getConfig(nonDefaultRm); return new AnnotatorServiceConfigurator().getConfig(pipelineRm); } }
/** * constructor that uses AnnotatorServiceConfigurator default configuration * * @param textAnnotationBuilder object that will build basic TextAnnotation objects * @param viewProviders annotators that will populate views in new TextAnnotation objects * @throws AnnotatorException */ public BasicAnnotatorService(TextAnnotationBuilder textAnnotationBuilder, Map<String, Annotator> viewProviders) throws AnnotatorException { this(textAnnotationBuilder, viewProviders, (new AnnotatorServiceConfigurator()) .getDefaultConfig()); }
/** * Get a {@link ResourceManager} with non-default properties. Overloaded to merge the properties * of {@link AnnotatorServiceConfigurator}. * * @param nonDefaultRm The non-default properties * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getConfig(ResourceManager nonDefaultRm) { ResourceManager pipelineRm = super.getConfig(nonDefaultRm); return new AnnotatorServiceConfigurator().getConfig(pipelineRm); } }
public Preprocessor(ResourceManager rm) { ResourceManager fullRm = Configurator.mergeProperties(new AnnotatorServiceConfigurator().getDefaultConfig(), rm); try { TextAnnotationBuilder taBldr = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(true, false)); Map<String, Annotator> annotators = new HashMap<>(); annotators.put(ViewNames.POS, new POSAnnotator()); annotators.put(ViewNames.LEMMA, new IllinoisLemmatizer()); annotators.put(ViewNames.SHALLOW_PARSE, new ChunkerAnnotator()); annotators.put(ViewNames.DEPENDENCY, new DepAnnotator()); annotator = new BasicAnnotatorService(taBldr, annotators, fullRm); } catch (Exception e) { logger.error("Unable to create preprocessor. \n{}", e.getMessage()); } }
/** * Get a {@link ResourceManager} with non-default properties. Overloaded to merge the properties * of {@link AnnotatorServiceConfigurator}. * * @param nonDefaultRm The non-default properties * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getConfig(ResourceManager nonDefaultRm) { ResourceManager pipelineRm = super.getConfig(nonDefaultRm); return new AnnotatorServiceConfigurator().getConfig(pipelineRm); } }
public Preprocessor(ResourceManager rm) { ResourceManager fullRm = Configurator.mergeProperties(new AnnotatorServiceConfigurator().getDefaultConfig(), rm); try { TextAnnotationBuilder taBldr = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(true, false)); Map<String, Annotator> annotators = new HashMap<>(); annotators.put(ViewNames.POS, new POSAnnotator()); annotators.put(ViewNames.LEMMA, new IllinoisLemmatizer()); annotators.put(ViewNames.SHALLOW_PARSE, new ChunkerAnnotator()); annotators.put(ViewNames.DEPENDENCY, new DepAnnotator()); annotator = new BasicAnnotatorService(taBldr, annotators, fullRm); } catch (Exception e) { logger.error("Unable to create preprocessor. \n{}", e.getMessage()); } }
/** * Get a {@link ResourceManager} with non-default properties. Overloaded to merge the properties * of {@link AnnotatorServiceConfigurator}. * * @param nonDefaultRm The non-default properties * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getConfig(ResourceManager nonDefaultRm) { ResourceManager pipelineRm = super.getConfig(nonDefaultRm); return new AnnotatorServiceConfigurator().getConfig(pipelineRm); } }
/** * Get a {@link ResourceManager} with non-default properties. Overloaded to merge the properties * of {@link AnnotatorServiceConfigurator}. * * @param nonDefaultRm The non-default properties * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getConfig(ResourceManager nonDefaultRm) { ResourceManager pipelineRm = super.getConfig(nonDefaultRm); return new AnnotatorServiceConfigurator().getConfig(pipelineRm); } }
/** * Get a {@link ResourceManager} with non-default properties. Overloaded to merge the properties * of {@link AnnotatorServiceConfigurator}. * * @param nonDefaultRm The non-default properties * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getConfig(ResourceManager nonDefaultRm) { ResourceManager pipelineRm = super.getConfig(nonDefaultRm); return new AnnotatorServiceConfigurator().getConfig(pipelineRm); } }
/** * Get a {@link ResourceManager} with non-default properties. Overloaded to merge the properties * of {@link AnnotatorServiceConfigurator}. * * @param nonDefaultRm The non-default properties * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getConfig(ResourceManager nonDefaultRm) { ResourceManager pipelineRm = super.getConfig(nonDefaultRm); return new AnnotatorServiceConfigurator().getConfig(pipelineRm); } }
/** * get a ResourceManager object with the default key/value pairs for this configurator * default SRL_TYPE is Verb. * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] properties = {STFRD_TIME_PER_SENTENCE, STFRD_MAX_SENTENCE_LENGTH, THROW_EXCEPTION_ON_FAILED_LENGTH_CHECK}; return (new AnnotatorServiceConfigurator().getConfig(new ResourceManager( generateProperties(properties)))); }
/** * get a ResourceManager object with the default key/value pairs for this configurator * default SRL_TYPE is Verb. * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] properties = {STFRD_TIME_PER_SENTENCE, STFRD_MAX_SENTENCE_LENGTH, THROW_EXCEPTION_ON_FAILED_LENGTH_CHECK}; return (new AnnotatorServiceConfigurator().getConfig(new ResourceManager( generateProperties(properties)))); }
/** * get a ResourceManager object with the default key/value pairs for this configurator default * SRL_TYPE is Verb. * * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] properties = {USE_JSON, USE_LAZY_INITIALIZATION, USE_SRL_INTERNAL_PREPROCESSOR, SPLIT_ON_DASH, USE_SENTENCE_PIPELINE}; return (new AnnotatorServiceConfigurator().getConfig(new ResourceManager( generateProperties(properties)))); }
/** * get a ResourceManager object with the default key/value pairs for this configurator default * SRL_TYPE is Verb. * * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] properties = {USE_JSON, USE_LAZY_INITIALIZATION, USE_SRL_INTERNAL_PREPROCESSOR, SPLIT_ON_DASH, USE_SENTENCE_PIPELINE}; return (new AnnotatorServiceConfigurator().getConfig(new ResourceManager( generateProperties(properties)))); }
/** * get a ResourceManager object with the default key/value pairs for this configurator default * SRL_TYPE is Verb. * * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] properties = {USE_POS, USE_LEMMA, USE_SHALLOW_PARSE, USE_DEP, USE_NER_CONLL, USE_NER_ONTONOTES, USE_STANFORD_PARSE, USE_STANFORD_DEP, USE_SRL_VERB, USE_SRL_NOM, USE_SRL_PREP, USE_SRL_COMMA, USE_QUANTIFIER, USE_VERB_SENSE, USE_JSON, USE_RELATION, USE_LAZY_INITIALIZATION, USE_SRL_INTERNAL_PREPROCESSOR, SPLIT_ON_DASH, USE_SENTENCE_PIPELINE, USE_TIMEX3, USE_MENTION, USE_TRANSLITERATION, USE_DATALESS_ESA, USE_DATALESS_W2V, USE_QUESTION_TYPER}; return (new AnnotatorServiceConfigurator().getConfig(new ResourceManager( generateProperties(properties)))); }
/** * get a ResourceManager object with the default key/value pairs for this configurator default * SRL_TYPE is Verb. * * @return a non-null ResourceManager with appropriate values set. */ @Override public ResourceManager getDefaultConfig() { Property[] properties = {USE_POS, USE_LEMMA, USE_SHALLOW_PARSE, USE_DEP, USE_NER_CONLL, USE_NER_ONTONOTES, USE_STANFORD_PARSE, USE_STANFORD_DEP, USE_SRL_VERB, USE_SRL_NOM, USE_SRL_PREP, USE_SRL_COMMA, USE_QUANTIFIER, USE_VERB_SENSE, USE_JSON, USE_RELATION, USE_LAZY_INITIALIZATION, USE_SRL_INTERNAL_PREPROCESSOR, SPLIT_ON_DASH, USE_SENTENCE_PIPELINE, USE_TIMEX3, USE_MENTION, USE_TRANSLITERATION, USE_DATALESS_ESA, USE_DATALESS_W2V, USE_QUESTION_TYPER}; return (new AnnotatorServiceConfigurator().getConfig(new ResourceManager( generateProperties(properties)))); }