/** * 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()); }
/** * 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); } }
/** * 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 {@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)))); }
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 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)))); }
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 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)))); }
Preprocessor(ResourceManager rm) { Map<String, String> nonDefaultValues = new HashMap<>(); nonDefaultValues.put(CuratorConfigurator.RESPECT_TOKENIZATION.key, Configurator.TRUE); nonDefaultValues.put("cacheDirectory", "annotation-cache-quantifier"); this.rm = Configurator.mergeProperties(rm, new AnnotatorServiceConfigurator().getConfig(nonDefaultValues)); if (!rm.getBoolean(PreprocessorConfigurator.USE_CURATOR)) { try { annotator = new BasicAnnotatorService(new TokenizerTextAnnotationBuilder( new StatefulTokenizer()), buildAnnotators(), this.rm); } catch (AnnotatorException | IOException e) { e.printStackTrace(); } } else { try { annotator = CuratorFactory.buildCuratorClient(this.rm); } catch (Exception e) { e.printStackTrace(); } } }
Preprocessor(ResourceManager rm) { Map<String, String> nonDefaultValues = new HashMap<>(); nonDefaultValues.put(CuratorConfigurator.RESPECT_TOKENIZATION.key, Configurator.TRUE); nonDefaultValues.put("cacheDirectory", "annotation-cache-quantifier"); this.rm = Configurator.mergeProperties(rm, new AnnotatorServiceConfigurator().getConfig(nonDefaultValues)); if (!rm.getBoolean(PreprocessorConfigurator.USE_CURATOR)) { try { annotator = new BasicAnnotatorService(new TokenizerTextAnnotationBuilder( new StatefulTokenizer()), buildAnnotators(), this.rm); } catch (AnnotatorException | IOException e) { e.printStackTrace(); } } else { try { annotator = CuratorFactory.buildCuratorClient(this.rm); } catch (Exception e) { e.printStackTrace(); } } }