@Override
    public void initialize(Map<String, Param> params) throws TikaConfigException {
        LOG.debug("Initializing...");
        if (modelPath == null) {
            throw new TikaConfigException("Parameter 'modelPath' is required but it is not set");
        }
        try {
            URL resolvedUrl = null;
            if (modelPath.startsWith("http://") || modelPath.startsWith("https://")) {
                resolvedUrl = new URL(modelPath);
            } else {
                resolvedUrl = getClass().getClassLoader().getResource(modelPath);
                File file = new File(modelPath);
                if (file.exists()) { // file on filesystem gets higher priority
                    resolvedUrl = file.toURI().toURL();
                }
            }
            if (resolvedUrl == null) {
                throw new TikaConfigException("Model doesn't exists :" + modelPath);
            }
            LOG.info("Sentiment Model is at {}", resolvedUrl);
            long st = System.currentTimeMillis();
            SentimentModel model = new SentimentModel(resolvedUrl);
            long time = System.currentTimeMillis() - st;
            LOG.debug("time taken to load model {}", time);
            classifier = new SentimentME(model);
        } catch (Exception e) {
            LOG.warn("Failed to load sentiment model from {}" + modelPath);
            throw new TikaConfigException(e.getMessage(), e);
        }
    }
Path to model path. Default is {@value DEF_MODEL}
<p>
<br/>
The path could be one of the following:
<ul>
<li>a HTTP or HTTPS URL (Not recommended for production use since no caching is
implemented) </li>
<li>an absolute or relative path on local file system (recommended for production use in
standalone mode)</li>
<li>a relative path known to class loader (Especially useful in distributed environments,
recommended for advanced users</li>
</ul>
Note: on conflict: the model from local file system gets the priority
over classpath
tika-parsers/tika-parsers-ml/tika-parser-nlp-module/src/main/java/org/apache/tika/parser/sentiment/SentimentAnalysisParser.java