public void initializeNER() { try { co = new NERAnnotator(ViewNames.NER_CONLL); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
/** * the viewName will be used as a KEY to instantiate/get the corresponding NER instance * * @param nonDefaultRm a non-null ResourceManager object containing non-default parameters for * the NER model named by the viewName parameter. * @param viewName assign a name to the NER view generated. As shipped, this should be * ViewNames.NER_CONLL or ViewNames.NER_ONTONOTES * @return an NERAnnotator with models instantiated according to the values of viewName and the * parameters in nonDefaultConfig. */ public static NERAnnotator buildNerAnnotator(ResourceManager nonDefaultRm, String viewName) { synchronized (nerAnnotatorMap) { NERAnnotator ner = nerAnnotatorMap.get(viewName); if (ner == null) { ner = new NERAnnotator(nonDefaultRm, viewName); nerAnnotatorMap.put(viewName, ner); } return ner; } } }
/** * the viewName will be used as a KEY to instantiate/get the corresponding NER instance * * @param nonDefaultRm a non-null ResourceManager object containing non-default parameters for * the NER model named by the viewName parameter. * @param viewName assign a name to the NER view generated. As shipped, this should be * ViewNames.NER_CONLL or ViewNames.NER_ONTONOTES * @return an NERAnnotator with models instantiated according to the values of viewName and the * parameters in nonDefaultConfig. */ public static NERAnnotator buildNerAnnotator(ResourceManager nonDefaultRm, String viewName) { synchronized (nerAnnotatorMap) { NERAnnotator ner = nerAnnotatorMap.get(viewName); if (ner == null) { ner = new NERAnnotator(nonDefaultRm, viewName); nerAnnotatorMap.put(viewName, ner); } return ner; } } }
/** * the viewName will be used as a KEY to instantiate/get the corresponding NER instance * * @param nonDefaultRm a non-null ResourceManager object containing non-default parameters for * the NER model named by the viewName parameter. * @param viewName assign a name to the NER view generated. As shipped, this should be * ViewNames.NER_CONLL or ViewNames.NER_ONTONOTES * @return an NERAnnotator with models instantiated according to the values of viewName and the * parameters in nonDefaultConfig. */ public static NERAnnotator buildNerAnnotator(ResourceManager nonDefaultRm, String viewName) { synchronized (nerAnnotatorMap) { NERAnnotator ner = nerAnnotatorMap.get(viewName); if (ner == null) { ner = new NERAnnotator(nonDefaultRm, viewName); nerAnnotatorMap.put(viewName, ner); } return ner; } } }
String modelName = this.resourceManager.getString(NerBaseConfigurator.MODEL_NAME); if (modelName.toLowerCase().equals("conll")) this.nerAnnotator = new NERAnnotator(this.resourceManager, ViewNames.NER_CONLL); else if (modelName.toLowerCase().equals("ontonotes")) this.nerAnnotator = new NERAnnotator(this.resourceManager, ViewNames.NER_ONTONOTES); else this.nerAnnotator = new NERAnnotator(this.resourceManager, "NER_OTHER"); } else { this.nerAnnotator = new NERAnnotator(this.resourceManager, viewName);
String modelName = this.resourceManager.getString(NerBaseConfigurator.MODEL_NAME); if (modelName.toLowerCase().equals("conll")) this.nerAnnotator = new NERAnnotator(this.resourceManager, ViewNames.NER_CONLL); else if (modelName.toLowerCase().equals("ontonotes")) this.nerAnnotator = new NERAnnotator(this.resourceManager, ViewNames.NER_ONTONOTES); else this.nerAnnotator = new NERAnnotator(this.resourceManager, "NER_OTHER"); } else { this.nerAnnotator = new NERAnnotator(this.resourceManager, viewName);
if (resourceManager == null) this.resourceManager = new NerBaseConfigurator().getDefaultConfig(); this.nerAnnotator = new NERAnnotator(this.resourceManager, "CONLL_DEFAULT"); System.out.println("Completed loading resources.");
public TextPreProcessor() throws Exception { this.useCurator = Boolean.valueOf(rm.getString(VerbSenseConfigurator.USE_CURATOR)); if (useCurator) { annotator = CuratorFactory.buildCuratorClient(); taBuilder = null; pos = null; ner = null; lemma = null; chunker = null; } else { annotator = null; taBuilder = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(false, false)); pos = new POSAnnotator(); ner = new NERAnnotator(ViewNames.NER_CONLL); lemma = new IllinoisLemmatizer(); chunker = new ChunkerAnnotator(); } }
public TextPreProcessor() throws Exception { this.useCurator = Boolean.valueOf(rm.getString(VerbSenseConfigurator.USE_CURATOR)); if (useCurator) { annotator = CuratorFactory.buildCuratorClient(); taBuilder = null; pos = null; ner = null; lemma = null; chunker = null; } else { annotator = null; taBuilder = new TokenizerTextAnnotationBuilder(new StatefulTokenizer(false, false)); pos = new POSAnnotator(); ner = new NERAnnotator(ViewNames.NER_CONLL); lemma = new IllinoisLemmatizer(); chunker = new ChunkerAnnotator(); } }