I created a library for sentiment analysis in Java. The whole source code is here.
I wanted to add this implementation as a part of an ingestion pipeline using Ingestion plugin in Elasticsearch. For that I designed a plugin which is still development stage and the source is available here.
The plugin installs correctly but when I send the following request to ES:
{
"pipeline": {
"description": "Apply VADER sentiment analysis on text.",
"processors": [
{
"vader_analyzer": {
"field": "input",
"positive_polarity": "positive_polarity",
"negative_polarity": "negative_polarity",
"neutral_polarity": "neutral_polarity",
"compound_polarity": "compound_polarity"
}
}
],
"version": 1
},
"docs": [
{
"_source": {
"input": "The plot was good, but the characters are uncompelling and the dialog is not great."
}
}
]
}
I get the following error:
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
at com.vader.sentiment.analyzer.SentimentAnalyzer.boostByExclamation(SentimentAnalyzer.java:335) ~[?:?]
at com.vader.sentiment.analyzer.SentimentAnalyzer.boostByPunctuation(SentimentAnalyzer.java:331) ~[?:?]
at com.vader.sentiment.analyzer.SentimentAnalyzer.polarityScores(SentimentAnalyzer.java:265) ~[?:?]
at com.vader.sentiment.analyzer.SentimentAnalyzer.getSentiment(SentimentAnalyzer.java:235) ~[?:?]
at com.vader.sentiment.analyzer.SentimentAnalyzer.analyse(SentimentAnalyzer.java:54) ~[?:?]
at org.elasticsearch.plugin.ingest.vader.processor.VaderProcessor.execute(VaderProcessor.java:93) ~[?:?]
at org.elasticsearch.action.ingest.TrackingResultProcessor.execute(TrackingResultProcessor.java:47) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.ingest.CompoundProcessor.execute(CompoundProcessor.java:100) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.action.ingest.SimulateExecutionService.executeDocument(SimulateExecutionService.java:49) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.action.ingest.SimulateExecutionService$1.doRun(SimulateExecutionService.java:70) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:596) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-5.2.1.jar:5.2.1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[?:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[?:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_121]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_121]
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814) ~[?:1.8.0_121]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_121]
... 15 more
POM file for Sentiment Analysis Library.
POM file for Ingest Plugin.
I am not sure how to solve this issue?