Combines Apache OpenNLP and Apache Tika and provides facilities for automatically deriving sentiment from text.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Sentiment Analysis Parser

A parser performing sentiment analysis that uses the Apache OpenNLP and Apache Tika libraries to perform text analysis on the the Large Movie Review Dataset. Negative and positive reviews were combined together in a file "result", and each review has a "positive" or a "negative" label before it.


How to build Sentiment Analysis Parser

$ cd $HOME/src
$ git clone
$ cd SentimentAnalysisParser
$ mvn install assembly:assembly

How to train a model

$ cd target/sentiment
$ mkdir -p model/org/apache/tika/parser/sentiment/topic/
$ bin/sentiment SentimentTrainer -model model/org/apache/tika/parser/sentiment/topic/en-sentiment.bin -lang en -data ./../../examples/categorical_dataset -encoding UTF-8

The model is written to en-sentiment.bin

How to run the parser

Make sure you are in target/sentiment

$ bin/sentiment Tika -model model/org/apache/tika/parser/sentiment/topic/en-sentiment.bin -o ../../examples/gun-output1 -j ../../examples/gun-ads


  • Chris A. Mattmann, JPL
  • Anastasija Mensikova, Trinity College, CT


This project began as the Google Summer of Code 2016 project of Anastasija Mensikova for Apache Software Foundation under the supervision of Chris Mattmann


Apache License, version 2