.coveringType(coveringAnnotationType) .lowercase(lowercase) .buildStringSequenceGenerator();
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); try { sequenceGenerator = new PhraseSequenceGenerator.Builder() .featurePath(featurePath) .filterRegex(numberRegex) .filterRegexReplacement(NUMBER_REPLACEMENT) .stopwordsFile(stopwordsFile) .stopwordsReplacement(STOPWORD_REPLACEMENT) .coveringType(coveringType) .buildStringSequenceGenerator(); } catch (IOException e) { throw new ResourceInitializationException(e); } }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); ParallelTopicModel model; try { getLogger().info("Loading model file " + modelLocation); model = ParallelTopicModel.read(modelLocation); if (maxTopicAssignments <= 0) { maxTopicAssignments = model.getNumTopics() / 10; } } catch (Exception e) { throw new ResourceInitializationException(e); } getLogger().info("Model loaded."); inferencer = model.getInferencer(); malletPipe = new TokenSequence2FeatureSequence(model.getAlphabet()); try { sequenceGenerator = new PhraseSequenceGenerator.Builder() .featurePath(tokenFeaturePath) .minTokenLength(minTokenLength) .lowercase(lowercase) .buildStringSequenceGenerator(); } catch (IOException e) { throw new ResourceInitializationException(e); } }