Example usage for org.apache.lucene.analysis.opennlp.tools OpenNLPOpsFactory getNERTaggerModel

List of usage examples for org.apache.lucene.analysis.opennlp.tools OpenNLPOpsFactory getNERTaggerModel

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.opennlp.tools OpenNLPOpsFactory getNERTaggerModel.

Prototype

public static TokenNameFinderModel getNERTaggerModel(String modelName, ResourceLoader loader)
            throws IOException 

Source Link

Usage

From source file:org.apache.solr.update.processor.OpenNLPExtractNamedEntitiesUpdateProcessorFactory.java

License:Apache License

@Override
public void inform(final SolrCore core) {

    srcSelector = FieldMutatingUpdateProcessor.createFieldNameSelector(core.getResourceLoader(), core,
            srcInclusions, FieldMutatingUpdateProcessor.SELECT_NO_FIELDS);

    for (SelectorParams exc : srcExclusions) {
        srcSelector = FieldMutatingUpdateProcessor.wrap(srcSelector,
                FieldMutatingUpdateProcessor.createFieldNameSelector(core.getResourceLoader(), core, exc,
                        FieldMutatingUpdateProcessor.SELECT_NO_FIELDS));
    }//from   w ww.  j a va2 s  .c om
    try {
        OpenNLPOpsFactory.getNERTaggerModel(modelFile, core.getResourceLoader());
    } catch (IOException e) {
        throw new IllegalArgumentException(e);
    }
}