javaeclipsenlplingpipe

lingpipe sentiment analysis tutorial demo error?


I was doing the sentiment analysis a from lingpipe website tutorial, and I keep getting this error, is there anyone wo can help?

java -cp "sentimentDemo.jar:../../../lingpipe

e-4.1.0.jar" PolarityBasic file:///Users/dylan/Desktop/POLARITY_DIR/
BASIC POLARITY DEMO

Data Directory=file:/Users/dylan/Desktop/POLARITY_DIR/txt_sentoken
Thrown: java.lang.NullPointerException
java.lang.NullPointerException
at com.aliasi.classify.DynamicLMClassifier.createNGramProcess(DynamicLMClassifier.java:313)
at PolarityBasic.<init>(PolarityBasic.java:26)
at PolarityBasic.main(PolarityBasic.java:92)

Solution

  • The specified path file:///Users/dylan/Desktop/POLARITY_DIR/ should contain the unpacked data (see tutorial) in the directory txt_sentoken

    You can see this in the output:

    Data Directory=file:/Users/dylan/Desktop/POLARITY_DIR/txt_sentoken

    Also the the tutorial is not setup to use an URL, so the command should be

    java -cp sentimentDemo.jar:../../../lingpipe-4.0.jar PolarityBasic /Users/dylan/Desktop/POLARITY_DIR