tokenizer.init(); NamedEntityRecognizer ner = new StanfordNamedEntityRecognizer(new File(args[0])); ner.init();
public BiuTreeBuilder() throws TokenizerException, PosTaggerException, NamedEntityRecognizerException, ParserRunException { splitter = new LingPipeSentenceSplitter(); tokenizer = new MaxentTokenizer(); tagger = new MaxentPosTagger(BiuTestParams.MAXENT_POS_TAGGER_MODEL_FILE); ner = new StanfordNamedEntityRecognizer(new File(BiuTestParams.STANFORD_NER_CLASSIFIER_PATH)); parser = new EasyFirstParser( BiuTestParams.EASYFIRST_HOST, BiuTestParams.EASYFIRST_PORT, tokenizer, tagger ); ner.init(); parser.init(); }
/** * Create an initialized NamedEntityRecognizer using the given configuration params. */ public static NamedEntityRecognizer createNamedEntityRecognizer(ConfigurationParams params) throws InstrumentCombinationException{ boolean doNer; try { doNer = (params.containsKey("do_named_entity_recognition")? params.getBoolean("do_named_entity_recognition"): false); if (doNer) { NamedEntityRecognizer ner = new StanfordNamedEntityRecognizer(new File(params.getFile("ner-classifier-path").getAbsolutePath())); ner.init(); return ner; } else return null; } catch (ConfigurationException e) { throw new InstrumentCombinationException("Nested exception with configuration file while initializing the NER", e); } catch (NamedEntityRecognizerException e) { throw new InstrumentCombinationException("Nested exception while initializing the NER", e); } } }
private void initializeInstruments() throws NamedEntityRecognizerException, ParserRunException, CoreferenceResolutionException { if (doNer) { instruments.getNamedEntityRecognizer().init(); } this.instruments.getParser().init(); this.instruments.getCoreferenceResolver().init(); this.areInstrumentsInitialized=true; }
instruments.getNamedEntityRecognizer().init();
instruments.getNamedEntityRecognizer().init(); try